Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. import flash.events.Event;
  2. import com.whirled.AvatarControl;
  3.  
  4. if (_ctrl == null) {
  5. _ctrl = new AvatarControl(this);
  6. _body = new Body(_ctrl, this, 550);
  7. _ctrl.addEventListener(Event.UNLOAD, handleUnload);
  8. _ctrl.setHotSpot(269, 399);
  9. _ctrl.setMoveSpeed(200);
  10. _ctrl.addEventListener(ControlEvent.STATE_CHANGED, stateChanged);
  11.  
  12. function stateChanged(event:ControlEvent):void {
  13. switch(event.name) {
  14. case "Run":
  15. _ctrl.setMoveSpeed(250);
  16. break;
  17.  
  18. default:
  19. _ctrl.setMoveSpeed(150);
  20. break;
  21. }
  22. }
  23. _body.shutdown();
  24. }
  25. }
  26.  
  27. var _ctrl :AvatarControl;
  28. var _body :Body;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement