Return to Snippet

Revision: 33335
at October 8, 2010 00:57 by adamcoulombe


Initial Code
import com.greensock.TweenLite; // get tweenlite at http://www.greensock.com/tweenlite/

var rotationValue;

addEventListener(Event.ENTER_FRAME,doOrbit)

function doOrbit(e){
	rotationValue = (mouseX + stage.stageWidth / 2) * 0.5;
	TweenLite.to(orbit,0.5,{rotationZ:rotationValue}); //had to use Z axis rotation (basically the same thing)
	for(var i=0; i<orbit.numChildren; i++){
		var planet = orbit.getChildAt(i);
		TweenLite.to(planet,0.5,{rotationZ:rotationValue*-1});
	}
}

Initial URL
http://www.adamcoulombe.info/lab/as3/polkadot-orbit.html

Initial Description


Initial Title
Orbiting Polkadots (interactive) in flash AS3

Initial Tags
flash

Initial Language
ActionScript 3