Hey guys just want to give this small tip, if you are trying to make a button that starts and stops a sound or a song this is a simple way too do that without having to youse any code, there it goes:
1: draw on one layer a square and a triangle representing the play and stop button
2: register each of them as ex: play_btn and stop_btn(presswing F8 and asigning the button object value)
3:doubleclick on the play button to enter its stage. On the tiemline youll se the up, over, down and hit frames; click on "over" frame and push on the F5 button do the same on the down and hit frames but press F6 this time.
4:select the Down frame and go to the propertys panel.
5: import to the librerary the mp3 or wav sound/songs you want to attach and select it in the sound list menu in the propertys panel and then in the Sync list menu select PLAY
6:do the steps 3-5 for the stop button but this time in the SYNC list menu of the propertys panel select Stop
And thats it press ctrl+enter and test.
If you want to add more songs just give the buttons different instances like play1,2,3,4.... same for stop and attach the diferent sounds or songs like in step 5 and thats all.
Hope you find this usefull, was for me.
(there is one problem with this and it is that if you put more than one sound and you start the second sound without stopping the first the songs solape, and this issue would need some scripting i guess)
Yeah, that method has a lot of missing features, such as the ability to control the sound from scripting, such as the ability to stop it. But also things like knowing the progress and seeking.
__________________
Signature: I wrote a pair of articles about the timeline.
yea absolutly true but might be usefoul fore some cases, i tryet to set it up differently (see tread: Simple sound issue ), but i`m completely stop because im getting errors other arnīt and dont know what else try
But yes i am trying to deal with it because im missing things like u say sound control, pause, sound avoid sound overlaping and knowing witch track is playing if u could check where im stuck in the other thread ii be thankfoul
A lot could be done using simply a sound in the timeline of a graphic. Since a graphic timeline can be sync to a parent movieclip timeline. Stopping the parent will stop the graphic timeline and the embedded sound (if set to streaming). Now that would be your sound pause situation. Same could be done with a movieclip but the timeline of a movieclip has to be stopped directly since movieclips act independently. Better of course would be to handle everything using AS.