Packagecom.greensock.plugins
Classpublic class Physics2DPlugin
InheritancePhysics2DPlugin Inheritance TweenPlugin Inheritance Object

Provides simple physics functionality for tweening an Object's x and y coordinates based on a combination of velocity, angle, gravity, acceleration, accelerationAngle, and/or friction. It is not intended to replace a full-blown physics engine and does not offer collision detection, but serves as a way to easily create interesting physics-based effects with the GreenSock animation platform. Parameters are not intended to be dynamically updateable, but one unique convenience is that everything is reverseable. So if you spawn a bunch of particle tweens, for example, and throw them into a TimelineLite, you could simply call reverse() on the timeline to watch the particles retrace their steps right back to the beginning. Keep in mind that any easing equation you define for your tween will be completely ignored for these properties.

USAGE:

import com.greensock.TweenLite; 
import com.greensock.plugins.TweenPlugin; 
import com.greensock.plugins.Physics2DPlugin; 
TweenPlugin.activate([Physics2DPlugin]); //activation is permanent in the SWF, so this line only needs to be run once.
TweenLite.to(mc, 2, {physics2D:{velocity:300, angle:-60, gravity:400}});
//--OR--
TweenLite.to(mc, 2, {physics2D:{velocity:300, angle:-60, friction:0.1}}); 
//--OR--
TweenLite.to(mc, 2, {physics2D:{velocity:300, angle:-60, acceleration:50, accelerationAngle:180}}); 

Physics2DPlugin is a Club GreenSock membership benefit. You must have a valid membership to use this class without violating the terms of use. Visit http://www.greensock.com/club/ to sign up or get more details.

Copyright 2008-2013, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for Club GreenSock members, the software agreement that was issued with the membership.



Public Methods
 MethodDefined By
  
Physics2DPlugin
 Inherited
activate(plugins:Array):Boolean
[static] Activates one or more plugins so that TweenLite and TweenMax recognize the associated special properties.
TweenPlugin
Constructor Detail
Physics2DPlugin()Constructor
public function Physics2DPlugin()