Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.whirled.EntityControl;
- import flash.events.Event;
- import com.whirled.AvatarControl;
- import fl.motion.Color;
- import fl.transitions.*
- import fl.transitions.easing.Strong
- if (_ctrl == null) {
- _ctrl = new AvatarControl(this);
- _body = new Body(_ctrl, this, 550);
- _ctrl.addEventListener(Event.UNLOAD, handleUnload);
- function handleUnload (... ignored) :void {
- _body.shutdown();
- }
- NTU.setTextColor(0x000000);
- }
- var _ctrl :AvatarControl;
- var _body :Body;
- _ctrl.setMoveSpeed(150);
- _ctrl.setHotSpot(272, 382, 9999);
- var colorInfo:Color = new Color();
- var rand1:uint = uint(Math.random() * 0xFFFFFF);
- var rand2:uint = uint(Math.random() * 0xFFFFFF);
- var _timer:Timer = new Timer(1000);
- var NTU:NameTextUtil = new NameTextUtil();
- var _trans:Tween;
- _timer.addEventListener(TimerEvent.TIMER, onTimePass);
- function onTimePass(e:TimerEvent):void
- {
- _trans = new Tween(colorInfo,'color',Strong.easeOut,colorInfo.color,uint(Math.random() * 0xFFFFFF),1,true);
- _trans.addEventListener(TweenEvent.MOTION_CHANGE, colChange);
- trace("timer on, MOTION_CHANGE ADDED")
- }
- function colChange(event:TweenEvent):void
- {
- NTU.setTextColor(colorInfo.color);
- trace("COLOR SET");
- }
- NTU.setTextY(120);
- NTU.setOutlineColor(0x000000);
- NTU.setOutlineWidth(3);
- NTU.setTextContent(String(_ctrl.getEntityProperty(EntityControl.PROP_NAME,_ctrl.getMyEntityId())));
- NTU.createName(_ctrl, this, 550);
Add Comment
Please, Sign In to add comment