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] Tim Robertson wrote:
> 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
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
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.