I have an address i'm trying to load the yahoo maps with a particular address loaded initially. when I trigger it from a button click it works fine but if I try to trigger it from a completion Complete I get debugging errors and cant figure this one out... How can I modify this to get the getMap() function to load initially.
<?xml version="1.0" encoding="utf-8"?> <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" title="Yahoo! Maps" creationComplete="initApp()" styleName="TEXTa"> <mx:Script> <![CDATA[ import flash.events.EventDispatcher; private var _locLis:LocalConnection; private var _locSend:LocalConnection; // On map initialize private function initApp():void { yahooMap.source = "yahoo/YahooMap.swf"; initCom(); } // Initialize local connection private function initCom():void { // Setup local connection to listen for Flash 8 communication _locLis = new LocalConnection(); // Connect to local connection, after functions have been defined _locLis.allowDomain("*"); _locLis.client = this; _locLis.connect("swf9Lis"); // Setup local connection to talk to Flash 8 _locSend = new LocalConnection(); } // Send data to Flash 8 public function sendData(strMethod:String, ... args):void { _locSend.send("swf8Lis", strMethod, args); } // Called to get map based on address private function getMap():void { var arrAddress:String = new String("2070 Business Center Drive, Irvine, CA 92612"); sendData("setCenterByAddressAndZoom", arrAddress + ":~:6:~:0"); } ]]> </mx:Script> <mx:VBox> <mx:SWFLoader id="yahooMap" showBusyCursor="true" width="640" height="320"/> <mx:Button click="getMap()"/> </mx:VBox> </mx:Panel>