Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Results 1 to 5 of 5
  1. #1

    Default Rollover button help.. again!

    I found this code that creates a smooth roll-in and roll-out of the menu. I'd like to be able to link the buttons within it to the main timeline, but coding the button objects themselves doesn't work, and neither does the other method of keeping the code all in one place.
    I got some great help yesterday from NTD, but i've since changed my rollover method to this below, and cannot get the buttons within that movie clip to control the main timeline...
    help!


    stop(); // stop the movie clip from playing (stop button from growing, we want that when the mouse rolls over only

    this.onEnterFrame = function(){
    if(rewind == true){ //if rewind switch is set to true play backwards
    prevFrame(); // play backwards
    }
    }

    this.onRollOver = function(){
    rewind = false; //set variable (or switch) that decides wether ot not to play backwards...
    play(); // play this movie clip.. (grow the button(tween));
    }

    this.onRollOut = function(){
    rewind = true; //set or rewind switch to true so it will play backwards...
    }

  2. # ADS
    Join Date
    Always
    Posts
    Many
     
  3. #2
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    Try this on the first keyframe of the main timeline.....changing the code to match your movieclip instance names...

    Code:
    rewind = null;
    this.onEnterFrame = function() {
    	if (rewind) {
    		mcInstanceName.prevFrame();
    	} else {
    		mcInstanceName.onRollOver = function() {
    			rewind = false;
    			play();
    		}
    		mcInstanceName.onRollOut = function() {
    			rewind = true;
    		}
    	}
    }
    hope it helps
    NTD
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  4. #3

    Default

    no, sorry, all that does is load the scroll-down right away and still none of the buttons work.
    Basically all i want to do is have a smooth scroll-in and scroll-out of a vertical menu, and for the buttons to work!
    Thanks for trying.

  5. #4
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    It was just a stab in the dark since I am working out of my head. I suspect that using a rollover event on the parent clip will prevent any nested buttons from working. This might be an alternative...
    Code:
    this.onEnterFrame = function() {
    	if (mcInstanceName.hitTest(_root._xmouse, _root._ymouse, true)) {
    		mcInstanceName.play();
    	} else {
    		mcInstanceName.prevFrame();
    	}
    }
    mcInstanceName.buttonName.onRelease = function() {
    	trace(this._name+" was pressed");
    }
    Regards
    NTD
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  6. #5
    Join Date
    Feb 2008
    Posts
    570

    Default

    "I'd like to be able to link the buttons within it to the main timeline"
    you can always target the main timeline with the target path _root


    PS: also don't forget that a movie clip symbol can behave just like a button symbol. There are times when it's advantagous to use movie clips over button symbols.

    Its very hard to have any idea of what would be going on without more details
    Last edited by blitzzz; 05-06-2008 at 05:18 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial