passing map controls between mxml files

311
1
02-05-2012 11:07 AM
NadirHussain
Occasional Contributor II
Dear All
i want to pass map control from my main file to other mxml file.where i can get the all layers and on off from that component.

Thanks in advance.
Tags (2)
0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus
Nadir,

  If you make the map a public var in your main (index.mxml) mxml file than you can get access to it from other mxml file by using code like this:

import mx.core.FlexGlobals;
FlexGlobals.topLevelApplication.myMap;


Don't forget to click the Mark as answer check and to click the top arrow (promote) as shown below:
0 Kudos