Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Aug 2005
    Posts
    16
    Member #
    10864
    Real quick question. Right now i have a menu that has an animation for the rollover and on the rollout on each button. The code looks like this

    "on (rollOver) {
    mov5.gotoAndPlay(1);
    }

    on (rollOut) {
    mov5.gotoAndPlay(5);
    }

    on (rollOver) {
    mov6.gotoAndPlay(1);
    }

    on (rollOut) {
    mov6.gotoAndPlay(5);
    }



    on(release){
    getURL("drivers.htm","_parent");
    }"

    This works well for what i want but if you roll out or in to the button to fast it messes up the order in which the button rolls in and out. I was just wondering if anyone knew of a cleaner way to code this and get the same effect. Ive attached a swf to show you what i mean.

    Any and all help will be greatly appreciated. Thanks.

  2.  

  3. #2
    Senior Member
    Join Date
    Mar 2004
    Posts
    241
    Member #
    5465
    What I've been doing is a hitTest with nextFrame(); and prevFrame();'s. My rollover code looks something like this. I have a movieclip which has my animation in it. It also has any buttons inside it needed. Basically, that is your rollout effect or whatever. The trick is to make an extra layer of actions, and then have a stop(); on every single frame.

    Then I make a invisible button the same shape as your hit area for that roll effect. Then place it directly on top of your movie symbol. Then add the following code to that button (if I can remember exactly)

    Code:
    onClipEvent(enterFrame) {
      if(this.hitTest(_root._xmouse, _root._ymouse) {
        rolleffectmovieclip.nextFrame();
      }  else {
         rolleffectmovieclip.prevFrame();
      }
    }
    What it basically says is that if the mouse is over your hit area (invisible button) then go to the next frame of the movie. If not, then go back (which it will until it hits frame 1). Now you have a roll in, and roll out effect using only one hitTest, and not two on(Roll..)s.

    If you need an example I can find one for you.

  4. #3
    Junior Member
    Join Date
    Aug 2005
    Posts
    16
    Member #
    10864
    Yeah, if youy could get me an example that would be great. I'm sure i could figue it out but as to save time that would probably help. Also im more of a design guy thena coder

    Anyways thanks for your help. Let me know.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:25 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com