Passing a variable from one swf to another

hey guys,

I’m trying to pass a variable from my main swf to another one that’s being loaded in a container in the main swf. What I usually do is create that variable in the main swf and have the loaded swf fetch it but in this instance I need the loaded swf to have it’s own root.


container._lockroot = true;
container.loadMovie("main.swf");
if(_root.lang == "french") {
 trace("french was pressed");
 container.lang = "french";
}
else {
 trace("english was pressed");
 container.lang = "eng";
}

If a trace lang in my main.swf I get undefined. Any ideas on what I can do?

Are you using trace(lang); || trace(container.lang); ?

I’m using trace(lang) but that’s because I’m tracing it from inside of the container

try trace(this.lang); inside container?

still gives me undefined…

When does the container do the trace? On the first frame?

In other words…

In the output panel do you see:

undefined
english was pressed

or

english was pressed
undefined

I see the 2nd one

english was pressed
undefined