mit dem sound-objkekt kann man eigentlich alles bestimmen was so ein ton tun oder lassen kann.
einfach mal in flash f1 drücken und bei index nach soundobject suchen.
oder hier einfach mal die englische version:
To attach a sound to a Timeline:
1
Choose File > Import to import a sound.
2
Select the sound in the library, right-click, and choose Options > Linkage.
3
Select Export for ActionScript and Export in first frame; then give it the identifier a_thousand_ways.
4
Add a button to the Stage and name it playButton.
5
Add a button to the Stage and name it stopButton.
6
Add a movie clip to the Stage and name it speaker.
7
Select frame 1 in the main Timeline and choose Window > Actions.
8
To pause the movie until the user selects Play, in the Actions toolbox, click the Objects category, click Movie, Sound, and Methods, and double-click stop. Enter _root.speaker in the Object text box.
9
To create a new Sound object, in the Actions toolbox, click the Objects category, click Movie, click Sound, and double-click new Sound. Enter song = in the Expression text box.
10
In the Actions toolbox, click the Objects category, click Movie, Sound, and Methods, and double-click attachSound. Enter song in the Object text box and "a_thousand_ways" (including the quotation marks) in the Parameters text box.
11
To start the song, in the Actions toolbox, click the Objects category, then click Movie, Sound, and Methods, and double-click start.
12
To activate the speaker, in the Actions toolbox, click the Objects category, then click Movie, Movie Clip, and Methods, and double-click play. Enter _root.speaker in the Object text box.
Your code should look like this:
_root.speaker.stop();
song = new Sound();
song.attachSound("a_thousand_ways");
_root.playButton.onRelease = function() {
song.start();
_root.speaker.play();
};
13
To stop the speaker when the song ends, click the Objects category, then click Movie, Sound, and Events, and double-click onSoundComplete. Enter song in the Object text box. Enter onSoundComplete in the Method text box.
14
In the Actions toolbox, click the Objects category, click Movie, Sound, and Methods, and double-click stop. Enter _root.speaker in the Object text box.
Your code should look like this:
_root.speaker.stop();
song = new Sound();
song.attachSound("a_thousand_ways");
_root.playButton.onRelease = function() {
song.start();
_root.speaker.play();
song.onSoundComplete = function() {
_root.speaker.stop();
};
};
15
Choose Control > Test Movie to hear the sound.