As3 Error #2044 Localconnection
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies as3 as2 localconnection of this site About Us Learn more about Stack Overflow the company
Actionscript 3 Localconnection
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Flex Localconnection
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error #2044: Unhandled StatusEvent:. level=error, code= while sending values from child swf to parent swf up vote 1 down vote favorite I am trying to load a game.swf into main.swf and when the game in the game.swf completes it sends the score and stars got by playing the game -to the main.swf , but the problem is the main.swf is not receiving the values and giving the above said error. Please do help.. the code in main.swf to receive score and stars is, var receiving_lc:LocalConnection; receiving_lc = new LocalConnection(); receiving_lc.connect("gameToEngine"); receiving_lc.client = this; public function saveScore(score:int, stars:int):void { trace("score="+score.toString()+ " stars="+ stars.toString()); } the code in game.swf to send score and stars is, var sending_lc:LocalConnection; sending_lc = new LocalConnection(); function send_it(evt:MouseEvent):void { sending_lc.send("gameToEngine", "saveScore", score, 2); } my_btn.addEventListener(MouseEvent.MOUSE_UP, send_it); please help to solve this out.... GOT IT SOLVED.... with the help of fsbmain... Just need to make the receiving_lc a global variable... hope it helps.. actionscript-3 flash share|improve this question edited Jan 17 '13 at 12:39 asked Jan 17 '13 at 10:49 Maddy 4412 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted First, try to use domain independent local connection name, that is began with _, the _gameToEngine in your case and second add status event listener handle the StatusEvent error: sending_lc.addEventListener(StatusEvent.STATUS, onLCStatus); protected function onLCStatus(event:StatusEvent):void { trace("onLCStatus:", event.code); } UPD: to prevent garbage collecting of the receiving_lc store the link to it in the
code= on LocalConnection July 24th, 2009 mpricope This is a blog post to all that was almost to throw their computers out of the window because they got "Error #2044: Unhandled StatusEvent:. level=error, code=" trying to communicate through LocalConnection. So I am trying to send a message from a Flex application running in Flash Player to an AIR application. In the AIR application (called testAIR) I have something like: private function initApp():void { var inbound:LocalConnection = new LocalConnection(); //only allow connections from localhost inbound.allowDomain("localhost"); inbound.client = new http://stackoverflow.com/questions/14377371/error-2044-unhandled-statusevent-level-error-code-while-sending-values-fro Object(); //this is the function that will be called by the Browser App inbound.client.notifyPayment = function test():void { Alert.show("HERE"); }; inbound.connect("paymentSample"); } pretty straightforward, right from the book. In the Flex app I just do: outbound.connect("paymentSample"); outbound.send("app#testAIR:paymentSample","notifyPayment"); outbound.close(); You might think that this should work. Well … NOT. This is because in the AIR app the inbound LocalConnection is a http://miti.pricope.com/2009/07/24/the-infamous-error-2044-unhandled-statusevent-levelerror-code-on-localconnection/ variable that is declared in the local scope of a method. Now I was expecting that when I call the connect method the inbound object will be referenced by another object (some LocalConnection manager, or event handler) and it will not get garbage collected after the method ends. Well, apparently is not the case. Either there is a bug in AIR, either this reference is a weak reference so it gets garbage collected. This means that by the time you try to send the message from Flash Player your inbound object is long gone! The resolution is quite simple. You just need to reference the inbound object somewhere else, making him a member of class or something. In my case I just declare it as a private variable inside my MXML component: what is a narrative essay private var inbound:LocalConnection = new LocalConnection(); private function initApp():void { //only allow connections from localhost inbound.allowDomain("localhost"); .... Hope this will help someone Categories: Flash Player 10, flex, tips & tricks Tags: Comments (1) George July 24th, 2009 at 12:12 | #1 Rep
so many hurdles. Error #2044: Unhandled StatusEvent:. level=error, code= Solution: From Zack at the awesome crew http://troyworks.com/blog/2008/06/06/flash-local-connection-woes-and-workarounds/ creative. "The unhandled Status error on localConnection is coming from a http://board.flashkit.com/board/showthread.php?770389-LocalConnection-Problem failed "send()" when the client is not recieving. You need to add a listener for a StatusEvent. try catch won't do it because the error is asynchronous.)". Thanks Zack! Error #2044: Unhandled ErrorEvent Security localConnection (search) Solution: use lc.allowDomain("*") or lc.allowDomain("localhost") in testing. How to as3 error specify meaningful domains when running locally don't quite make sense to me yet. ArgumentError: Error #2082: Connect failed because the object is already connected. (search) Solution: use try catch around the lc.connect attempt. Tagged as: localconnection { 0 comments… add one now } Leave a Comment Name * E-mail * Website Notify me of followup comments as3 error #2044 via e-mail Previous post: Troyworks AS3.0 framework on Google Code Next post: Eclipse: JVM Terminated. Exit Code=-1 SOLUTION Tagsactionscript ADDED adobe AdobeMax2009 air as3 blend Cross-platform css debugging E4X embedded embedded video error fdt flash Flash Player FocusManager font fonts garbage collection google analytics Google Chrome Google OS html IA iXd javascript prototyping PX runtime shared libraries S3 skype SOS SWF SWFObject textfield titanium-app. trace useability UX Wireframe workflow XD XHTML June 2008 M T W T F S S « May Jul » 1 2345678 9101112131415 16171819202122 23242526272829 30 Archives March 2012 October 2011 June 2011 May 2011 April 2011 October 2010 September 2010 May 2010 March 2010 February 2010 January 2010 October 2009 September 2009 August 2009 July 2009 June 2009 May 2009 April 2009 March 2009 February 2009 January 2009 December 2008 November 2008 October 2008 September 2008 August 2008 July 2008 June 2008 May 2008 April 2008 March 2008 February 2008 January 2008 December 2007 November 2007 October 2007 Septemb
LocalConnection Problem If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 3 of 3 Thread: LocalConnection Problem Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 06-23-2008,01:20 PM #1 paragonc View Profile View Forum Posts Visit Homepage Member Join Date May 2005 Location San Francisco Posts 55 LocalConnection Problem Hello, I have a projectthat relies heavily on LocalConnection to keep swfs communication with the master swf. Recently, i've been getting the following error at various points in the project: Code: Error #2044: Unhandled StatusEvent:. level=error, code= It seems to happen more often on page refresh, instead of on the initial page load. But it's not consistent. It does happen on page initialization sometimes as well. Anyone know what this means? It locks up my entire desktop for flash. If i try and even browse to another flash site after this, the plug in stalls out. The only solution is for me to reboot my system. Reply With Quote 06-23-2008,02:47 PM #2 paragonc View Profile View Forum Posts Visit Homepage Member Join Date May 2005 Location San Francisco Posts 55 Ahh i finally figured it out. Whenever you attempt to send data using LocalConnection, you need to ensure you have an event listener to handle any errors, especially if there's a chance the other connections have yet to open. i simply added Code: myOutboundConnection.addEventListener(StatusEvent.STATUS, onStatus); private function onStatus(event:StatusEvent):void { { switch (event.level) { case "status": trace("One of your LocalConnection variables was able to connect"); break; case "error": trace("One of your LocalConnection variables FAILED to connect"); break; } } } Reply With Quote 06-29-2011,04:37 AM #3 gmez View Profile View Forum Posts Junior Memb