Flash Question
Flash Question
- Started
- Last post
- 6 Responses
- nosaj
How does one call a Movie clip with a variable that is holding it's name?
ie
My_mc.gotoAndPlay(5); // this works
//
My_var = "My_mc";
My_var.gotoAndPlay("_down"); // this doesn't
- PonyBoy0
_root[my_mc].gotoAndPlay(5);
- PonyBoy0
sorry... I put the wrong variable in the brackets...
//string variable for 'My_mc' instance on main timeline
My_var = "My_mc";
//same as saying 'My_mc.gotoAndPlay(5);
_root[My_var].gotoAndPlay(5);
- nosaj0
Perfect - glad you were around today PonyBoy. I owe you one.
- PonyBoy0
:)
- jpea0
or something that took me a while to figure out, was referencing instance names within a loop:
for (i=0; i<6; i++){
myHolder['clip'+i]._x = xpos // would be myHolder.clip0, myHolder.clip1, etc...
}