Archive for November, 2009

MouseEvent.ROLL_OVER has strange behaviour when used on an object with drop shadow

If you set a drop shadow on a movieclip and use roll over and roll out to grow or shrink the movieclip (roll over = grow, roll out = shrink), you get alternating roll over and roll out events, even if you don’t change the mouse position. This happens when you put the mouse at the edges of the object. Apparently, the filter causes this strange behaviour. I solved this by placing a transparent hitArea object over the movieclip, to ‘divert’ the mouse events to the hitArea. Of course, you must not define a drop shadow for the hitArea.

No Comments

hitArea only works if the referred sprite has the same parent

You can assign another object to be the hitArea of a sprite. See:

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Sprite.html#hitArea

Unfortunately, it seems that both the hitArea object and the sprite must have the same parent.

No Comments