Skip to main content
Participant
September 2, 2010
Answered

highlight on mouse over

  • September 2, 2010
  • 2 replies
  • 1640 views

hi huys i got a question

I have a mc that has a mouse event that when its clicked it plays the animation within its timeline. Can i put a mouse over event on it so it has a yellow glow  when my mouse goes over it.

I am using flash cs5. AS3.

here is my code. its very simple.

import flash.display.Sprite;

clue_btn.buttonMode = true;
clue_btn.addEventListener(MouseEvent.CLICK, animate);

function animate(e:MouseEvent)

{
    this.addChild(e.currentTarget as Sprite); // puts the clicked object on the top layer
    e.currentTarget.play();
}

thanks

This topic has been closed for replies.
Correct answer Ned Murphy

You can add MouseEvent.ROLL_OVER and MouseEvent.ROLL_OUT event listeners in a similar manner as you did with the MouseEvent.CLICK listener and have them control the visibility of a movieclip inside the movieclip that provides whatever blur you intend.  So when the ROLL_OVER occurs you make it visible and when the ROLL_OUT occurs you make it invisible.

2 replies

Inspiring
September 2, 2010

To extend Ned's suggestion, use GlowFilter on ROLL_OVER and remove it on ROLL_OUT.

Ned Murphy
Ned MurphyCorrect answer
Legend
September 2, 2010

You can add MouseEvent.ROLL_OVER and MouseEvent.ROLL_OUT event listeners in a similar manner as you did with the MouseEvent.CLICK listener and have them control the visibility of a movieclip inside the movieclip that provides whatever blur you intend.  So when the ROLL_OVER occurs you make it visible and when the ROLL_OUT occurs you make it invisible.