A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: looping sound

  1. #1
    亲爱钰 slingsrat's Avatar
    Join Date
    Mar 2002
    Location
    Middle Earth
    Posts
    229

    looping sound

    Is it possible to loop a sound indefinitely with flash? Surely there must be but I cannot find out how.

  2. #2
    The simple way would be to embed it into a movie clip with as many frames as the sound - then it returns to the begining and loops.

  3. #3
    亲爱钰 slingsrat's Avatar
    Join Date
    Mar 2002
    Location
    Middle Earth
    Posts
    229
    The loops need to be seamless. Theres no actionscript to facilitate this?

  4. #4
    Senior Member layerburn's Avatar
    Join Date
    Jul 2006
    Location
    USA
    Posts
    542
    Here is an example .fla that I've given to others to demonstrate how to handle sound internally using actionscript. If you look at the code on the Sound AS layer you will see how to loop the sound, i'm not sure what the highest number is that flash can handle, i use 99 for all my projects. For the example to work you will need to import a sound into the .fla and give it a linkage identifier of song1 for the example to work, it won't be necessary to drag the sound onto the stage, the actionscript references the identifier. If you want the sound to be seamless you'll have to edit the sound itself for the best results, maybe having it fade out or something.
    Last edited by layerburn; 08-28-2007 at 06:14 PM.
    This is your brain. This is your brain on script.

  5. #5
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    fwiw .. import a .wav file, not .mp3
    mp3 by default introduces a silent portion ( id3 tag holder ??)
    and breaks up the seamless loop

    the fla size might seem huge, but Flash will Publish
    as MP3 16kbps Mono so keeping swf filesize down.

  6. #6
    Member
    Join Date
    Jun 2006
    Location
    San Francisco
    Posts
    56
    "I'm at wits end after reading hundreds of posts and still hearing the gap with my wav file...?"

    was my original post until I tried out the FLA file attached. It totally works and saved my day. I've been at this for hours.

    Next time I'll try out the file before I post
    Last edited by mlanson; 07-12-2007 at 09:35 PM.

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