HDSlide an AS2 Class For Making Things Slide

– taterboy | January 7th, 2010

Filed under: ActionScript 2, Flash, Free Components/Classes

HDSlide is a collection of code brought together in an effort to make one actionsScript 2 class that will fulfill all your actionScript sliding needs. This version is very versatile with two completely different animation modes.

Animation Modes:
One animation mode will change the speed of the sliding animation based on how far the mouse is moved away from the center. When the mouse is in the middle, the animation moves very slowly, then speeds up as the mouse moves toward the edges. The other mode is more like scrolling, if your mouse is at the left side or top of the slide area, the slide will be at the beginning. As the mouse is moved to the other side, the sliding MovieClip will scroll based on the mouses position between the two extremes.

Current Samples:
The FLA contains two samples that show off just a few usage variations. The FLA was built in a hurry, so it is not an example of how things should be done, it is just a sample of what is possible. There are many more possibilities, just download the source and experiment. One example not shown is the ability to pause the mouse move detection using “pauseSlide(true)” while still having the slideTo() method fully functional.

Usage:
1. Create a MovieClip to be scrolled.
2. Then mask that MovieClip with another MovieClip.
3. Give them both instance names.
4. Import the class

?View Code ACTIONSCRIPT
 import com.hdi.as2.HDSlide;

5. Create a new instance of the class with the instance names above in the arguments.

?View Code ACTIONSCRIPT
var hSlide:HDSlide  = new HDSlide(menuMC, menuMask);

That’s it to make a simple sliding movieClip.
Read All About It »

Technorati Tags: , , , , , , , ,

| No Comments » | facebook: