A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] Movieclip Button Problems

Threaded View

  1. #4
    Member
    Join Date
    Sep 2014
    Posts
    75
    Quote Originally Posted by Moocow124 View Post
    I have a start button(startbtn) and a restart button(restartbtn) on different layers as shown in the picture. On the finished layer I have a movieclip that I want to loop no matter what(finmc). On the Jumping Man layer, on the first frame I have blinkingmanmc that I want to loop until I click. When I click, I want to have the movieclip on the second frame (jumpingmanmc) play and then go back to blinkingmanmc.
    Right now, blinkingmanmc and finmc loop and nothing happens when I click.
    Thank you in advance.
    P.S. The mouse.show is something interacting with a different scene, so you can ignore it.
    flash0.PNG
    The code in first frame.
    Code:
    Mouse.show();
    stop();
    startbtn.onRelease = playFrame2;
    function playFrame2():Void{
    	_root.jumpingmanmc.gotoAndPlay(2);
    	_root.blinkingmanmc.stop;
    	_root.finmc.play;
    }
    The code in second frame.
    Code:
    stop();
    Blinkingmanmc.stop();
    restartbtn.onRelease = playFrame1;
    function playFrame1():Void{
    	_root.blinkinggmanmc.gotoAndPlay(1);
    	_root.jumpingmanmc.stop;
    	_root.finmc.play;
    }

    Because you are using the function "stop();" the programe won't move from frame1 to frame2. You need to use "_root.gotoAndStop(2);" in the start button, and "_root.gotoAndStop(1);" in the restart button.

    The code in first frame.
    Code:
    Mouse.show();
    stop();
    startbtn.onRelease = function(){
    playFrame2();
    }
    //
    function playFrame2():Void{
    //
            _root.gotoAndStop(2);
    //
    	_root.jumpingmanmc.gotoAndPlay(2);
    	_root.blinkingmanmc.stop;
    	_root.finmc.play;
    }
    The code in second frame.
    Code:
    stop();
    Blinkingmanmc.stop();
    restartbtn.onRelease = function(){
    playFrame1();
    }
    //
    function playFrame1():Void{
    //
            _root.gotoAndStop(1);
    //
    	_root.blinkinggmanmc.gotoAndPlay(1);
    	_root.jumpingmanmc.stop;
    	_root.finmc.play;
    }
    Last edited by Dr_flash; 02-22-2016 at 06:10 PM.

Tags for this Thread

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