-
One button to load different movies
I want to have 1 Next Button and 1 Previous Button in my movie. I want the next button to load movieB if movieA present, movieC if movieB is present and so on. The reverse should be true for the Previous Button. Can I do this with actionscript with only 2 buttons and 10 movies?
thanks,
Powersolo
-
Senior Member
Yes if the movies are named sequentially.Something like this....
First have .......
i=0;
...on the first frame.
//Next
on(release){
i++;
loadMovieNum("movie"+i+".swf");
}
//Prev
on(release){
i--;
loadMovieNum("movie"+i+".swf");
}
If you have other buttons that load movies you have to add the i variable to them also. For intsnce if you loaded movie3.swf with a button, the code on that button should have this added to it
i=3;
-
Thanks!
I'll give that a try. Just to make sure....
Do I add a frame action - "set variable", i as the varialble and 0 as the value, in the the first frame of the main movie, or movie with the button? Does that make sense?
thanks for all your help,
Powersolo
-
Senior Member
First frame of the movie.
If you use expert mode you can just paste the code in the actions panel.
There is something wrong with the code, I forgot to tell which level to load into so the code should be.
//Next
on(release){
i++;
loadMovieNum("movie"+i+".swf",1);
}
//Prev
on(release){
i--;
loadMovieNum("movie"+i+".swf",1);
}
That will make the external swf's load into _level1
You can also load into target movieclips ( easier to positions). But start with this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|