Button in movie instances

hola

this is flash mx actionscript (see, i read the post it!)

ok, i have a button with a dynamic textbox. the button is in a movie called button_mc and i have placed some instances of it in the main time line. i’ve called each instance butt1, butt2, butt3…

i now load the button text for each instance through variables in frame 1 of the time line (butt1.text=“about us”…)

ok - the prob is that i can’t place ‘goto’ code on each movie instance as i would with a button, and if i place a ‘gotoAndPlay(“label1”);’ on the actual button (inside button_mc) then all my instances (on the main time line) will obviously point to the same label

i’m trying to figure a way around this

can i access the mc_insance name? - if i can do something like this in the button code:

on(press){
trace(_root.MCinstanceName)
}
(MCinstanceName is a desc of what i’m trying to do)

if i can identify what instance has been clicked, i can then direct to the right label

i don’t want to do:

if butt1{…

in the button code because it then becomes dependent on those insance names always being the same

maybe there is an easier way to do this?

(don’t explain it as badly as i have otherwise i’m done for!)
:slight_smile:

cheers

I’m not understanding what you are doing here, if you could attach an fla it would help.

You have a button which you have placed inside a movie clip. Do you have all your buttons inside this one movie clip or one button inside the movie clip and several instances of the movie clip.

as for returning the name of your button the code would be:

on (press){
     trace (this._name);
}

if you want the name of the MC that the button is inside of put this on your button:

on (press){
     trace (this._parent._name);
}

answer: one button inside the movie clip and several instances of the movie clip.

===
on (press){
trace (this._name);
}

that’s exactly what i needed!

thanks Sorcerer
=)