Roll-over tricks...

  • blackpocket
  • Born
  • Born
  • blackpocket
  • Posts: 3

Post 3+ Months Ago

I'm in the process of putting the menu of my website together, and I'm making roll-over buttons that fade in when the mouse enters and fade out when the mouse leaves.

This is fine, but I'm having trouble creating roll-overs that fade out from the exact point in the animation that they are up to when the mouse leaves. At the moment, when the cursor rolls out of one of my buttons, it fades from 100% to 0%, even if the button had only faded in to 50% at the moment the cursor leaves.

This is sort of hard to explain, but if anyone understands and can help, I'd be most appreciative.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Rollover, RollOut once it gets to about 50%, jumps up to 100% & fades down from there ?

How are you fading the buttons/movieClips ?
Actionscript,
(button._alpha -= speed)

Tweens,
( [0]-f-a-d-e-i-n->[0]----f-a-d-e-o-u-t--->[0] )

Button States,
(up / over / down /hit)

Actions for button states,
mc.gotoAndPlay(fadeOut)
mc.gotoAndPlay(fadeIn)

Hard to give you the answer you need without knowing how your achieving the fade.
  • blackpocket
  • Born
  • Born
  • blackpocket
  • Posts: 3

Post 3+ Months Ago

At the moment the roll-overs are just movie clips with the fade-in and fade-out animations inside them. These movie clips have rollOver and rollOut actions that point to certain points in the clip when the mouse enters and leaves.

Inside each movie clip there is a fade_in label and a fade_out label. The code looks like this at the moment (it's pretty simple):
Code: [ Select ]
on (rollOver) {
this.start(0, 2);
    this.gotoAndPlay("fade_in");
}
on (rollOut) {
    this.gotoAndPlay("fade_out");
}
  1. on (rollOver) {
  2. this.start(0, 2);
  3.     this.gotoAndPlay("fade_in");
  4. }
  5. on (rollOut) {
  6.     this.gotoAndPlay("fade_out");
  7. }

If you could tell me where I can find one of the scripts you mentioned, that'd be a great help. I'm not 100% with ActionScript, but I'm willing to take the time to learn.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Sorry for the delay.

The reason it's jumping like that is onRollOut tells the tween to goto the begining of the fade_out tween no matter what.

There's quite a few explainations of fading with actionscript here at Ozzu, for example there's This thread lostinbeta shows us a primo example there :wink:

Other than that try using Ozzu's search for fading limiting results to come only from the flash & Actionscript forum.
  • blackpocket
  • Born
  • Born
  • blackpocket
  • Posts: 3

Post 3+ Months Ago

Thanks,

I just tried to understand that bit of code, and now I have a killer headache. Maybe I'll just stick to my simpleton coding.

Cheers

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 8 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.