access variables from parent swf into loaded swf


Hi all,

I have an AS3 swf that I am using mainly to load another AS2 swf. AS3.swf is embedded in a HTML which uses Flashvars to pass parameters to AS3.swf. AS3 successfully loads AS2 and Flashvar values are collected into local AS3 variables.

AS2 has a text_field str1 and I want to pass to it, the Flashvar value collected by AS3 in the local var as depicted by code below.

myVar = flashVar1;      // Flashvar collected in local variable in AS3
// load the AS2 using loadBytes.
var myL : Loader = new Loader();
myL.loadBytes(bytes, new LoaderContext(false, new ApplicationDomain())); 
str1.text = myVar;    // wanting to pass the value of AS3 variable myVar to textbox str1 in AS2.
  1. How to pass the value of myVar (AS3) to str1.text (AS2) ??
  2. Is it possible to remove AS3 altogether once the varable value is collected in the AS2.

Right now my AS2 is loaded on top of AS3 and the the scene 1 of AS2 overlaps the scene 1 of AS3. Hence I would like to just remove AS3 once it has done the needful.

I hope I am able to explain this clearly enuff.

Thanks loads !!


As3 and as2 can’t directly talk to each other. You need some extra trickery like using local connection. See


I think I made a really neat bridging prototype for this and posted it on kF ~10 years ago. Used a proxy or something to make the syntax pretty natural and transparent.


HI, Thanks for the response Senocular & Krilnon.

I will dig into this info and revert. Meanwhile may I request you to also shed some light on the 2nd part of my question, namely that, is it possible for the loading file (parent) to remove itself and let the child continue to play from thereon?

@ Krilnon: Do you have any inkling to the name of your article or any tags that i may search for to locate it?

Thanks a ton.


Ah, found it:

Provided “as is”, without warranty of any kind, express or implied

You can’t completely remove the AS3 context. root is always going to be an AS3 DisplayObject.


Thanks a ton Krilnon,

Thanks for clarifying that I cannot do away with the parent that calls the As2.swf and for taking time to find the link for me. Will go thorough & revert.

Thanks loads.