# Button in movie instances

**URL:** <https://forum.kirupa.com/t/button-in-movie-instances/8707>\
**Category:** Uncategorized\
**Created:** [November 26, 2002, 11:30pm UTC](https://forum.kirupa.com/t/button-in-movie-instances/8707 "2002-11-26T23:30:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![j0se](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/j0se/32/44_2.png) [@j0se](https://forum.kirupa.com/u/j0se)\
**Post date:** [November 26, 2002, 11:30pm UTC](https://forum.kirupa.com/t/button-in-movie-instances/8707/1 "2002-11-26T23:30:29Z")

</div>

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!)  
🙂

cheers

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 27, 2002, 1:31am UTC](https://forum.kirupa.com/t/button-in-movie-instances/8707/2 "2002-11-27T01:31:55Z")

</div>

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:

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

```

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

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

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 27, 2002, 11:38pm UTC](https://forum.kirupa.com/t/button-in-movie-instances/8707/3 "2002-11-27T23:38:03Z")

</div>

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  
=)
