Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allow loaded movie to get variable from main flash program

Status
Not open for further replies.

NoviceFlashUser

Technical User
Sep 1, 2003
21
0
0
SG
hi all,

I need to load a .swf movie into my flash program. how can i at the same time also pass some variables to the .swf movie so that the .swf movie can manipulate the variable.

thanks
 


Regards,

cubalibre2.gif
 
hi,
thanks. but i can't derive much from the link. i tried using the code: loadmovie("text.swf?testing=90",holder);

but it is doing the other way which is passing variable from a swf to the main. how must i code to pass variable from main to a movie - swf. thanks

regards
mirage
 
Is the loaded external .swf loaded in the other main movie, or are you trying to have 2 different movies communicate with each other?

Regards,

cubalibre2.gif
 
hi oldnewbie,

Thanks. My program actually requires the main movie to pass some variables to other swf for displaying purposes. It will be loading a swf each time and I need it to pass some value to it.

regards
mirage


 
What is it with you guys tonight? You're not answering my question. Are these 2 (or more...) seperate movies embedded in the same (or not...) html, or will these external movies be loaded all be loaded within the main movie.
If it's the latter, then you can set a variable in the main movie by adding _level0 to the variable when defining it, making it a global variable (you could also use _global), that can be set or read from anywhere.
Thus if you set a variable in your main movie...

_level0.my_var1 = "watson";

Then when you've loaded an external movie, you could from that external movie either read that variable...

if(_level0.my_var1 == "watson"){
//Do someting...
} else {
//Do something else...
}

...Or you could event set it from that loaded movie with...

_level0.my_var1 = "Bill";



Regards,

cubalibre2.gif
 
hi oldnewbie,

Thanks. didn't know there is such an easy way to do it. thanks a zillion again and to those who reply.

regards
mirage
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top