|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to play a sound at certain frame lable?
I have the loading audio file at frame one. However, I want to play the audio only at specific frame or frame label. How do I do that? Below are my codes:
Quote:
The above plays the sound as soon as the .swf file is loaded. But I want to play at certain point in time, say frame number or frame label. I want to be able to put all my action script on frame one (or one location) instead of all over the time line. Any help is much appreciated. |
|
#2
|
|||
|
|||
|
perhaps
Quote:
Quote: //start of sound section is for sound var soundReq:URLRequest = new URLRequest("FlashFiles/audioFiles/mySoundmp3"); var sound:Sound = new Sound(); sound.load(soundReq); sound.addEventListener(Event.COMPLETE, onComplete); //end of sound section function onComplete(event:Event):void { sound.play(); } ya why not just use something like { sound.play("frame_lable") }, or { sound.start("frame_label") } |
|
#3
|
|||
|
|||
|
You can create an enter frame listener so when it reaches that frame the sound will play
addEventListener(Event.ENTER_FRAME, myFunction); function myFunction(event:Event) { if (myMovieClip_mc.currentFrame == 5) { onComplete(); } } change 5 to whatever frame you want the sound to play. |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Flash Development > How to play a sound at certain frame lable? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|