Okay, it turns out to be a timing issue with LocalConnection... the file wasn't getting fully initalized before it was making another call... I put in a 10 millisecond delay and that solved the problem.
Mike Wm. Michael Hepp e: [EMAIL PROTECTED] From: [EMAIL PROTECTED] To: [email protected] Subject: [AFFUG Discuss] LocalConnection - Error #2044: Unhandled StatusEvent: Date: Tue, 6 May 2008 10:49:15 -0400 Okay, I need the help of all you gurus out there... Here is the situation: I am developing a course player (basically it handles the navigation) for some Captivate courses in FB3. As you know avm1 and avm2 do not play nice together. To get around that I am using LocalConnection. Unfortunately there is no way to add LocalConnection to the Captivate files, so I have created a “proxy” swf in AS2 to expose the Captivate API and can now load and control the Captivate files in my Flex app. Now I have started getting this “Error #2044: Unhandled StatusEvent:. level=error, code=” and can't figure out where it came from. My AS3 code is: private function init():void{ Security.allowDomain("*"); // *** ESTABLISH LOCAL CONNECTION *** fromSWF_LC = new LocalConnection(); fromSWF_LC.allowDomain("*"); fromSWF_LC.client = this; fromSWF_LC.addEventListener(StatusEvent.STATUS, onStatusError); fromSWF_LC.connect("swfToFlex_LC"); . . {just an area where I load some XML files for navigation} . // *** LOAD PROXY SWF *** loadProxy(); } // End init() //** Load the Proxy SWF that will control the Captivate SFWs private function loadProxy():void{ var newProxyCanvas:Canvas = new Canvas(); newProxyCanvas.horizontalScrollPolicy = "off"; newProxyCanvas.verticalScrollPolicy = "off"; swfLoader = new SWFLoader(); swfLoader.addEventListener(Event.COMPLETE, initCourseIntro); swfLoader.load("coursewareLibrary/AVM1Loader.swf"); newProxyCanvas.addChild(swfLoader); vsSlides.addChild(newProxyCanvas); } // End loadProxy() //** Load the Proxy SWF that will control the Captivate SFWs private function loadProxy():void{ var newProxyCanvas:Canvas = new Canvas(); newProxyCanvas.horizontalScrollPolicy = "off"; newProxyCanvas.verticalScrollPolicy = "off"; swfLoader = new SWFLoader(); swfLoader.addEventListener(Event.COMPLETE, initCourseIntro); swfLoader.load("coursewareLibrary/AVM1Loader.swf"); newProxyCanvas.addChild(swfLoader); vsSlides.addChild(newProxyCanvas); } // End loadProxy() *** THIS IS WHERE THE StatusEvent ERROR OCCURS /** Load a Captivate SWF into Proxy private function loadProxySWF(chptNum:int, swf:String):void{ toSWF_LC.send("flexToSWF", "execFunction", {funcName:"loadChapter", args:[swf, "0"]}); currentChapter = chptNum; } This is the Proxy swf code that loads the chapter file: // LocalConnection() FUNCTIONS FOR COMMUNICATION WITH FLEX SWFs //***************************************************** System.security.allowDomain("*"); var toFlexLC:LocalConnection = new LocalConnection(); // Outgoing toFlexLC.allowDomain("*"); var fromFlexLC:LocalConnection = new LocalConnection(); // Incoming fromFlexLC.allowDomain("*"); fromFlexLC.connect("flexToSWF"); // Function call received from flexToSWF file over LocalConnection fromFlexLC.execFunction = function(obj:Object):Void { trace("Object Arguments: " + obj.args); _root[obj.funcName].apply(null, obj.args); } // PROXY CREATION/LOADING FUNCTIONS //***************************************************** var loadListener:Object = new Object(); var intervalID:Number; var intervalPause:Number; var intervalResume:Number; var intervalLoadSWF:Number; var intervalCreationComplete:Number; //***************************************************** //***************************************************** loadListener.onLoadError = function(target_mc:MovieClip, errorCode):Void { trace("ERROR CODE = " + errorCode); } //***************************************************** loadListener.onLoadComplete = function(target_mc:MovieClip, httpStatus:Number):Void { trace("proxy onLoadComplete(): " + target_mc); } //***************************************************** loadListener.onLoadInit = function(target_mc:MovieClip):Void { trace("proxy onLoadInit(): " + target_mc); } //***************************************************** //***************************************************** function loadChapter(swf:String, slide:Number):Void{ txtDisplay._visible = true; var mcLoader:MovieClipLoader = new MovieClipLoader(); mcLoader.addListener(loadListener); mcLoader.unloadClip(swf, captivateMC); mcLoader.loadClip(swf, captivateMC); } If anyone can see where I am creating this error from, I would appreciate your input. Thanks, Mike Hepp Stay in touch when you're away with Windows Live Messenger. IM anytime you're online. ------------------------------------------------------------- To unsubscribe from this list, simply email the list with unsubscribe in the subject line For more info, see http://www.affug.com Archive @ http://www.mail-archive.com/discussion%40affug.com/ List hosted by FusionLink ------------------------------------------------------------- _________________________________________________________________ Get Free (PRODUCT) RED™ Emoticons, Winks and Display Pics. http://joinred.spaces.live.com?ocid=TXT_HMTG_prodredemoticons_052008 ------------------------------------------------------------- To unsubscribe from this list, simply email the list with unsubscribe in the subject line For more info, see http://www.affug.com Archive @ http://www.mail-archive.com/discussion%40affug.com/ List hosted by http://www.fusionlink.com -------------------------------------------------------------
