Also, if you're targeting flash player 10, you can just rotate around the x and y axis. FP10 and Flash CS4 support basic 3D built-in.
EDIT
If you can't use FP10 then you'll have to look into doing it via a 3rd party library - DistortImage seems like it will do the trick just fine. It is referenced by some of the code in the links below, but this is the cleanest most simple version I can find.
ANOTHER EDIT
It is not possible to to this with flash's built in Matrix class. This is because flash's Matrix only supports 3x3 matrices. You need 4x4 to do the kind of distortion you want. you need to do a proper perspective distortion, not just a skew.