A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Make a movie clip button go to next scene

  1. #1
    Junior Member
    Join Date
    Oct 2006
    Posts
    6

    Make a movie clip button go to next scene

    I'm having trouble with a movie clip that acts as a button. i want the button to go to the next scene. if anyone can help, that will be much appreiated. below is the actionscript i use which dosent work.

    thanks
    [email protected]

    you can download the fla, to get a better understanding what i kinda mean:
    http://www.filelodge.com/files/room4...h%20button.zip
    or
    http://www.ffiles.com/flash/buttons/button_mc/

    stop();
    this.onEnterFrame = function(){
    if(rewind == true){
    prevFrame();
    }
    }

    this.onRollOver = function(){
    rewind = false;
    play();
    }

    this.onRollOut = function(){
    rewind = true;
    }

    this.onRelease = function(){
    gotoAndPlay("scene2",1);
    }

    http://www.filelodge.com/files/room4...h%20button.zip
    or
    http://www.ffiles.com/flash/buttons/button_mc/
    Last edited by vyset; 10-12-2006 at 04:51 AM.

  2. #2
    Actionscript Developer KigD's Avatar
    Join Date
    Jan 2003
    Location
    georgia
    Posts
    597
    Don't know exactly what you are doing with the rewind and whatnot, but try adding this code to the button's actions (NOT THE TIMELINE!)

    Code:
    on(release)
    {
    gotoAndPlay("scene2",1);
    }
    K2xL - My games, tutorials, message boards, and experiments.
    Blog

  3. #3
    Island Boy
    Join Date
    Apr 2006
    Posts
    655
    Your actionscript is in the wrong place. It should be on the timeline like you have it but it should be on the main timeline for scene 1 not the timeline for the next_mc button. the code should be modified as such and placed on the actions layer of scene 1:

    Make sure to give the button an instance name.

    Code:
    stop();
    
    next_mc.onEnterFrame = function(){
    	if(rewind == true){
    		prevFrame();
    	}
    }
    
    
    next_mc.onRollOver = function(){
    	rewind = false;
    	this.play();
    }
    
    next_mc.onRollOut = function(){
    	rewind = true;
    }
    
    next_mc.onRelease = function(){
    	gotoAndPlay("scene2",1);
    }

  4. #4
    Junior Member
    Join Date
    Oct 2006
    Posts
    6
    The rollout fuction didnt work, so i just put the onRelease function in scene 1, and the rest in next_mc. but thanks for your help VI Knight

    [scene 1]
    stop();

    next_mc.onRelease = function(){
    gotoAndPlay("scene2",1);
    }


    [next_mc]
    stop();

    this.onEnterFrame = function(){
    if(rewind == true){
    prevFrame();
    }
    }


    this.onRollOver = function(){
    rewind = false;
    this.play();
    }

    this.onRollOut = function(){
    rewind = true;
    }

  5. #5
    Junior Member
    Join Date
    Oct 2006
    Posts
    6

    Making a button move to the next scene

    I thought my problem was over, but im still having trouble. i added some extra frame in scene 1 and now it stops working, it was working before when i only have one frame.

    download the file here:
    http://www.filelodge.com/files/room4...263/button.zip

    Thanks
    Vyset
    Last edited by vyset; 10-14-2006 at 09:59 AM.

  6. #6
    Island Boy
    Join Date
    Apr 2006
    Posts
    655
    your release statement is not sending it to the right place. Note the capitalization. flash is extremely case sensitive so you have to be careful of that. It should be.

    Code:
    next_mc.onRelease = function(){
      gotoAndPlay("Scene2","S2");
    }
    but the rest of the code should be taken out of the button also and placed on the main timeline.

    I asttached the corrected file. it works for me here.
    Attached Files Attached Files
    Last edited by VI Knight; 10-14-2006 at 01:54 PM.

  7. #7
    Junior Member
    Join Date
    Oct 2006
    Posts
    6
    Thanks so much VI Knight.

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