Guest User

Untitled

a guest
Oct 16th, 2017
81
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 flash.geom.ColorTransform;
  6. import fl.transitions.*
  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. }
  16.  
  17. var _ctrl :AvatarControl;
  18. var _body :Body;
  19. _ctrl.setMoveSpeed(150);
  20. _ctrl.setHotSpot(272, 382, 9999);
  21.  
  22. var colT:Color = new Color();
  23. var rand1:uint = uint(Math.random() * 0xFFFFFF);
  24. var rand2:uint = uint(Math.random() * 0xFFFFFF);
  25. var _timer:Timer = new Timer(1000);
  26. var NTU:NameTextUtil = new NameTextUtil();
  27.  
  28. _timer.addEventListener(TimerEvent.TIMER, onTimePass);
  29.  
  30. function onTimePass(e:TimerEvent):void
  31. {
  32.     var _trans:Tween=new Tween(clip_mc,'alpha',Strong.easeOut,0,1,1,true);
  33.     _trans.addEventListener(TweenEvent.MOTION_CHANGE, colChange);
  34. }
  35. function colChange(event:TweenEvent):void
  36. {
  37.      colorInfo.color=Color.interpolateColor(rand1,rand2,event.position);
  38.      NTU.setTextColor(colorInfo);
  39.      removeList();
  40. }
  41. function removeList() :void {
  42.     _trans.removeEventListener(TweenEvent.MOTION_CHANGE, colChange);
  43. }
  44. NTU.setTextY(120);
  45. NTU.setOutlineColor(0x000000);
  46. NTU.setOutlineWidth(3);
  47. NTU.setTextContent(String(_ctrl.getEntityProperty(EntityControl.PROP_NAME,_ctrl.getMyEntityId())));
  48. NTU.createName(_ctrl, this, 550);
Add Comment
Please, Sign In to add comment