Information Technology Reference
In-Depth Information
Add ActionScript to the trigger_btn
We have done all the setup, now we must call on ActionScript to add the
interactive functionality that we need to get this button working.
We want to accomplish two things:
Stop all sounds (ActionScript) stopAllSounds(); and
gotoAndPlay(“stop”)
Start a sound (ActionScript) gotoAndPlay(“play”)
Here are the scripts
Click on the invisible button keyframe in Frame 1:
Add this ActionScript
on (release) {
stopAllSounds();
gotoAndPlay(“stop”);
}
Click on the invisible button keyframe in Frame 2:
Add this ActionScript
on (release) {
gotoAndPlay(“play”);
}
Hit CTRL+ENTER to test the movie.
Hopefully it worked. If not, check your layers and review the steps
carefully.
When completed, save the Flash movie to the root directory of your site and
name it music_switch.swf. Then publish the movie and the SWF file is
automatically generated by Flash.
The Guts of this Flash Object
When the Flash audio button is launched the sound automatically starts playing.
When the button is pushed the play head is sent to Frame 2 which it is told to
Search WWH ::




Custom Search