Skip navigation
Recyth
Currently Being Moderated

Audio Track Loop and timeline navigation

Sep 6, 2012 7:11 AM

Tags: #audio #loop #animation #timeline #isolating

Currently on a new project involving Flash CS6 and AS3.

 

I want to have an audio track looping in the background unihibited while i navigate through the timeline. The plan is to have two movie clips loop ( can be changed to a regular loop ) with a sort of continue button to navigate to another point in the timeline where the animation will continue then finish, shutting off the audio track. Sorry this is turning out to be more difficult to explain than i thought. So here's an example: http://www.mspaintadventures.com/?s=6&p=002293

 

The problem is i can't find a tutorial anywhere to accomplish what i want to do and i don't know how to make the audio repeat uninterrupted without it doubling up on itself which Event sounds do.

 

Blargh. Speedy responses would be appreciated.

 

Thanks.

 
Replies
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 6, 2012 7:47 AM   in reply to Recyth

    to create a sound that loops independently from all timelines, use the sound class:

     

    var s:Sound=new Sound();

    var sc:SoundChannel=s.play(0,10000);  // loops 10000 times

     

    to stop that sound, use:

     

    sc.stop();

     
    |
    Mark as:
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 7, 2012 12:02 PM   in reply to Recyth

    copy and paste the code you're using to load (or create) your sound.

     
    |
    Mark as:
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 7, 2012 12:33 PM   in reply to Recyth

    again,

    to create a sound that loops independently from all timelines, use the sound class:

     

    var s:Sound=new Sound();

    var sc:SoundChannel=s.play(0,10000);  // loops 10000 times

     

    to stop that sound, use:

     

    sc.stop();

     
    |
    Mark as:
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 7, 2012 1:23 PM   in reply to Recyth

    you should not have any sound attached to any timeline.

     

    in your library panel, right click your sound, click properties and tick export for actionscript and assign a class name eg, MP3.

     

    then attached to a frame that plays when you want your sound to start use:

     

    var s:Sound=new MP3();

    var sc:SoundChannel=s.play(0,10000);

     
    |
    Mark as:
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 7, 2012 11:19 PM   in reply to Recyth

    use:

     

    var alreadyExecuted:Boolean;

    if(!alreadyExecuted){

    alreadyExecuted=true;

     

    var s:Sound=new AudioLoop();

    var sc:SoundChannel=s.play(0,10000);

    }

     

    p.s. please mark helpful/correct responses

     
    |
    Mark as:
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 8, 2012 7:46 AM   in reply to Recyth

    you're welcome.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points