# Code problem, making Mc play

**URL:** https://forum.kirupa.com/t/code-problem-making-mc-play/64563
**Category:** flash
**Created:** [September 17, 2004, 2:20pm UTC](https://forum.kirupa.com/t/code-problem-making-mc-play/64563 "2004-09-17T14:20:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Davese](https://avatars.discourse-cdn.com/v4/letter/d/e19b73/32.png) [@Davese](https://forum.kirupa.com/u/Davese)
#### Post date: [September 17, 2004, 2:20pm UTC](https://forum.kirupa.com/t/code-problem-making-mc-play/64563/1 "2004-09-17T14:20:53Z")

</div>

Hi, im having problems executing correct action script. Im using movie clips and when using buttons under them everything works fine. Im putting the script in the maintimeline: code below:

e.g  
\_root.mainMenu.floor1\_btn.onRelease = function () {  
loadMovie (“comingsoon.swf” , “membersOnly”);  
};

Now what i want to do is when the timeline gets to say frame 200, ive an action waiting to play a movie clip (instance “liftMc”) but i can’t seem to get it to play?

i’ve tried writing a function as well as modifying the script above but i can never get it to play? hope someone can help please, i know this is basic stuff but i’ve been on it for hours. Beginners Eh!

cheers dave

---

<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 17, 2004, 3:01pm UTC](https://forum.kirupa.com/t/code-problem-making-mc-play/64563/2 "2004-09-17T15:01:53Z")

</div>

First of all; why make functions when you dont need them?  
first code can be changed to:  
**(**\_root.mainMenu.floor1\_btn.\*\*)\*\*onRelease {  
loadMovie (“comingsoon.swf”, “membersOnly”);  
}

in the main timeline; put a frameaction:  
liftMc.play();  
stop();

---

<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 17, 2004, 3:07pm UTC](https://forum.kirupa.com/t/code-problem-making-mc-play/64563/3 "2004-09-17T15:07:43Z")

</div>

Please post your code. Also, which timeline is supposed to get the frame 200, where’s liftMc? What’s the connection with the code you posted?

[Edit]Oups, crosspost 🙂

---

<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 18, 2004, 7:53pm UTC](https://forum.kirupa.com/t/code-problem-making-mc-play/64563/4 "2004-09-18T19:53:52Z")

</div>

> [@amanuo](#):
>
> First of all; why make functions when you dont need them?  
> first code can be changed to:  
> **(**\_root.mainMenu.floor1\_btn.\*\*)\*\*onRelease {  
> loadMovie (“comingsoon.swf”, “membersOnly”);  
> }
> 
> in the main timeline; put a frameaction:  
> liftMc.play();  
> stop();

* * *

i hope you don’t mind me contacting you,

The only reason i made a function was because i couldnt make it work any other way, (but that didnt work either). basically i think the problem is my code structure when coding with movie clips. when coding in timelines im fine, but when i start trying to control from the main timeline i come accross difficulties. i’m trying to learn action script, its just at the stage where things havent clicked.

i tried your code but this didnt work either.  
liftMc.play();  
stop();

ill explain in a little more detail basically im trying to make the liftMc play when i reach frame 180 (main timeline). inside the 1st frame of liftMc is a stop(); action so i figured a goto and play frame 2 of lift mc would be the obvious coding result. but putting the line of code together is causing me more problem than expected.

dave

---

<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 18, 2004, 8:03pm UTC](https://forum.kirupa.com/t/code-problem-making-mc-play/64563/5 "2004-09-18T20:03:03Z")

</div>

sorry the posted code in the first post, has no reference to my problem, its just how i was controlling buttons in a movie clip.
