# Vertical Parallax Effect

**URL:** <https://forum.kirupa.com/t/vertical-parallax-effect/281175>\
**Category:** flash\
**Created:** [February 5, 2009, 7:41pm UTC](https://forum.kirupa.com/t/vertical-parallax-effect/281175 "2009-02-05T19:41:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wackydesigner](https://avatars.discourse-cdn.com/v4/letter/w/9fc29f/32.png) [@wackydesigner](https://forum.kirupa.com/u/wackydesigner)\
**Post date:** [February 5, 2009, 7:41pm UTC](https://forum.kirupa.com/t/vertical-parallax-effect/281175/1 "2009-02-05T19:41:18Z")

</div>

There has been many threads on horizontal parallax effect but I’m trying to build a vertical one with minimal success. I need the effect at a very [COLOR=Red]_subtle scale_ [/COLOR]and with _[COLOR=RoyalBlue]easing[/COLOR]_ if possible. Could someone please help me with this? Thanks.

My Current Code (got it from a user here):  
[COLOR=Sienna]// an array with 3 movieClips on stage … named respectivly  
// make sure all these movies go beyond your stage  
var parallax\_array:Array = new Array();  
parallax\_array.push(this.closestMc);  
parallax\_array.push(this.middleMc);  
parallax\_array.push(this.farthestMc);  
//trace(parallax\_array);  
// add a little psuedo 3D functionality  
var focal\_length:Number = 150;  
function move\_parallax() {  
/// cycle through all the objects  
//trace(“calling”);  
for (var i:Number = 0; i\<parallax\_array.length; i++) {  
// calculate the new x  
var y:Number = \_ymouse-(Stage.width/2);  
// callculate the depth number  
var z:Number = i_1000+focal\_length;  
// if it’s the pack one we want it to appear like the sky  
if (i == parallax\_array.length-1) {  
// so set depth to really far away  
z = 100000;  
}  
//trace(y + " : " + z);  
// calculate the depth of the object , each object is 1000 units apart  
var parallax\_scale:Number = focal\_length/(focal\_length+z);  
//trace(parallax\_scale);  
// apply the new scale to the object  
// remember to make your mc’s with the registration point in the center  
// remember to offset your mc’s to the center as well  
parallax\_array_.\_y = parallax\_scale\*y+(Stage.width/2);  
}  
}

this.onEnterFrame = move\_parallax;[/COLOR]

link to my FLA:  
[http://prakashnair.com/test/parallax.zip](http://prakashnair.com/test/parallax.zip)
