code_junkie

diagonal movement in a flash animation using as3

Nov 12th, 2011
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. package {
  2.  
  3. import flash.display.Sprite;
  4. import flash.events.Event;
  5.  
  6. public class Cloud extends Sprite{
  7.  
  8. public var xSpeed:Number = 1;
  9. public var ySpeed:Number = 1;
  10.  
  11. public function Cloud() {
  12. addEventListener(Event.ENTER_FRAME, handleEnterFrame);
  13. }
  14.  
  15. public function handleEnterFrame(e:Event):void {
  16. x += xSpeed;
  17. y += ySpeed;
  18. }
  19.  
  20. }
  21.  
  22. }
Add Comment
Please, Sign In to add comment