A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Help! Trying to get sound to follow timeline

  1. #1
    Junior Member
    Join Date
    Dec 2008
    Posts
    21

    Help! Trying to get sound to follow timeline

    Action Script 2.0

    I have included a test file.

    I am trying to get the sound in the attached file to follow the timeline controls.
    I have AS controlling the timeline with the play/pause buttons, but the sound just keeps on going. I would like the sound to follow the exact position of the timeline, so when the playhead moves Fwd, Rev, Play and Pause, the sound follows just like in a movie.

    Thanks in advance for your help.


    Action Script-----

    stop();
    play_btn.onRelease=function (){
    play();
    }
    pause_btn.onRelease=function(){
    stop();
    }
    forward_btn.onPress=function (){
    _root.createEmptyMovieClip("controller_mc",1);
    controller_mc.onEnterFrame=function(){
    _root.gotoAndStop(_root._currentframe+3);
    if (_root._currentframe+3 > _root._totalframes){
    _root.gotoAndStop(_root._totalframes);
    }
    }
    }
    forward_btn.onRelease=function (){
    controller_mc.removeMovieClip();
    }
    forward_btn.onReleaseOutside=function (){
    controller_mc.removeMovieClip();
    }
    rewind_btn.onPress=function (){
    _root.createEmptyMovieClip("controller_mc",1);
    controller_mc.onEnterFrame=function(){
    _root.gotoAndStop(_root._currentframe-3);
    if (_root._currentframe-3 < 1){
    _root.gotoAndStop(1);
    }
    }
    }
    rewind_btn.onRelease=function (){
    controller_mc.removeMovieClip();
    }
    rewind_btn.onReleaseOutside=function (){
    controller_mc.removeMovieClip();
    }
    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    you may want to put the sound to stream instead of event.

    gparis

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