Pure actionscript generated swinging effect (both AS2 & AS3 versions).
Seven various examples of usage included (FLA files: both AS2 & AS3 versions) – just drag & drop movieclip to your flash project.
Perfect for flash designers/developers who wants add very quickly some special swing effect in flash movie.
Easy to use even for flash newbies!
Copy/paste few lines of actionscript to set up effect on any movieclip.
- AS3 EXAMPLE WITH ALL AVAILABLE PARAMETRES :
import net.chamboow.effects.SwingFX;
import fl.transitions.easing.Back;
var swfx = new SwingFX();
swfx.target = myMC; // target object to swing
swfx.fromForce = 10; // force value (on start of animation)
swfx.toForce = 0; // force value (on end of animation)
swfx.time = 2; // time of animation
swfx.speed = 6; // speed of animation
swfx.useSeconds = true; // use seconds instead of frames
// delta value of HORIZONTAL slide-in transition
swfx.slideInDelta_H = -500;
// time of HORIZONTAL slide-in transition
swfx.slideInTime_H = 3;
// easing function for HORIZONTAL slide-in transition
swfx.slideInEase_H = Back.easeOut;
// delta value of VERTICAL slide-in transition
swfx.slideInDelta_V = -200;
// time of VERTICAL slide-in transition
swfx.slideInTime_V = 2;
// easing function for VERTICAL slide-in transition
swfx.slideInEase_V = Back.easeOut;
swfx.loopInfinity = true; // "infinity loop" flag
// function fired when swing ends
swfx.onComplete = function() { trace("SWING FINISHED"); }
swfx.go(); // start swinging
Full documentation in PDF file available here:
AS2 / AS3 : SwingFX-Manual-AS2-AS3.pdf
List of things you can change and use:
- force start value
- force end value
- speed
- time
- VERTICAL delta value of slide-in transition
- HORIZONTAL delta value of slide-in transition
- time of VERTICAL slide-in transition
- time of HORIZONTAL slide-in transition
- custom easing function for VERTICAL slide-in transition
- custom easing function for HORIZONTAL slide-in transition
- callback function fired when swing animation is finished
- time-units for animation: seconds or frames
- inifinity loop of swing effect
- pause() and resume() methods for controlling animation
Package includes:
- AS2 version of seven examples (.FLA + .SWF + .AS file)
- AS3 version of seven examples (.FLA + .SWF + .AS file)
- SwingFX_demo.swf (demo versions with code snippets)
- SwingFX-Readme.pdf (readme file)
- SwingFX-Manual-AS2-AS3.pdf (documentation for AS2 /AS3 version)








