PDA

View Full Version : Using Variable as Movie Clip Name


donaloh
12-03-2002, 01:55 PM
Hello All:
I want to cycle through several movie clips for a training application. I plan to use an array to hold the clip names, and a variable (CurrentClip) to set visibility and allow me to use a single pause/ play button throughout.

For the visibility, I've found that...
CurrentClip._visible = false; does NOT work.
But...
setProperty (CurrentClip, _visible, false); does work.

However, for the pause/play function....
CurrentClip.stop(); does NOT work.

Seems like it's looking for a clip with the literal name "CurrentClip" instead of the variable value.

How do I get around this? Is there an alternative way to call the MovieClip.stop() method that will allow me to use a variable for the clip name?

Many thanks,
donaloh

tg
12-03-2002, 03:01 PM
try:

this[currentClip]._visible=false;
this[currentClip].stop();

donaloh
12-03-2002, 03:11 PM
That's it TG...Many Thanks!