Here’s a weird one for you. I found out today that apparently you can’t interact with a single SimpleButton instance in both normal and fullscreen modes in an app. It literally won’t work.

Let’s say you have a SimpleButton that serves as the play button for an app that displays video. If you launch the app and click on the button before going fullscreen, the SimpleButton will only respond to subsequent clicks when in normal mode.

However the reverse is also true. If you launch the app and click on the button only after going fullscreen, the SimpleButton will only respond to subsequent clicks when in fullscreen mode.

I checked my code thoroughly to make sure I wasn’t accidentally disabling the SimpleButton when I changed display states, but alas… nothing. In the end I had to create separate buttons for each state, mirror any changes, and then swap them when the display state changed.

Here’s the relevant code snippets:

stage.addEventListener (FullScreenEvent.FULL_SCREEN,
    onDisplayStateChanged);

public function onDisplayStateChanged (event : FullScreenEvent) : void
{
    if (stage.displayState == StageDisplayState.FULL_SCREEN)
    {
        addChildAt (fullscreenPlayButton, getChildIndex (playButton));
        removeChild (playButton);
    }
    else
    {
        addChildAt (playButton, getChildIndex (fullscreenPlayButton));
        removeChild (fullscreenPlayButton);
    }
}


I still have no idea why this occurs, but there you go.