A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: How do I play a sound with currentframe?

  1. #1
    Junior Member
    Join Date
    Feb 2006
    Posts
    14

    How do I play a sound with currentframe?

    The code below unfortunately results in the sound repeating at the framerate of the movie. I just need a simple "play a sound at a specific frame" function but can't figure this one out. Thanks for your help.


    Code:
    addEventListener(Event.ENTER_FRAME,soundFunction);
    function soundFunction(event:Event)
    {
    	if (naturepage.ocean_btns.currentFrame == 2)
    	{
    		ocean_channel.stop();
    		ocean_channel = ocean1.play(0,int.MAX_VALUE);
    		mySO.data.ocean = "2";
    		mySO.flush();
    	}
    
    }

  2. #2
    Junior Member
    Join Date
    Feb 2006
    Posts
    14
    Can anyone help me ? I have created a 4 button toggle and a different sound should be triggered when my movie clip is on any of the frames. How do I do this without actually putting the code inside each of the frames? I don't want to have it on a mouse event because I will be triggereing the sound by other means as well, like from a saved state. I just need some simple script to play a sound if its on a particular frame.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center