Parallax

http://dreamsyntax.org/patterns/swf/parallax.swf

 // SIMPLE PARALLAX // distanceMultipler is the mouse position on the x axis - but calculated as a percentage // (when the mouse is on the left edge, it is 0. when the mouse is on right edge, it is 1.) // we shift all images leftwards by the amount (distanceMultipler * excess size of image)

layer1.addEventListener(Event.ENTER_FRAME, parallax); layer2.addEventListener(Event.ENTER_FRAME, parallax); layer3.addEventListener(Event.ENTER_FRAME, parallax); layer4.addEventListener(Event.ENTER_FRAME, parallax); layer5.addEventListener(Event.ENTER_FRAME, parallax);

function parallax(evt:Event):void{ var xdistanceMultipler:Number = mouseX / stage.stageWidth; evt.currentTarget.x = -xdistanceMultipler * (evt.currentTarget.width - stage.stageWidth); } 

Preparing Images
'''Before you start: prepare all the images in photoshop or illustrator. I favour photoshop because you can have more control over the size and opacity. Illustrator layers can be copied over into flash as well, but just be careful of the sizes of objects.'''


 * Make each subsequent layer that is further behind even bigger. But start it from the left side/bottom.
 * Make sure the registration point is the top left hand corner when you create it into a symbol
 * Save for web > Export as PNG-24. [Do not use PNG-8]

Tip: you can use gif and jpg for images that do not need alpha/transparency