Skip to main content
January 7, 2008
Question

mouseOver is this the best way?

  • January 7, 2008
  • 15 replies
  • 1180 views
I'm trying to create mouse over (tool tip) for everything in my simulated control panel my question is, is mouseOver event handler the best way to have the program display a small amout of text over the mouse pointer. seems to me this is done all the time and there should be a better way.
thank you in advance for your help
This topic has been closed for replies.

15 replies

kglad
Community Expert
Community Expert
January 8, 2008
ok. good luck!
January 7, 2008
oh i will research on how to do that, that will make it look better :)
kglad
Community Expert
Community Expert
January 7, 2008
p.s. the tooltip won't move with the mouse unless you initiate a loop that repeatedly updates the tooltip's x and y properties.
January 7, 2008
Oh ok that makes sense. thank you again for putting up with me
kglad
Community Expert
Community Expert
January 7, 2008
you won't see a difference between ROLL_OVER and MOUSE_OVER events unless you're checking an ancestor of the event target. because MOUSE_OVER bubbles, this event is broadcast to all target ancestors. because ROLL_OVER doesn't bubble, this event is broadcast to no target ancestor.
January 7, 2008
kglad i agree on the Array way i have many buttons, lights, vents,......... that i want tool tips for so i will do the Array. another dumb question what is bubbling i did not see a differance when i tried MOUSE or ROLL.

i thought
Knobtip.x = this.mouseX;
Knobtip.y = this.mouseY;

would make the tip follow the mouse pointer.

thanks again guys i'm taking a 5 day class in 2 weeks so i will not (hopefully) ask so many stupid questions
Damon Edwards
Inspiring
January 7, 2008
Flash is case sensitive, so it will need to be Knobtip
January 7, 2008
thank you i was not even closei thought i had the event listener but i must of hit contol x one two many times. i created another function and used the removeChild(knobtip); with the mouse out event is that the right way to remove the tip?

thank you again
Damon Edwards
Inspiring
January 7, 2008
knob.addEventListener(MouseEvent.ROLL_OVER, knob_tip);
function knob_tip(event:MouseEvent):void{
var Knobtip:TextField = new TextField();
Knobtip.autoSize = TextFieldAutoSize.LEFT;
Knobtip.multiline = false;
Knobtip.text = "testing testing";
addChild(KnobTip);
}
January 7, 2008
what am i doing wrong? getting frustrated
kglad
Community Expert
Community Expert
January 7, 2008
because you probably have several buttons, you should consider using something like the following: