Guest User

Untitled

a guest
Oct 16th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import com.whirled.EntityControl;
  2. import flash.events.Event;
  3. import com.whirled.AvatarControl;
  4. import fl.motion.Color;
  5. import fl.transitions.*
  6. import fl.transitions.easing.Strong
  7.  
  8. if (_ctrl == null) {
  9.     _ctrl = new AvatarControl(this);
  10.     _body = new Body(_ctrl, this, 550);
  11.     _ctrl.addEventListener(Event.UNLOAD, handleUnload);
  12.     function handleUnload (... ignored) :void {
  13.         _body.shutdown();
  14.     }
  15.     NTU.setTextColor(0x000000);
  16. }
  17.  
  18. var _ctrl :AvatarControl;
  19. var _body :Body;
  20. _ctrl.setMoveSpeed(150);
  21. _ctrl.setHotSpot(272, 382, 9999);
  22.  
  23. var colorInfo:Color = new Color();
  24. var rand1:uint = uint(Math.random() * 0xFFFFFF);
  25. var rand2:uint = uint(Math.random() * 0xFFFFFF);
  26. var _timer:Timer = new Timer(1000);
  27. var NTU:NameTextUtil = new NameTextUtil();
  28. var _trans:Tween;
  29.  
  30. _timer.addEventListener(TimerEvent.TIMER, onTimePass);
  31.  
  32. function onTimePass(e:TimerEvent):void
  33. {
  34.     _trans = new Tween(colorInfo,'color',Strong.easeOut,colorInfo.color,uint(Math.random() * 0xFFFFFF),1,true);
  35.     _trans.addEventListener(TweenEvent.MOTION_CHANGE, colChange);
  36.     trace("timer on, MOTION_CHANGE ADDED")
  37. }
  38. function colChange(event:TweenEvent):void
  39. {
  40.      NTU.setTextColor(colorInfo.color);
  41.     trace("COLOR SET");
  42. }
  43. NTU.setTextY(120);
  44. NTU.setOutlineColor(0x000000);
  45. NTU.setOutlineWidth(3);
  46. NTU.setTextContent(String(_ctrl.getEntityProperty(EntityControl.PROP_NAME,_ctrl.getMyEntityId())));
  47. NTU.createName(_ctrl, this, 550);
Add Comment
Please, Sign In to add comment