Pb with mouveEnter & mouveLeave
Posted: Tue Aug 28, 2012 4:15 pm
Hi,
I'm new to Livecode and animationEngine.
I'm trying to animate a button made of different parts (a group). A figure (as attached) is better than a lot of text.
The 'button template' template groupe has two handler :
on mouseEnter
-- La souris survole le bouton.
aeLockMoves
aeMoveTo the long ID of graphic "Triangle", the item 1 of the loc of graphic "Triangle" + 8, the item 2 of the loc of graphic "Triangle" , 250, "bounce"
aeChangeBackColor the long ID of graphic "Rectangle", 97, 150 , 195, 250, "in"
aeChangeForeColor the long ID of field "Button text", 255, 255, 255, 250, "in"
aeChangeBackColor the long ID of graphic "Triangle", 255, 255, 255, 250, "in"
aeUnlockMoves
end mouseEnter
on mouseLeave
-- La souris cesse de survoler le bouton.
aeLockMoves
aeMoveTo the long ID of graphic "Triangle", the item 1 of the loc of graphic "Triangle" - 8, the item 2 of the loc of graphic "Triangle", 250, "bounce"
aeChangeBackColor the long ID of graphic "Rectangle", 255, 255 , 255, 250, "in"
aeChangeForeColor the long ID of field "Button text", 169, 169, 169, 250, "in"
aeChangeBackColor the long ID of graphic "Triangle", 169, 169, 169, 250, "in"
aeUnlockMoves
end mouseLeave
So, i want some parts to change colors when the mouse is over the buton. I also want the graphic 'Triangle' to move. All appears to work well. But when the mouse move between the 'Triangle' and the text 'Home', it seems that only the mouveLeave event is fired, and so the graphics 'Triangle' move a little each time.
Please, can someone help me with this issue ?
Thanks.
David
I'm new to Livecode and animationEngine.
I'm trying to animate a button made of different parts (a group). A figure (as attached) is better than a lot of text.
The 'button template' template groupe has two handler :
on mouseEnter
-- La souris survole le bouton.
aeLockMoves
aeMoveTo the long ID of graphic "Triangle", the item 1 of the loc of graphic "Triangle" + 8, the item 2 of the loc of graphic "Triangle" , 250, "bounce"
aeChangeBackColor the long ID of graphic "Rectangle", 97, 150 , 195, 250, "in"
aeChangeForeColor the long ID of field "Button text", 255, 255, 255, 250, "in"
aeChangeBackColor the long ID of graphic "Triangle", 255, 255, 255, 250, "in"
aeUnlockMoves
end mouseEnter
on mouseLeave
-- La souris cesse de survoler le bouton.
aeLockMoves
aeMoveTo the long ID of graphic "Triangle", the item 1 of the loc of graphic "Triangle" - 8, the item 2 of the loc of graphic "Triangle", 250, "bounce"
aeChangeBackColor the long ID of graphic "Rectangle", 255, 255 , 255, 250, "in"
aeChangeForeColor the long ID of field "Button text", 169, 169, 169, 250, "in"
aeChangeBackColor the long ID of graphic "Triangle", 169, 169, 169, 250, "in"
aeUnlockMoves
end mouseLeave
So, i want some parts to change colors when the mouse is over the buton. I also want the graphic 'Triangle' to move. All appears to work well. But when the mouse move between the 'Triangle' and the text 'Home', it seems that only the mouveLeave event is fired, and so the graphics 'Triangle' move a little each time.
Please, can someone help me with this issue ?
Thanks.
David