AVM2 bug when rolling over movieclips

22 Apr

When making examples for a recent workshop, I stumbled over a bug in the Actionscript Virtual Machine used for Flash Player 9 and higher (AVM2). If you are using a movieclip inside a button, the hit area won’t work as it should. When moving the mouse across the button, it will constantly blink giving a very flimsy impression. You can test this in the example below.

This content requires Flash Player 9 (or a more recent version). You need to upgrade your Flash Player

Here’s source files that show the bug and the fix FLA - SWF - TwoStateButton.as

Switching the movieclip to graphic fixes the issue, but why won’t this work? It’s always worked well before, so this must be a bug in AVM2? Another thing is that if you hover this button for a few seconds, the Flash IDE crashes instantly…

If you’re unable to repoduce the bug - feel free to check this video that shows it and please post a comment telling what Flash Player version/browser you are using. I’ve been able to reproduce the bug on all OSX browsers + IE8 on Win7.

Submitted this as a bug in the bugbase https://bugs.adobe.com/jira/browse/FP-4396

22 April 2010 at 3:38 pm

4 Responses to AVM2 bug when rolling over movieclips

  1. avatar photo
    Phil 22 April 2010 at 8:04 pm #

    This is not actually a bug, this is the desired result of using MouseEvent.MOUSE_OVER

    To achieve the effect you are looking for use MouseEvent.ROLL_OVER and MouseEvent.ROLL_OUT

  2. avatar photo
    reyco1 22 April 2010 at 8:31 pm #

    Dont change the movieclip to a graphic and just set the button’s mouseChildren property to false (considering you may need the movieclip to animate).

    If it’s just a static asset, then leave it as a graphic or sprite.

  3. avatar photo
    Jensa 23 April 2010 at 12:25 am #

    @Phil I get similar results using ROLL_OVER and ROLL_OUT? It improves somewhat, but it can still be triggered. It does not make sense for either of the events to trigger multiple times?

    @reyco1 I know, but the reason I discovered this is that I made an example for the students in my class. I was going to show them how simple this was, but it turns out it wasn’t? This is a deviation from how it worked in AVM1 and thus it’s it a bug?

  4. avatar photo
    Amy Blankenship 23 April 2010 at 5:09 am #

    I get an error on trying to download the as file.

  5.