Hi all,
i release today a simple class that will make it easy to generate parallax systems. You won’t have to bother about managing the various levels, anymore.
The thing is just easy as saying “wow”.
Just declare a movieclip on your stage as an instance of ParallaxContainer (you will find the ParallaxContainer.as file in the zip), and then add to the render list the object you want to be moved as you move your mouse. It is a good practise to clean the render list every time you create it :)
Then you have to choose if you want the parallax to move horizontally, vertically or both.
However, as long as you have added every movieclip you need, use the start method and go!
This is the code used in the example. Very easy indeed as you can see.
this.clean();
this.addItem(l3, 10);
this.addItem(l2, 30);
this.addItem(l1, 100);
this.set_mode("H");
this.start();
Just a quick reference to the method addItem. The first paramter is the object to move, the second one is the “wing”. The wing is the quantity of pixels the object will move at the maximum limit of the stage (i.e. extreme left / extreme right)
This is the example.
And this, of course, is the zip package to download. Click here.
Have fun!
