Guest User

Untitled

a guest
Oct 16th, 2017
53
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.  
  7. if (_ctrl == null) {
  8.     _ctrl = new AvatarControl(this);
  9.     _body = new Body(_ctrl, this, 550);
  10.     _ctrl.addEventListener(Event.UNLOAD, handleUnload);
  11.     function handleUnload (... ignored) :void {
  12.         _body.shutdown();
  13.     }
  14. }
  15.  
  16. var _ctrl :AvatarControl;
  17. var _body :Body;
  18. _ctrl.setMoveSpeed(150);
  19. _ctrl.setHotSpot(272, 382, 9999);
  20.  
  21. var colT:Color = new Color();
  22. var rand1:uint = uint(Math.random() * 0xFFFFFF);
  23. var rand2:uint = uint(Math.random() * 0xFFFFFF);
  24. var _timer:Timer = new Timer(1000);
  25. var NTU:NameTextUtil = new NameTextUtil();
  26.  
  27. _timer.addEventListener(TimerEvent.TIMER, onTimePass);
  28.  
  29. function onTimePass(e:TimerEvent):void
  30. {
  31.     var _trans:Tween=new Tween(clip_mc,'alpha',Strong.easeOut,0,1,1,true);
  32.     _trans.addEventListener(TweenEvent.MOTION_CHANGE, colChange);
  33. }
  34. function colChange(event:TweenEvent):void
  35. {
  36.      colorInfo.color=Color.interpolateColor(rand1,rand2,event.position);
  37.      NTU.setTextColor(colorInfo);
  38.      removeList();
  39. }
  40. function removeList() :void {
  41.     _trans.removeEventListener(TweenEvent.MOTION_CHANGE, colChange);
  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