all groups > flash actionscript > june 2006 >
You're in the

flash actionscript

group:

using global variables in loadMovie


Re: using global variables in loadMovie MattWilson.6185 NO[at]SPAM gmail.com
6/24/2006 8:37:58 PM
flash actionscript:

Try using _level0.languagechoice

_level1 should be the movie you just loaded, and if you load more
movies you will have _level2 3 and so on

_root will be the root of the current movie you are in. So you can use
_root in all of the different levels, _level is used to communicate
in-between movies.




[quoted text, click to view]
using global variables in loadMovie robertson NO[at]SPAM cruxmedia.ca
6/24/2006 9:29:12 PM
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
Re: using global variables in loadMovie juankpro
6/25/2006 3:24:43 AM
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.
Re: using global variables in loadMovie robertson NO[at]SPAM cruxmedia.ca
6/25/2006 8:41:00 AM
Thanks for the Tip, but they are both being exported as Flash Player 6
with AS2.0

AddThis Social Bookmark Button