While I was writing the 3D chapter for the Flash Player 10, I wanted to offer a clean solution for detecting which face of a DisplayObject is currently shown when rotated in 3D. Instead of working with the rotationX or rotationY properties which can be limitating, the viewable side of the DisplayObject can be determined through its normal. I came across Trevor solution which is very smart and compact and decided to create a little wrapping class called SideDetector (renamed to avoid confusion :) ) which is dispatching an Event.FACE or Event.BACKFACE event when the DisplayObject viewable side has changed.

This way, you can modify the DisplayObject state and map any texture you want. The cool thing is that this class also works with DisplayObject's created and animated through the IDE.

The code is very simple :

var detector:SideDetector = new SideDetector ( myMC );

detector.addEventListener ( FlippedEvent.FLIPPED, onFlipped );

function onFlipped ( e:FlippedEvent ):void
myMC.gotoAndStop ( e.position == SideDetector.FACE ? 1 : 2 );

// re-flip the bitmap on that frame so that it does not look reversed
if ( e.position == SideDetector.BACKFACE ) myMC.getChildAt(0).scaleX *= -1;

Here is a little demo :

A Flash animation should have appeared here, but it seems that your browser has an older version of the Flash Player or it is not installed at all. Please, install the last release of the Flash Player now, then reload this page.

Sources available here.