# Making a movie play on a click of a button

**URL:** https://forum.kirupa.com/t/making-a-movie-play-on-a-click-of-a-button/26516
**Category:** Uncategorized
**Created:** [July 23, 2003, 7:40pm UTC](https://forum.kirupa.com/t/making-a-movie-play-on-a-click-of-a-button/26516 "2003-07-23T19:40:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bigbadmilkman](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@bigbadmilkman](https://forum.kirupa.com/u/bigbadmilkman)
#### Post date: [July 23, 2003, 7:40pm UTC](https://forum.kirupa.com/t/making-a-movie-play-on-a-click-of-a-button/26516/1 "2003-07-23T19:40:52Z")

</div>

Hi I want a feature, that when the user clicks on a button a movie plays, what would i need to put into the actions for that button? Ps I don’t know \*\*\*\* about flash so explain it like I am a baby!

---

<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: [July 23, 2003, 7:47pm UTC](https://forum.kirupa.com/t/making-a-movie-play-on-a-click-of-a-button/26516/2 "2003-07-23T19:47:12Z")

</div>

To make a button:

draw a shape on the stage (the big white square, hehe).  
With the black arrow tool select the whole shape and press ctrl+F8. Then choose button as your symbol, give it a name like myButton.

Put your movie clip on the stage also. Click on it, and in the property inspector give it an instance name, something like myMovie.

Then click on the button and in the actions panel for that button add the following:

on(release) {  
\_root.myMovie.play();  
}

Regards.  
Viru.

---

<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: [July 23, 2003, 7:50pm UTC](https://forum.kirupa.com/t/making-a-movie-play-on-a-click-of-a-button/26516/3 "2003-07-23T19:50:56Z")

</div>

Thats great man, but when i run the file the movie automatically plays by itself, how do i make it run only on the click of the button?

---

<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: [July 23, 2003, 7:52pm UTC](https://forum.kirupa.com/t/making-a-movie-play-on-a-click-of-a-button/26516/4 "2003-07-23T19:52:11Z")

</div>

Also I want the movie to be invisible until the user has clicked on it how do i go about doing that,sorry for the questions!

---

<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: [July 23, 2003, 7:55pm UTC](https://forum.kirupa.com/t/making-a-movie-play-on-a-click-of-a-button/26516/5 "2003-07-23T19:55:47Z")

</div>

Inside your movie clip add a stop action to the 1st frame like this:

Double click your movie clip so that you can edit it. Then in the 1st frame open the actions panel and add this:  
stop();

That will stop is from playing.

Now, go back on to your stage, and add the following action script by click on the movieclip instance ONCE:

onClipEvent(load) {  
this.\_visible = false;  
}

Then add to the button this:  
on(release) {  
\_root.myMovie.\_visible = true;  
\_root.myMovie.play();  
}

Regards,  
Viru.
