Posted By

adamcoulombe on 10/08/10


Tagged

rotate flash interactive as3 orbit


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

thastyle
svaye
tspitzr


Orbiting Polkadots (interactive) in flash AS3


 / Published in: ActionScript 3
 

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

  1. import com.greensock.TweenLite; // get tweenlite at http://www.greensock.com/tweenlite/
  2.  
  3. var rotationValue;
  4.  
  5. addEventListener(Event.ENTER_FRAME,doOrbit)
  6.  
  7. function doOrbit(e){
  8. rotationValue = (mouseX + stage.stageWidth / 2) * 0.5;
  9. TweenLite.to(orbit,0.5,{rotationZ:rotationValue}); //had to use Z axis rotation (basically the same thing)
  10. for(var i=0; i<orbit.numChildren; i++){
  11. var planet = orbit.getChildAt(i);
  12. TweenLite.to(planet,0.5,{rotationZ:rotationValue*-1});
  13. }
  14. }

Report this snippet  

You need to login to post a comment.