# Stopping a mc with button

**URL:** <https://forum.kirupa.com/t/stopping-a-mc-with-button/5795>\
**Category:** Uncategorized\
**Created:** [September 22, 2002, 10:14am UTC](https://forum.kirupa.com/t/stopping-a-mc-with-button/5795 "2002-09-22T10:14:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![stig](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@stig](https://forum.kirupa.com/u/stig)\
**Post date:** [September 22, 2002, 10:14am UTC](https://forum.kirupa.com/t/stopping-a-mc-with-button/5795/1 "2002-09-22T10:14:19Z")

</div>

Hi can anyone help me I have made a movie clip and I have dragged it onto my main stage from the lib the mc is not on the main timeline  
I have a button and when I press it I would like the mc to stop  
I know very little about action script I have given an instance name to both button and mc.In the actions panel I work in normal mode how do I stop the mc when button is pressed  
Thanks for your help stig

---

<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:** [September 22, 2002, 10:42am UTC](https://forum.kirupa.com/t/stopping-a-mc-with-button/5795/2 "2002-09-22T10:42:39Z")

</div>

on (release) {  
\_root.yourmovie.stop();  
}

put that in the button and that should work, just put the instance name of the movie where it says your movie 🙂

---

<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:** [September 22, 2002, 10:43am UTC](https://forum.kirupa.com/t/stopping-a-mc-with-button/5795/3 "2002-09-22T10:43:37Z")

</div>

Since your MC is not on the main timeline, you could use something like this:

[COLOR=royalblue]on (release) {  
myMovieClip.mySecondClip.stop();  
}[/COLOR]

…with the first movie having an instance name of myMovieClip and the other mySecondClip!

---

<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:** [September 22, 2002, 10:52am UTC](https://forum.kirupa.com/t/stopping-a-mc-with-button/5795/4 "2002-09-22T10:52:36Z")

</div>

oops i didnt read that part about the main timeline…:-\ sorry

---

<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:** [September 22, 2002, 10:56am UTC](https://forum.kirupa.com/t/stopping-a-mc-with-button/5795/5 "2002-09-22T10:56:18Z")

</div>

i tried cutting and pasting your reply (joso reply)  
this is what i go back

Scene=Scene 1, Layer=text, Frame=1: Line 2: Expected a field name after ‘.’ operator.  
\_root.eq.stop();

the eq bit is my mc i dont have a layer for it i just drag it from lib

---

<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:** [September 22, 2002, 11:16am UTC](https://forum.kirupa.com/t/stopping-a-mc-with-button/5795/6 "2002-09-22T11:16:57Z")

</div>

did you put the code in the button? are the button and MC in the frame or is the button in the MC?

---

<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:** [September 22, 2002, 11:26am UTC](https://forum.kirupa.com/t/stopping-a-mc-with-button/5795/7 "2002-09-22T11:26:49Z")

</div>

Yes I put code in button button has its own layer on main t.line frame 1  
Mc has no layer on main t.line made mc (new symbol then made mc then dragged it from lib) I think I have got this all wrong (lol)

i have made other buttons on same layer  
that work they links to other pages using action s all ok there

---

<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:** [September 22, 2002, 12:54pm UTC](https://forum.kirupa.com/t/stopping-a-mc-with-button/5795/8 "2002-09-22T12:54:30Z")

</div>

Don’t use eq as a movie clip name, because Flash thinks you are referring to “=”, eg,

if (password eq “dude”).

---

<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:** [September 22, 2002, 1:00pm UTC](https://forum.kirupa.com/t/stopping-a-mc-with-button/5795/9 "2002-09-22T13:00:37Z")

</div>

(lol ) ok thanks for that and thanks to the others too  
stig

---

<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:** [September 22, 2002, 1:03pm UTC](https://forum.kirupa.com/t/stopping-a-mc-with-button/5795/10 "2002-09-22T13:03:04Z")

</div>

yes it worked thanks again to all
