How to Make a Simple Interactive Movie With Flash
Adobe Flash enables you to build dynamic presentations using a variety of items, such as photographs, buttons, audio and video. Flash’s capability to include a variety of multimedia objects makes it a useful tool for creating interactive movies. Create a simple movie that includes audio and use the ActionScript “setVolume” method to provide a means for your user to adjust the sound level.
Instructions
-
-
1
Launch Adobe Flash. Click “Import,” then “Import to Library” to import an MP3 audio file. Choose your file, and click “Open”.
-
2
Right-click the MP3 from the Library panel, and choose “Linkage” from the menu. Click the “Export for ActionScript” option. Type a linkage name in the “Identifier” field, such as “mp3file.”
-
-
3
Type a plus sign (+) on the stage using the Text tool to create a button. Press “F8” and choose the “Movie clip” option. Press “Ctrl” and “F3” to display the Properties panel if it is not visible. Type “upBtn” in the “Instance Name” field of the Properties panel. Position the button in the area you want it to display.
-
4
Type a minus sign(-) on the stage. Press “F8” and create another movie clip as in the step above. Type “downBtn” as an Instance Name.
-
5
Press “F9” to display the Actions panel. Insert the volume buttons code:
mp3Sound = new Sound();
mp3Sound.attachSound("mp3file ");
mp3Sound.start();
mp3Sound.setVolume(35);upBtn.onRelease = function()
{
if(_root. mp3Sound.getVolume() < 100){
_root. mp3Sound.setVolume(_root. mp3Sound.getVolume() +5);
}
}downBtn.onRelease = function()
{
if(_root. mp3Sound.getVolume() >5){
_root. mp3Sound.setVolume(_root. mp3Sound.getVolume() -5);
}
}The “mp3Sound” value identifies the sound object that plays “mp3file” and calls the methods to control it. Volume values can range between 0 to 100. The onRelease function is called when the associated button is clicked.
-
6
Press “Ctrl” and “Enter” to test the button functionality.
-
1
Resources
- Photo Credit Jupiterimages/Photos.com/Getty Images