Flash 10 CS4 as3 rotating 3D cube!


free open source download:

cube ZIP (55KB)


Nothing seems to be more symbolizing for the computer age than a rotating 3D cube.
So, one day I was looking for a simple script
which is based on flash cs4 native 3D functions only.
To my surprise I did not find a reliable ready to go open source script
which is based on a movieclip holding a picture on all sides.
Yet after some sifting through the internet I found an interesting z-sort class here.
Hence not all credit goes to me.
I did alter and optimize that class somewhat to suit the cube structure.
Now only 3 front sides are rendered and the 3 side in the back are set
to visible=false for animation speed reasons.
This cube script should be easy to manipulate.
Replacing the picture with an animation or using different picture on each side
or changing the dimensions to e.g. produce a jewel case should not be a big problem.
Also I did add some mouse over events to change the rotation direction.