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.*
- if (_ctrl == null) {
- _ctrl = new AvatarControl(this);
- _body = new Body(_ctrl, this, 550);
- _ctrl.addEventListener(Event.UNLOAD, handleUnload);
- function handleUnload (... ignored) :void {
- _body.shutdown();
- }
- }
- var _ctrl :AvatarControl;
- var _body :Body;
- _ctrl.setMoveSpeed(150);
- _ctrl.setHotSpot(272, 382, 9999);
- var colT: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();
- _timer.addEventListener(TimerEvent.TIMER, onTimePass);
- function onTimePass(e:TimerEvent):void
- {
- var _trans:Tween=new Tween(clip_mc,'alpha',Strong.easeOut,0,1,1,true);
- _trans.addEventListener(TweenEvent.MOTION_CHANGE, colChange);
- }
- function colChange(event:TweenEvent):void
- {
- colorInfo.color=Color.interpolateColor(rand1,rand2,event.position);
- NTU.setTextColor(colorInfo);
- removeList();
- }
- function removeList() :void {
- _trans.removeEventListener(TweenEvent.MOTION_CHANGE, colChange);
- }
- 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