# Multiple button actions

**URL:** <https://forum.kirupa.com/t/multiple-button-actions/18191>\
**Category:** flash\
**Created:** [April 14, 2003, 10:46am UTC](https://forum.kirupa.com/t/multiple-button-actions/18191 "2003-04-14T10:46:35Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![krillz](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@krillz](https://forum.kirupa.com/u/krillz)\
**Post date:** [April 14, 2003, 10:46am UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/1 "2003-04-14T10:46:35Z")

</div>

Hello all. What I’m trying to do is load two seperate swf’s in succesion at the press of a button. Right now when I press my button I have a ‘load movie’ action attached that loads the swf I designated, but after that one loads I want it to automatically go to the next swf I designate as soon as the first one finishes loading. Is that possible with some sort of action script?

Thanks, still new to this

---

<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:** [April 14, 2003, 10:50am UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/2 "2003-04-14T10:50:58Z")

</div>

I’m not sure exactly what you mean, so I can’t guarantee this will be what you’re after.

You might be able to load the first movie into a placeholder clip. This is an empty movie clip that sits either on or off teh stage, and can be hidden or visible. You can load your first movie into that, then when it has finished, load up another…

---

<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:** [April 14, 2003, 11:08am UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/3 "2003-04-14T11:08:24Z")

</div>

sounds worth trying. could you elaborate on the details on how this could be done (still very new to this)

---

<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:** [April 14, 2003, 3:27pm UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/4 "2003-04-14T15:27:23Z")

</div>

Ok the easiest way of doing what i think you are after would be to have a preloader on the first clip like this.[AS]stop();  
this.onEnterFrame = function() {  
if (this.getBytesLoaded()\<this.getBytesTotal()) {  
Total = this.getBytesTotal()/1000;  
Received = this.getBytesLoaded()/1000;  
Percentage = (Received/Total)\*100;  
this.PercentText = int(Percentage);  
this.bar.\_xscale=int(Percentage);  
} else {  
this.play();  
this.onEnterFrame = null;  
loadMovieNum(“yourmovie.swf”,1);  
}  
}[/AS]  
that way the first movie loads and starts playing then the second movie loads.  
alternatively put the load movie action anywhere in the first movie that way it loads the second one only once its already playing.  
Kitiaras idea is good and would work!! but which solution are you after im not sure so thought id add my two penneth.

---

<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:** [April 14, 2003, 3:54pm UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/5 "2003-04-14T15:54:14Z")

</div>

I just copied and pasted your action script (w/ “mymovie.swf”) and nothing happens. Here’s more detail (since i’m new to this it might seem wrong): I have (3) files. 1st, my main swf which is my main page. 2nd, my main to audio swf which is the transitional animation between the main page and my audio page. 3rd, my audio swf which is my audio page. The 2nd swf contains the way my main pg looks at the beginning, some animation, then it ends with the way my audio page looks (but its not the audio pg). At this point I need to know how the audio pg would load as soon as the ‘main to audio’ swf finishes it’s run (or an easier way to link this navigation). Hopefully this is a clearer explanation on how much of a rookie I still am, please be gentle.

---

<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:** [April 14, 2003, 4:02pm UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/6 "2003-04-14T16:02:48Z")

</div>

aah i see so the second movie is just an intro type thing then.  
You could try this :  
try putting the load movie code on the LAST frame of your second movie. That way when it plays its last frame it loads the third movie in!!  
[AS]stop();  
loadMovie(“yourmovie.swf”, “yourtargetclip”);[/AS]on the last Frame!!  
Or you could just put the animation sequance at the beginning of the third movie and cut out the need for the intro movie, or are the files to big to do this?

---

<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:** [April 14, 2003, 4:30pm UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/7 "2003-04-14T16:30:22Z")

</div>

I know what “yourmovie.swf” is (my audio pg.swf), but what is “yourtargetclip”?

---

<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:** [April 14, 2003, 6:08pm UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/8 "2003-04-14T18:08:32Z")

</div>

the target for the second clip to load into or if you using laodMovieNum the level you are loading it into.  
Which method are u using??

---

<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:** [April 14, 2003, 6:27pm UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/9 "2003-04-14T18:27:23Z")

</div>

I’m using the ‘loadmovie’ script. When I use the ‘loadmovie’ without the ‘yourtargetclip’ from your example, it works very nice except that the second movie has a different color background than the third movie,but keeps the second movie’s background instead of loading the third movies background. When using this example, it’s like the third movie is part of the second movie (3rd movie bieng a slave to the second movies parameters) instead of being seperate movies.

---

<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:** [April 15, 2003, 11:47am UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/10 "2003-04-15T11:47:30Z")

</div>

ok i thought i got what you were going on about but you have confused me??

> I’m using the ‘loadmovie’ script. When I use the ‘loadmovie’ without the ‘yourtargetclip’ from your example it works very nice except that the second movie has a different color background than the third movie,but keeps the second movie’s background instead of loading the third movies background

If you are using loadMovie how are you doing it without specifing a target clip?? which clip are you loading them into??  
and If the second movie is an intro why is it a different color from the third movie?  
Its all getting very confused so lets try again , basically you just want one movie to play then when its played you want it load the third movie in right ?

---

<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:** [April 15, 2003, 11:57am UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/11 "2003-04-15T11:57:30Z")

</div>

YES(sorry about the confusion).

---

<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:** [April 15, 2003, 12:31pm UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/12 "2003-04-15T12:31:46Z")

</div>

No problem it was just we seemed to be going round in circles a bit !!  
right so post the code you are using to load the second movie in, so i can understand where you are loading it to.

---

<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:** [April 15, 2003, 9:56pm UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/13 "2003-04-15T21:56:01Z")

</div>

loadMovieNum(“audio pg.swf”, 0);  
I’m starting to get a little confused as well.  
quote:If you are using loadMovie how are you doing it without specifing a target clip?? which clip are you loading them into??  
We’re probably not on the same page because like I said previously I am ssooooooo new to this. I’m even having some serious touble with the tutorials on this website (I’ve succeded in 1 out of 8). Thank you for your patients.

---

<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:** [April 16, 2003, 10:34am UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/14 "2003-04-16T10:34:14Z")

</div>

Ok you are using the loadMovieNum method which uses levels.

> loadMovieNum(“audio pg.swf”, 0);

In case you dont realise but the number after the file name is the level you are loading that clip into.  
Levels are like the regular layers on the timeline except you cant see them. However it is important to note that levels can only be occupied by one movie at a time.  
try this tutorial on loadMovieNum on [www.tableau.com](http://www.tableau.com)  
[http://www.tableau.com.au/tutorials/load\_movie\_tute/](http://www.tableau.com.au/tutorials/load_movie_tute/)  
or this:  
[http://www.tableau.com.au/tutorials/smooth\_transitions/](http://www.tableau.com.au/tutorials/smooth_transitions/)  
If you still dont get it give me a shout and ill give you the name of a good book or two to learn from ok, I am myself am self taught  
(as are many Flash programmers) dont get disheartened keep trying and you’ll get there in the end.

---

<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:** [April 16, 2003, 11:09am UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/15 "2003-04-16T11:09:23Z")

</div>

Thank you so much for your time. I’ll check out that site so I can learn how to walk before I run. Thanks again.

---

<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:** [April 16, 2003, 11:28am UTC](https://forum.kirupa.com/t/multiple-button-actions/18191/16 "2003-04-16T11:28:48Z")

</div>

Probably a good plan 🙂  
Hope all goes well good luck man glad i was of some use.
