Skip to main content
Inspiring
June 25, 2006
Question

using global variables in loadMovie

  • June 25, 2006
  • 2 replies
  • 187 views
Hi,

I have a main SWF movie where I declare a global variable :

_global.languagechoice = "french";

on the first frame.
I later user loadMovie to load a second SWF into the main movie. I can't
seem to access the "languagechoice" variable though. here is what I have
tried :

if (_global.languagechoice == "french") {
caption-en._visible = false;
caption-fr.gotoAndStop(1);
} else {
caption-fr._visible = false;
caption-en.gotoAndStop(1);
}

****** and I tried this

if (languagechoice == "french") {
caption-en._visible = false;
caption-fr.gotoAndStop(1);
} else {
caption-fr._visible = false;
caption-en.gotoAndStop(1);
}

****** and I tried this

if (_root.languagechoice == "french") {
caption-en._visible = false;
caption-fr.gotoAndStop(1);
} else {
caption-fr._visible = false;
caption-en.gotoAndStop(1);
}

I also tried them all just using single "=" as well, but nothing works,
any thoughts? is it possible?

Thaks for any input
Tim
This topic has been closed for replies.

2 replies

Inspiring
June 25, 2006
Thanks for the Tip, but they are both being exported as Flash Player 6
with AS2.0

Any other suggestions?
Inspiring
June 25, 2006
When the loader swf and loaded swf are exported for different flash versions, i.e. loader for Flash 6 and loaded for Flash 7, then the global object will not be shared. Instead a different global object will be used by both files and you will never be able to read the other files global object.