PDA

View Full Version : super easy pathname question


hifu
08-17-2002, 08:56 PM
I can't figure out how to use a variable in a pathname. I have a movieClip called "circleClip1" and given a condition, I want a button to gotoAndPlay frame 2 of circleClip1. But I want to use a variable instead of naming "cirlcleClip1" directly. I've tried:

var variable="circleClip1"
_root.variable.gotoAndPlay(2);

and it doesn't work. I'm sure this is easy, but I can't figure it out.

Abelius
08-17-2002, 09:45 PM
Yes, you can do it. Just don't name it "variable"...

:)

I have one movie with one button (go_btn) and one movieClip caled "fire_mc" with 2 frames and a "stop()" action in the first keyframe.
Then insert this code on the button:

on (release) {
myVar = fire_mc;
_root.myVar.gotoAndPlay(2);
}


That should help... :)