dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: using actionscript to make sound loop on movie start

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Location
    United States
    Posts
    11

    using actionscript to make sound loop on movie start

    the sound plays once then stops for good. I made a button that plays and loops but it wont at the start of the movie.
    how do i achieve this? i bet its a simple 2 line script but i cant get it work. im using flash 8

    oh and if theres time, id like to know how to keep the sound playing when you start the movie over.

  2. #2
    Senior Member
    Join Date
    May 2004
    Posts
    104
    how are you loading in the sound file? external / internal / in the timeline? If you don't have a preloader at the start that could be a problem why the sound isn't starting right away.

    Then for the starting the movie over, is it just a button to gotoAndPlay(1)? or do you mean refreshing?

  3. #3
    Junior Member
    Join Date
    Sep 2007
    Location
    United States
    Posts
    11

    thanks for your offer to help.

    the sound is loaded internally (i think its called that, i imported it to library and linked it to actionscript), im not using a preloader (tried many tutorials but none work for me) and yeah its a basic gotoAndPlay(1) script attached to the button. But after some messing around with the scripting on my own, i figured how to make the sound start when the movie does. and as for the rewind button, i also attached a stopAllSounds action the newSound play action. so its all good other than the preloader. Thanks for offering to help though. flash isnt as hard as i thought.

  4. #4
    Senior Member
    Join Date
    Oct 2007
    Posts
    146
    Try this:

    mySound = new Sound();
    mySound.attachSound("myMusic");
    mySound.start("", 99999);

    you can set the start value to : start(0,100) this will start the sound and loop it 100 times. The previus it loops it 999999 times.

    Notice the "myMusic" is the AS linkage from the library.

  5. #5
    Junior Member
    Join Date
    Sep 2007
    Location
    United States
    Posts
    11
    works perfectly thanks

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