We have a piece of JavaScript like this:

swf.SetVariable("_level1.myvar","myvalue") ;

This JS code is triggered by a piece of Flash code that is executed when the
SWF loads.  However, it appears that the variable is not immediately set:

// Called at load time for the SWF
getURL("javascript:doSet()") ;
trace(_level1.myvar);            // Reports nothing

But waiting and tracing the variable's value later seems to work:

this.onEnterFrame = function() {
   trace(_level1.myvar) ;        // This prints correct value
}

Can anyone confirm this behavior?  Is there some delay here (e.g. JS takes
100ms to respond) or is that the value is set when the movie clip's timeline
starts up and not until then?

It's all just a bit mysterious...

Doug

P.S. This is Flash 6 code, running in Flash player 9.  Browser is Firefox or
IE 7, both behave the same.

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to