music infinite loop? - Page 2
A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: music infinite loop?

  1. #21
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    936
    So...with that tutorial Fruitbeard posted, you can do something like this to loop the music:

    PHP Code:
    onFrame (3) {
      
    mySound = new Sound();
      
    mySound.loadSound("song1.mp3");
      
    mySound.start(0999); 
    mySound.onSoundComplete = function () { 
    mySound.start(0999); 


    I've not tested it so i can't tell 100% it will work, but it should. Just replace "onFrame (3)" with the number of the frame of the scene you want the sound to start playing. It will keep playing throught all the frames until the last frame. If you don't use a stop(); on the last frame, the movie probably will repeat from its first frame, so the sound will start again over the already playing sound... so if you come up to this situation, i will read the swish tutorial to help you out.
    In as2, i would do something like:
    PHP Code:
    onFrame (3) {
    if(
    mySound.position != mySound.duration)
    {
    trace("it's playing");
    };
    else
    {
    trace("it's not playing");
      
    mySound = new Sound();
      
    mySound.loadSound("song1.mp3");
      
    mySound.start(0999); 
    mySound.onSoundComplete = function () { 
    mySound.start(0999); 
    }

    Hi Object, Listen, i wish to return you something, but only if what you are saying is true, else, forget it, ROLL_OVER the floor, i will check for someone else at the stage, while eating a no.visible cookie.

  2. #22
    _____________ fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    787
    Hi,

    The AS2 equivalent of "int.MAX_VALUE" is " Number.MAX_VALUE"

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

Poll by Flashkit.com