PDA

View Full Version : variables again


Horst
11-21-2001, 09:46 AM
Hello everybody,

please forgive me, but Iīm in trouble with my variables again.

I want a mc (movie 1) to set a varible when itīs loaded, to tell that it is the current movie, like:
_root.current="movie 1";

when I hit a menu button, I want this movie to play to itīs end and tell another movie (defined by variable) to start when itīs ready

I did it like this:
onRelease
_root[current].play();
_root[current].next="movie2";

I guess itīs like usual, very simple, but where is my mistake?

Have a nice day
Horst

pinkaboo
11-21-2001, 11:35 AM
Just quickly I think I can see that because you called the path to your variable _root.current="movie 1"; you need to add that within your code here:

_root[_root.current].play();

Afraid I haven't stopped to take a much longer look (I'm just about to go home, got a half day at work today - yay!) but try that and see if it helps at all.

K

Ricod
11-21-2001, 01:17 PM
U could try a different setup. On the first frame of the MC u code :
_root:currentMovie="movieName";
on the last :
_root.myOtherMovie.gotoAndPlay(1);
stop();

but this way u don't do anything with the info u stored in _root:currentMovie. But u could always use that later.

Why are u using the [] brackets ? Are u storing in an array ?
Also if u want to access _root:currentMovie from anywhere else than _root u have to code :
eval(_root.currentMovie)

Horst
11-21-2001, 08:44 PM
you guys are fabulous!!!
Thanx a lot
Horst