[Bindable] public var foo:String;
override public function myMap() { super(); this.addEventListener(FlexEvent.CREATION_COMPLETE, onCreationComplete); } private function onCreationComplete(event:FlexEvent):void { BindingUtils.bindSetter(setterFunc, MapData.instance, "ext"); } private function setterFunc(ext:Extent):void { this.extent= ext; }
I did a few test and the only way (in code) that I could do it was like below�?�
I modified it to match your code so there could be some modifications need.. If anything it will give you some cluesoverride public function myMap() { super(); this.addEventListener(FlexEvent.CREATION_COMPLETE, onCreationComplete); } private function onCreationComplete(event:FlexEvent):void { BindingUtils.bindSetter(setterFunc, MapData.instance, "ext"); } private function setterFunc(ext:Extent):void { this.extent= ext; }
<ns1:myMap extent="{MapData.instance.ext}" width="800" height="250"> <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/> </ns1:myMap>