Hi folks, here is the set up. I’m working with three files. Main.swf which contains navigation.swf in a blankmc, empty mc called mcContent where navigation sleclected materials are loaded.
In the navigation.fla here is the code
[AS]trace(“now defining global”);
_global.loadFile_str = strPicName;
trace(“global defined as”);
trace(_global.loadFile_str);
_root.mcContent.loadMovie(“monthlyreports.swf”);
[/AS]
which leads to the trace results of…
[AS]now defining global
global defined as
images/cbookings.jpg
[/AS]
when i do a trace of loadFile_str in the first frame of monthlyreports i get a undefined. I have tried trace(loadFile_str) and trace(_global.loadFile_str)
I also noticed that if i define the global on the main movie ( it maintains the global variable, the navigation fla will not overwrite it) not sure if that helps anything but i thought i let you know.
Hi,
It works for me.
i’ve made a movie called navigation.swf and other monthlyreports.swf (as yours =) ) as follows…
// first frame in **navigation.swf**
trace("now defining global");
_global.loadFile_str = "strPicName";
trace("global defined as "+_global.loadFile_str);
this.loadMovie("monthlyreports.swf");
and…
// first frame in **monthlyreports.swf**
trace(loadFile_str+" (located in external swf)");
Output window displays…
now defining global
global defined as strPicName
strPicName (located in external swf)
Maybe it was a bugish kind of a thing. Its not the first time i’ve had something work in one file and not in others. I’ll give your files a shot and hopefully it works!
heres a thought…
i got the impression you were trying to set the global variable to a local variable called strPicName…
does strPicName actually have a value??
meh… just a thought