A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Help with Pause Button

  1. #1
    Junior Member
    Join Date
    Jul 2007
    Posts
    13

    Help with Pause Button

    Hi Guys im new here.
    I am not new to flash but i am not an expert at action scripting.
    I have a simple animation with text and audio.
    I have a rewind, pause, play, and forward buttons to control the animation.
    the pause button works on stopping the frames but the audio keeps playing.
    here is the code i have. Any help on stopping the audio with the pause button then picking back up where it left off would be greatly appreciated!

    here is the code:
    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();
    }

    thanks again in advance

  2. #2
    Junior Member
    Join Date
    Jul 2007
    Posts
    29
    Could you post the dev file?(strip it down if you want) I did something similar a few weeks back & might be of some help. It seems alright but I remember putting _root.stop on my pause button as it was a button embedded inside a movieclip.

  3. #3
    Junior Member
    Join Date
    Jul 2007
    Posts
    13
    Thanks for helping me Mike!
    im not sure what your wanting ? dev? can you explain im sorry again im new to the forum here.

    thanks again for your patience!

  4. #4
    Junior Member
    Join Date
    Jul 2007
    Posts
    29
    Sorry, just the *.fla file, the one you develop it with. If you want to password it, strip it down (ie. remove the bulky things, mp3's, video) or whatever just post it on an upload space and I'll take a look but I'm not 100% sure I can help, I'm just biding time before anyone can try to help my problem which is probably easy but I'll do my best.

  5. #5
    Junior Member
    Join Date
    Jul 2007
    Posts
    13
    Hey! thanks so much for taking a look at this for me! i put at this link http://www.businessdoc.com/flash/bizdoc_test2.fla

    the audio goes thru almost the whole movie....
    i removed it but its on the bottom layer.

    thanks again!


  6. #6
    Junior Member
    Join Date
    Jul 2007
    Posts
    29
    http://www.freewebs.com/ledwoon/temp/bizdoc%5Ftest2.fla

    You'll need to cut out the chance of play start looping, which i sneaked around and made the buttons empty while playing so only pause works etc. You'll probably need to add in fast forward and rewind functions too for the sound.

    To add the music file import it to the library, select it's linkage from the library, export for action script and export in first frame then name it's identifier as music.

    Hopefully this'll help, I think you'll need others to further this quest though

    and tell me when you've got it and I'll delete the file.

  7. #7
    Junior Member
    Join Date
    Jul 2007
    Posts
    13
    OMG! you are life saver! it works awesome!! thank you so much for your help, as it has been greatly appreciated!! Now i just need to mess with the darn fast forward and rewind??? im at a loss with that!

    thanks again Mikel!
    Last edited by jmelwak; 07-19-2007 at 07:21 PM.

  8. #8
    Junior Member
    Join Date
    Jul 2007
    Posts
    29
    no problem, if you can help me out with http://board.flashkit.com/board/showthread.php?t=738704 it'd be great but no sweat if you can't. I'm going to delete the file now, just remember to learn from the code in there otherwise the fast forwards will never come

  9. #9
    Junior Member
    Join Date
    Jul 2007
    Posts
    13
    i can try to help.... im gonna read your post now.... you are right about learning the code.... im trying and i keep getting better all the time lol

  10. #10
    Junior Member
    Join Date
    Jul 2007
    Posts
    29
    Well i got this one: http://www.freewebs.com/ledwoon/temp/picross.fla and I trace using the button to tell me what the value of clicks is, but I don't want it to register more than once which it does if you repeat clicking it, but there will be more than one of these correct boxes (the second in on the top line) so I can't just say make it 1 because it might go upto 10.

  11. #11
    Junior Member
    Join Date
    Jul 2007
    Posts
    13
    i took a look at it? i cant seem to get it to work properly either. I can have someone i know is pretty good at flash look at it this weekend.

  12. #12
    Junior Member
    Join Date
    Jul 2007
    Posts
    29
    Thanks, that'd be great but don't worry about it if you don't have the time as it might just stop the stupidly large amount of knowledge I've been building since trying to work these issues out

    I'll have a look at those fast forward buttons too if I get the time

  13. #13
    Junior Member
    Join Date
    Jul 2007
    Posts
    13
    hey no prob, and thanks again!

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