Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Mar 2005
    Posts
    735
    Thanks
    4
    Thanked 1 Time in 1 Post

    how to make mc go backwards

    I'm working on the Home mc in my swf file.
    On rollover I want the mc to go to frame 5 in the child time frame. And on rollout to go back to 1.
    Code:
    on (rollOver) {
    	home.gotoAndStop(5);
    }
    on (rollOut) {
    	home.gotoAndStop(1);
    }
    Attached Files Attached Files
    Compare bible texts (and other tools):
    TheWheelofGod

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    You should use these event handlers.

    Code:
    home.onRollOver = function {
    home.gotoAndStop(5);
    }
    
    home.onRollOut = function {
    home.gotoAndStop(1);
    }
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #3
    Regular Coder
    Join Date
    Mar 2005
    Posts
    735
    Thanks
    4
    Thanked 1 Time in 1 Post
    Quote Originally Posted by jeremywilken View Post
    You should use these event handlers.

    Code:
    home.onRollOver = function {
    home.gotoAndStop(5);
    }
    
    home.onRollOut = function {
    home.gotoAndStop(1);
    }
    I don't know why it's not working. home is the instance of the movieclip. The mc has 5 frames. I put a stop on the 1st and 5th frame. As I rollover I want home to move in the child to the 5th frame. When I rollout I want it to go reverse to frame 1 if possible.
    Compare bible texts (and other tools):
    TheWheelofGod

  • #4
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    on (release) ... is for buttons while instance.onRelease = function works with movieclips.

    Where are you putting this code? Try putting it on the main timeline first frame.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #5
    Regular Coder
    Join Date
    Mar 2005
    Posts
    735
    Thanks
    4
    Thanked 1 Time in 1 Post
    Quote Originally Posted by jeremywilken View Post
    on (release) ... is for buttons while instance.onRelease = function works with movieclips.

    Where are you putting this code? Try putting it on the main timeline first frame.
    It's actually a movieclip not a button. I tried pasting in the 1st frame of the main timeline but it didn't work.
    **Error** Scene=Scene 1, layer=actions, frame=1:Line 2: Function name expected
    home.onRollOver = function {

    Total ActionScript Errors: 1 Reported Errors: 1
    Last edited by gilgalbiblewhee; 12-10-2008 at 01:18 PM.
    Compare bible texts (and other tools):
    TheWheelofGod

  • #6
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Oops, missed something. Also check out some information about the onrollover and onrollout events.

    Code:
    home.onRollOver = function() {
    home.gotoAndStop(5);
    }
    
    home.onRollOut = function() {
    home.gotoAndStop(1);
    }
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •