View Full Version : Desperate for help AS3-->AS2 localConnection
cry4dawn
January 29th, 2010, 05:14 PM
Okay guys I am losing too much hair over this. Really hoping some kirupa genius can shed some light on this. Heres what im trying to accomplish:
An as3 .swf wrapper in domainA loads an as2 .swf from domainA and an as3 .swf from domainB. I had a bit of difficulty making this work as all of the files in the domainB movie had to have Security.allowDomain("*") in order to work. But i got it and its working great.
Now I want my as3 .swf from domainB to call a function in the as2 .swf on domainA. I have tried using a local connection to no avail. I continue to get the error:
Error #2044: Unhandled StatusEvent:. level=error, code=
In my searching it seems this is often related to the allowDomain....
I have tried lc.allowDomain("*"), lc.allowInsecureDomain("*"), lc.allowDomain("domainA").... no help
I tried specifying sendLC.send("domainA.com:Connection", "Method")... no help.
Ive even tried gskinners SWFBridgeAS3 utilities and not been able to get anything to pass between these friggin movies!!!
Any help would be very appreciated!
Krilnon
January 29th, 2010, 06:32 PM
What's the parent/child relationship between the three .swf files? From your post, my most accurate guess is that you have:
AS3 wrapper SWF, from domain A
--> AS2 SWF, from domain A
--> AS3 SWF, from domain B
…where the wrapper SWF is the direct parent of both of the other two SWFs. Is that correct?
From there, you want the AS3 child SWF to call a method of the AS2 child SWF? And both SWFs are LocalConnection "aware", as in, one is exposing functions to be called and the other is attempting to make a function call over the established LocalConnection?
I realize that I'm asking a lot of questions, but I want to make sure that I have the right situation in mind before I try to help. :) Back in 2008, I actually started a really cool project that was (in theory) way easier to use than SWFBridge, but I seemed to be one of about three people total interested in it, so I never finished it.
cry4dawn
January 29th, 2010, 08:01 PM
Krilnon,
Yes, you have the scenario down. As it so happens, domainB is also a subdirectory on the same server as domainA. When I changed the loader to load the third clip from a path on domainA all of my local connections began behaving. It doesn't seem to break the other movie so I guess the problem is solved... kinda!
Since you have experience with this perhaps you can help....
I have encountered another problem that for the sake of duplicating made a simple as3 holder for my as2 swf:
var slLoader:Loader = new Loader();
slLoader.load(new URLRequest("myas2movie.swf"));
addChild(slLoader);
So everything loads fine and works initially but then I notice that anything that I try to load afterwards doesnt "listen" to the first command. It seems to trigger the function when I trace but a call for example to myMovieClipLoader.loadClip("some.swf") in the same function gets ignored the first time I press it but goes through the second time I press it.
This is obviously frustrating me to no end ... i am so close to being finished with this and now this has me stuck. Any clues?
cry4dawn
January 30th, 2010, 02:17 PM
I am still struggling with this. I was able to make it work by calling the loadClip() twice ... go figure. It's dirty and I don't like it. It is still behaving screwy. Everything works as it should in Firefox but i start having loadClip(); issues again in IE.
wvxvw
January 30th, 2010, 03:50 PM
Well, from how you describe it, the only thing I may suspect is that there may be some timing issue, like, you may be referring to something which hasn't been loaded yet. Otherwise it's difficult to tell without seeing the code.
glosrfc
February 1st, 2010, 05:38 PM
With your localConnection issue, try preceding the connection names with an underscore as described here in the section titled Different domains with unpredictable domain names
http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/net/LocalConnection.html
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.