Quantcast
Channel: Forums - ArcGIS Viewer for Flex
Viewing all articles
Browse latest Browse all 2097

Map Object: copying vs. referencing?

$
0
0
Hi all:

I'm having a confusing moment as why code implementation works the way it does. I'm a self-learned programmer so I'm probably missing some fundamental understanding of ActionScript.

Why does this work?
Code:

var _map:Map = map;  // map is from BaseWidget access.

_map.zoomTo(...);

When I create variables that way, the new variable doesn't affect the old variable. So why does the new _map refer directly to map? I've used this to pass access to map into subcomponents such as a tab within a BaseWidget widget.

Sidenote: is there a better way to let subcomponents access map when it's not an extension of BaseWidget?

Viewing all articles
Browse latest Browse all 2097

Trending Articles