|
|
Search Tutorials
The Next Background ButtonOpen up the actions panel up for the button that you want to change the background to the next one. It is sensible to put this one on the right hand side, but it does not matter. Type in the following script.
on (release) {
a += 1;
if(a == 5) {
a = 1;
_root.Back.gotoAndPlay ("BG" add a);
}
else {
_root.Back.gotoAndPlay ("BG" add a);
}
textName=name[a]
}
You might now be able to see how this script works without me explaining it now because it is very similar to the previous background actionscript. I won't explain it all this time, just a few key points that have changed.
Thats it! You should now have a Flash movie that changes the background whenever the user clicks a button to change it. Click on Control>> Test Movie (CTRL and ENTER / CMD and RETURN) to try it out. My finished movie is shown below I also added an extra text box to tell you what the value of the variable a is so that you can see what is happening inside the movie.
|
||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||
|