Skip to main content
efreya1995
Participant
May 17, 2019
Answered

Looping audio throughout without it overlapping?

  • May 17, 2019
  • 1 reply
  • 3632 views

I want to loop audio throughout my project, so I have simply placed the audio on the timeline and used Properties to make it loop. However, when I use a button to return to the first frame of my project, the music starts playing over itself. How do I avoid this? I looked for solutions, some suggested forgoing the timeline and using ActionScript to play the audio, but I can't seem to find instructions with the code to do that and make it looping. Would appreciate any help! Thanks

This topic has been closed for replies.
Correct answer kglad

assign your sound a class (or linkage id) in the library panel (eg, Sound1) and use:

var alreadyDefined:Boolean;

if(!alreadyDefined){

alreadyDefined=true;

var sound1:Sound=new Sound1();

sound1.play();

}

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
May 17, 2019

assign your sound a class (or linkage id) in the library panel (eg, Sound1) and use:

var alreadyDefined:Boolean;

if(!alreadyDefined){

alreadyDefined=true;

var sound1:Sound=new Sound1();

sound1.play();

}

efreya1995
Participant
May 17, 2019

Thanks a lot, how do I make the sound loop?