Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : How can I send a variable to other movie?


Carlos Gonçalves
5/8/2004 7:14:14 PM
I have this in a movie

opcao = 1

I want to send it to _level7.

I'm trying to use this:

_level7.opcao=1


Is it ok?
Why didn't it run?

kglad
5/8/2004 10:44:40 PM
Carlos Gonçalves
5/9/2004 12:16:48 PM
But is not running....



[quoted text, click to view]
opcao.

Jack.
5/9/2004 4:49:36 PM
you need to create a loop to check if enough of the movie
you are attempting to load is available before you attempt
to communicate with it. (an empty level==undefined)
one method is to use onEnterFrame, test in a simple set up,
frame#1of movie1
lev7var1 = "Hello";

movie0 loads movie1, with -
loadMovieNum("movie1.swf",7);

this.onEnterFrame = function(){
trace(_level7);
if(_level7){
trace(_level7.lev7var1);
delete this.onEnterFrame;
}
};

your output will show -
undefined
_level7
Hello

you need to apply this logic to the code that you posted in -
"sending a variable to other movie 2"

hth
AddThis Social Bookmark Button