home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 161
/
MOBICLIC161.ISO
/
pc
/
DATA
/
DSS161
/
DSS161_00
/
DSS161_00.swf
/
scripts
/
dss161
/
engineaddons
/
gamesprotos
/
actors
/
actorClip
/
ActorClip.as
next >
Wrap
Text File
|
2014-01-15
|
43KB
|
1,356 lines
package dss161.engineaddons.gamesprotos.actors.actorClip
{
import com.milanpresse.engine.medias.MediaSwf;
import com.milanpresse.engine.typeargument.NoiseObject;
import com.milanpresse.tools.GlobalesFunctions;
import dss161.engineaddons.facades.GameEngine;
import dss161.engineaddons.gamesprotos.Actor;
import dss161.engineaddons.gamesprotos.CollisionTest;
import dss161.engineaddons.gamesprotos.DragDropParams;
import dss161.engineaddons.timelines.TimelineController;
import dss161.engineaddons.timelines.TimelineLinear;
import dss161.engineaddons.timers.TimerChild;
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.utils.Timer;
import flash.utils.getTimer;
public dynamic class ActorClip extends Actor implements IActorClip
{
protected var _clip:MovieClip;
protected var _initialState:Object;
protected var _lastClickState:Object;
protected var _timeline:TimelineLinear;
protected var _timelineController:TimelineController;
protected var _onClickState:Object;
protected var _onRollOverState:Object;
protected var _onRollOutState:Object;
protected var _onClick:Function = null;
protected var _onRollOver:Function = null;
protected var _onRollOut:Function = null;
protected var _onRelease:Function = null;
protected var _onDragStart:Function = null;
protected var _onDrag:Function = null;
protected var _onDrop:Function = null;
protected var _clickMode:String = "ondown";
protected var _interactiveZone:MovieClip;
protected var _dragDrop:DragDropParams;
protected var dragTimer:Timer;
protected var _limitZone = null;
protected var _dragEnabled:Boolean = false;
protected var _collision:Object;
public var collisionTest:CollisionTest;
protected var hitTestDistanceParams:Object;
public var hitZones:Array;
private var playLabelTemp:Object;
protected var _onFrameExit:Function = null;
protected var _onFrameEnter:Function = null;
protected var _onLabelEnter:Function = null;
protected var _onLabelExit:Function = null;
public function ActorClip(param1:DisplayObject, param2:GameEngine, param3:Object = null)
{
var _loc4_:* = null;
var _loc5_:Boolean = false;
this._onClickState = {};
this._onRollOverState = {};
this._onRollOutState = {};
this._dragDrop = new DragDropParams();
this.dragTimer = new Timer(10);
this._collision = {
"type":"object",
"testFunc":this.hitTestObjects
};
this.hitTestDistanceParams = {"distanceMini":100000};
this.hitZones = [];
this.playLabelTemp = {
"firstFrameOrLabel":0,
"lastFrameOrLabel":null,
"callback":null
};
super(param2,param3.parentActor == undefined ? null : param3.parentActor);
this._clip = this._interactiveZone = param1 as MovieClip;
this.initialState = {
"x":this._clip.x,
"y":this._clip.y,
"scaleX":this._clip.scaleX,
"scaleY":this._clip.scaleY,
"parent":this._clip.parent,
"depthIndex":(this._clip.parent == null ? -1 : this._clip.parent.getChildIndex(this._clip))
};
if(param3.parent != undefined && this._clip.parent != param3.parent)
{
param3.parent.addChild(this._clip);
}
if(this._clip is MovieClip)
{
this.hitZones = this.getHitZones(this._clip);
_name = this._clip.name;
this._timeline = new TimelineLinear(this._clip,_e.engine,this,_e.timelineManager,{});
this._timelineController = new TimelineController(this._clip,_e.engine,this,_e.timelineManager);
this.collisionTest = new CollisionTest(this);
this.gotoAndStop({"labelStop":1});
}
if(param3 != null)
{
for(_loc4_ in param3)
{
if(_loc4_ != "mc" && _loc4_ != "onClickState" && _loc4_ != "onRollOverState" && _loc4_ != "onRollOutState" && _loc4_ != "enabled")
{
this[_loc4_] = param3[_loc4_];
}
}
_loc5_ = param3.onClickState || param3.onRollOverState || param3.onRollOutState || param3.enabled != undefined;
if(_loc5_)
{
this.stateChange("onClickState",param3.onClickState);
this.stateChange("onRollOutState",param3.onRollOutState);
this.stateChange("onRollOverState",param3.onRollOverState);
this.initAs();
}
if(param3.enabled != undefined)
{
this.enabled = param3.enabled;
}
}
}
public static function create(param1:GameEngine, param2:*) : ActorClip
{
var _loc3_:MovieClip = null;
if(param2.mc != undefined)
{
_loc3_ = param2.mc;
if(_loc3_ == null)
{
return null;
}
}
else if(param2.id != undefined)
{
_loc3_ = (param1.engine.getMedia(param2) as MediaSwf).swfContent as MovieClip;
if(_loc3_ == null)
{
return null;
}
}
else if(param2.code != undefined)
{
_loc3_ = (param1.engine.getMediaSwf(param2.code) as MediaSwf).swfContent as MovieClip;
if(_loc3_ == null)
{
return null;
}
}
else if(param2.name != undefined)
{
_loc3_ = (param1.engine.getMediaSwf(param2.name) as MediaSwf).swfContent as MovieClip;
if(_loc3_ == null)
{
return null;
}
}
if(_loc3_ == null)
{
return null;
}
return new ActorClip(_loc3_,param1,param2);
}
public function getGlobalCoord() : Point
{
return this._clip.parent.localToGlobal(new Point(this._clip.x,this._clip.y));
}
public function getObjectCoordToLocal(param1:DisplayObject) : Point
{
return this._clip.parent.globalToLocal(param1.parent.localToGlobal(new Point(param1.x,param1.y)));
}
public function setToDO(param1:DisplayObject) : void
{
var _loc2_:Point = param1.parent.localToGlobal(this.getLocPoint(param1));
_loc2_ = this.parent.globalToLocal(_loc2_);
this.x = _loc2_.x;
this.y = _loc2_.y;
}
public function setToLocalPos(param1:Number, param2:Number, param3:Number, param4:Function) : void
{
var posInitial:Point = null;
var startTime:Number = NaN;
var tempTime:Number = NaN;
var timer:TimerChild = null;
var xDest:Number = param1;
var yDest:Number = param2;
var time:Number = param3;
var callback:Function = param4;
posInitial = this.getLocPoint(this._clip);
startTime = getTimer();
tempTime = getTimer();
timer = game.mainTimer.addFromObj({
"id":"tween1",
"delay":10,
"loop":0,
"onDelay":function(param1:TimerChild = null):void
{
tempTime = getTimer();
clip.x = posInitial.x + (tempTime - startTime) / time * (xDest - posInitial.x);
clip.y = posInitial.y + (tempTime - startTime) / time * (yDest - posInitial.y);
if(tempTime - startTime >= time)
{
clip.x = xDest;
clip.y = yDest;
timer.stop();
callback();
}
}
});
timer.start();
}
public function setToActorClip(param1:ActorClip) : void
{
var _loc2_:Point = this._clip.parent.globalToLocal(param1.getGlobalCoord());
this.x = _loc2_.x;
this.y = _loc2_.y;
}
public function getLocPoint(param1:DisplayObject) : Point
{
return new Point(param1.x,param1.y);
}
public function getPos(param1:String = null) : Point
{
var _loc2_:DisplayObject = null;
if(param1 != null && this._clip.getChildByName(param1) != null)
{
_loc2_ = this._clip.getChildByName(param1);
return this._clip.localToGlobal(new Point(_loc2_.x,_loc2_.y));
}
return this._clip.parent.localToGlobal(this.getLocPoint(this._clip));
}
public function getBounds(param1:DisplayObject) : Rectangle
{
return this._clip.getRect(param1);
}
public function bringToFront() : void
{
if(this.parent != null && this._clip != null)
{
this.parent.setChildIndex(this._clip,this.parent.numChildren - 1);
}
}
public function setToPos(param1:Number = 0, param2:Number = 0, param3:String = null) : void
{
var _loc5_:Point = null;
var _loc6_:DisplayObject = null;
var _loc7_:Rectangle = null;
var _loc8_:* = undefined;
var _loc9_:Point = null;
var _loc4_:Point = this._clip.parent.globalToLocal(new Point(param1,param2));
if(param3 != null && this._clip.getChildByName(param3) != null)
{
_loc5_ = new Point(this._clip.x,this._clip.y);
_loc6_ = this._clip.getChildByName(param3);
_loc4_ = _loc5_.add(_loc4_.subtract(this._clip.parent.globalToLocal(this._clip.localToGlobal(new Point(_loc6_.x,_loc6_.y)))));
}
if(this._limitZone != null)
{
this._clip.x = _loc4_.x;
this._clip.y = _loc4_.y;
if((_loc8_ = this._clip.getChildByName("BTN")) != null)
{
_loc7_ = _loc8_.getBounds(_e.stage);
if(_loc7_.x < this._limitZone.x)
{
_loc9_ = new Point(_loc7_.x,_loc7_.y).subtract(new Point(this._limitZone.x,this._limitZone.y));
_loc4_.x -= _loc9_.x * this._clip.scaleX;
}
else if(_loc7_.x > this._limitZone.x + this._limitZone.width - _loc7_.width)
{
_loc9_ = new Point(_loc7_.x + _loc7_.width,_loc7_.y).subtract(new Point(this._limitZone.x + this._limitZone.width,this._limitZone.height));
_loc4_.x -= _loc9_.x * this._clip.scaleX;
}
if(_loc7_.y < this._limitZone.y)
{
_loc4_.y -= this._clip.scaleY * new Point(_loc7_.x,_loc7_.y).subtract(new Point(this._limitZone.x,this._limitZone.y)).y;
}
else if(_loc7_.y > this._limitZone.y + this._limitZone.height - _loc7_.height)
{
_loc4_.y -= this._clip.scaleY * new Point(_loc7_.x,_loc7_.y + _loc7_.height).subtract(new Point(this._limitZone.width,this._limitZone.y + this._limitZone.height)).y;
}
}
else
{
_loc7_ = this._clip.getBounds(_e.stage);
if(_loc7_.x < this._limitZone.x)
{
_loc4_.x -= this._clip.parent.globalToLocal(new Point(_loc7_.x,_loc7_.y)).x - this._clip.parent.globalToLocal(new Point(this._limitZone.x,this._limitZone.y)).x;
}
else if(_loc7_.x > this._limitZone.x + this._limitZone.width - _loc7_.width)
{
_loc4_.x -= this._clip.parent.globalToLocal(new Point(_loc7_.x + _loc7_.width,_loc7_.y)).x - this._clip.parent.globalToLocal(new Point(this._limitZone.x + this._limitZone.width,this._limitZone.height)).x;
}
if(_loc7_.y < this._limitZone.y)
{
_loc4_.y -= this._clip.parent.globalToLocal(new Point(_loc7_.x,_loc7_.y)).y - this._clip.parent.globalToLocal(new Point(this._limitZone.x,this._limitZone.y)).y;
}
else if(_loc7_.y > this._limitZone.y + this._limitZone.height - _loc7_.height)
{
_loc4_.y -= this._clip.parent.globalToLocal(new Point(_loc7_.x,_loc7_.y + _loc7_.height)).y - this._clip.parent.globalToLocal(new Point(this._limitZone.width,this._limitZone.y + this._limitZone.height)).y;
}
}
}
this._clip.x = _loc4_.x;
this._clip.y = _loc4_.y;
}
public function initAs(param1:* = null) : void
{
this.initCommonStateActions(this.onRollOutState);
this.initCommonStateActions(this.onClickState);
this.initCommonStateActions(this.onRollOverState);
if(this._clip.BTN != undefined)
{
this._interactiveZone = this._clip.BTN;
this._interactiveZone.alpha = 0;
}
if(this._clip.getChildByName("BTN") != null)
{
this._interactiveZone = this._clip.BTN;
this._interactiveZone.alpha = 0;
}
else
{
this._interactiveZone = this._clip;
}
this.gotoAndStop(this.onRollOutState.label == undefined ? 1 : this.onRollOutState.label);
this.addListeners();
}
protected function addListeners() : void
{
this.removeListeners();
if(this._clickMode == "ondown")
{
this._interactiveZone.addEventListener(MouseEvent.MOUSE_DOWN,this.clickHandler);
}
else
{
this._interactiveZone.addEventListener(MouseEvent.CLICK,this.clickHandler);
}
this._interactiveZone.addEventListener(MouseEvent.MOUSE_UP,this.releaseHandler);
this._interactiveZone.addEventListener(MouseEvent.ROLL_OVER,this.rollOverHandler);
this._interactiveZone.addEventListener(MouseEvent.ROLL_OUT,this.rollOutHandler);
(this._interactiveZone as MovieClip).mouseChildren = false;
}
protected function removeListeners() : void
{
if(this._interactiveZone != null)
{
this._interactiveZone.removeEventListener(MouseEvent.MOUSE_DOWN,this.clickHandler);
this._interactiveZone.removeEventListener(MouseEvent.CLICK,this.clickHandler);
this._interactiveZone.removeEventListener(MouseEvent.MOUSE_UP,this.releaseHandler);
this._interactiveZone.removeEventListener(MouseEvent.ROLL_OVER,this.rollOverHandler);
this._interactiveZone.removeEventListener(MouseEvent.ROLL_OUT,this.rollOutHandler);
}
}
protected function clickHandler(param1:MouseEvent) : void
{
var _loc2_:int = 0;
if(this._clip.enabled == false)
{
return;
}
this._clip.enabled = false;
if(this._dragEnabled)
{
game.stage.addEventListener(MouseEvent.MOUSE_UP,this.releaseHandler);
this.dragStart();
if(this.onClickState.actions != undefined)
{
_loc2_ = 0;
while(_loc2_ < this.onClickState.actions.length)
{
if(this.onClickState.actions[_loc2_].args != null)
{
this.onClickState.actions[_loc2_].method(this.onClickState.actions[_loc2_].args);
}
else
{
this.onClickState.actions[_loc2_].method();
}
_loc2_++;
}
}
}
else
{
if(this.onClickState.actions != undefined)
{
_loc2_ = 0;
while(_loc2_ < this.onClickState.actions.length)
{
if(this.onClickState.actions[_loc2_].args != null)
{
this.onClickState.actions[_loc2_].method(this.onClickState.actions[_loc2_].args);
}
else
{
this.onClickState.actions[_loc2_].method();
}
_loc2_++;
}
}
this._clip.enabled = true;
}
if(this._onClick != null)
{
this._onClick(this);
}
param1.updateAfterEvent();
}
public function dragStart() : void
{
if(this._dragDrop.isDragging == false)
{
this._dragDrop.isDragging = true;
this._lastClickState = {
"x":this._clip.x,
"y":this._clip.y,
"scaleX":this._clip.scaleX,
"scaleY":this._clip.scaleY,
"parent":this._clip.parent,
"depthIndex":(this._clip.parent == null ? -1 : this._clip.parent.getChildIndex(this._clip))
};
this.dragTimer.addEventListener(TimerEvent.TIMER,this.dragHandler);
this.dragTimer.start();
if(this.onDragStart != null)
{
this.onDragStart(this);
}
}
}
public function setCollision(param1:String, param2:Object = null) : void
{
switch(param1)
{
case "distance":
this._collision.type = "distance";
this._collision.testFunc = this.hitTestDistance;
if(param2 != null)
{
this.hitTestDistanceParams = param2;
}
break;
case "object":
this._collision.type = "object";
this._collision.testFunc = this.hitTestObjects;
}
}
public function getNearestClip(param1:Array) : *
{
var _loc8_:Point = null;
var _loc2_:Number = -1;
var _loc3_:Number = 0;
var _loc4_:* = null;
var _loc5_:Point = this.getLocPoint(this._clip);
var _loc6_:Point = new Point(0,0);
var _loc7_:int = 0;
while(_loc7_ < param1.length)
{
_loc8_ = new Point(param1[_loc7_].x,param1[_loc7_].y);
_loc5_ = this.getPos();
_loc6_ = param1[_loc7_].parent.localToGlobal(_loc8_);
_loc3_ = Point.distance(_loc5_,_loc6_);
if(_loc3_ <= this.hitTestDistanceParams.distanceMini && (_loc2_ < 0 || _loc3_ < _loc2_))
{
_loc2_ = _loc3_;
_loc4_ = param1[_loc7_];
}
_loc7_++;
}
return _loc4_;
}
protected function hitTestDistance(param1:Array) : *
{
var _loc7_:Point = null;
var _loc2_:Number = -1;
var _loc3_:Number = 0;
var _loc4_:* = null;
var _loc5_:Point = this.getLocPoint(this._clip);
var _loc6_:Point = new Point(0,0);
var _loc8_:int = 0;
while(_loc8_ < param1.length)
{
if(param1[_loc8_].getChildByName("REP_CENTRE") != null)
{
_loc7_ = new Point(param1[_loc8_].getChildByName("REP_CENTRE").x,param1[_loc8_].getChildByName("REP_CENTRE").y);
_loc7_ = param1[_loc8_].clip.localToGlobal(_loc7_);
_loc7_ = param1[_loc8_].parent.globalToLocal(_loc7_);
}
else
{
_loc7_ = new Point(param1[_loc8_].x,param1[_loc8_].y);
}
_loc6_.x = _loc7_.x;
_loc6_.y = _loc7_.y;
_loc3_ = Point.distance(_loc5_,_loc6_);
if(_loc3_ <= this.hitTestDistanceParams.distanceMini && (_loc2_ < 0 || _loc3_ < _loc2_))
{
_loc2_ = _loc3_;
_loc4_ = param1[_loc8_];
}
_loc8_++;
}
return _loc4_;
}
protected function getHitZones(param1:DisplayObjectContainer) : Array
{
var _loc4_:DisplayObject = null;
var _loc5_:int = 0;
var _loc2_:Array = [];
var _loc3_:DisplayObjectContainer = param1.getChildByName("HIT_AREA") as DisplayObjectContainer;
if(_loc3_ != null && _loc3_.numChildren > 0)
{
_loc3_.alpha = 0;
_loc5_ = 0;
while(_loc5_ < _loc3_.numChildren)
{
_loc4_ = _loc3_.getChildAt(_loc5_);
if(_loc4_.name.search(/^REP_AREA/) != -1)
{
_loc2_.push(_loc4_);
}
_loc5_++;
}
}
return _loc2_;
}
protected function hitTestObjects(param1:Array) : *
{
var _loc2_:DisplayObject = null;
var _loc3_:DisplayObject = null;
var _loc4_:int = 0;
var _loc5_:int = 0;
var _loc6_:int = 0;
var _loc7_:Array = [];
if(this.hitZones.length > 0)
{
_loc4_ = 0;
while(_loc4_ < this.hitZones.length)
{
_loc2_ = this.hitZones[_loc4_];
_loc5_ = 0;
while(_loc5_ < param1.length)
{
if(param1[_loc5_].hitZones.length > 0)
{
_loc6_ = 0;
while(_loc6_ < param1[_loc5_].hitZones.length)
{
_loc3_ = param1[_loc5_].hitZones[_loc6_];
if(_loc2_.hitTestObject(_loc3_))
{
_loc7_.push(param1[_loc5_]);
}
_loc6_++;
}
}
else if(_loc2_.hitTestObject(param1[_loc5_].clip))
{
_loc7_.push(param1[_loc5_]);
}
_loc5_++;
}
_loc4_++;
}
return this.getNearestClip(_loc7_);
}
_loc5_ = 0;
while(_loc5_ < param1.length)
{
if(param1[_loc5_].hitZones.length > 0)
{
_loc6_ = 0;
while(_loc6_ < param1[_loc5_].hitZones.length)
{
_loc3_ = param1[_loc5_].hitZones[_loc6_];
if(this._clip.hitTestObject(_loc3_))
{
_loc7_.push(param1[_loc5_]);
}
_loc6_++;
}
}
else if(this._clip.hitTestObject(param1[_loc5_].clip))
{
_loc7_.push(param1[_loc5_]);
}
_loc5_++;
}
return this.getNearestClip(_loc7_);
}
protected function dragHandler(param1:TimerEvent) : void
{
this._dragDrop.dropTarget = this._collision.testFunc(this._dragDrop.dropTargets);
if(this._onDrag != null)
{
this._onDrag(this);
}
param1.updateAfterEvent();
}
protected function rollOverHandler(param1:MouseEvent) : void
{
var _loc2_:int = 0;
if(this._clip.enabled == false)
{
return;
}
if(this.onRollOverState.actions != undefined)
{
this._clip.enabled = false;
this._interactiveZone.removeEventListener(MouseEvent.ROLL_OVER,this.rollOverHandler);
_loc2_ = 0;
while(_loc2_ < this.onRollOverState.actions.length)
{
if(this.onRollOverState.actions[_loc2_].args != null)
{
this.onRollOverState.actions[_loc2_].method(this.onRollOverState.actions[_loc2_].args);
}
else
{
this.onRollOverState.actions[_loc2_].method();
}
_loc2_++;
}
param1.updateAfterEvent();
this._interactiveZone.addEventListener(MouseEvent.ROLL_OVER,this.rollOverHandler);
this._clip.enabled = true;
}
if(this._onRollOver != null)
{
this._onRollOver(this);
}
}
protected function rollOutHandler(param1:MouseEvent) : void
{
var _loc2_:int = 0;
if(this._clip.enabled == false)
{
return;
}
if(this.onRollOutState.actions != undefined)
{
this._clip.enabled = false;
_loc2_ = 0;
while(_loc2_ < this.onRollOutState.actions.length)
{
if(this.onRollOutState.actions[_loc2_].args != null)
{
this.onRollOutState.actions[_loc2_].method(this.onRollOutState.actions[_loc2_].args);
}
else
{
this.onRollOutState.actions[_loc2_].method();
}
_loc2_++;
}
param1.updateAfterEvent();
this._clip.enabled = true;
}
if(this._onRollOut != null)
{
this._onRollOut(this);
}
}
public function dragStop() : void
{
if(this._dragDrop.isDragging == true)
{
this._dragDrop.isDragging = false;
this.dragListenersRemove();
if(this._onDrop != null)
{
this._onDrop(this);
}
}
}
protected function releaseHandler(param1:MouseEvent) : void
{
if(this._dragEnabled)
{
this._clip.enabled = true;
this.dragStop();
}
else
{
if(this._clip.enabled == false)
{
return;
}
this._clip.enabled = true;
if(this._onRelease != null)
{
this._onRelease(this);
}
}
param1.updateAfterEvent();
}
public function stateChange(param1:String, param2:Object) : void
{
var _loc3_:* = null;
if(param2 is Object)
{
for(_loc3_ in param2)
{
this[param1][_loc3_] = param2[_loc3_];
}
}
this.initCommonStateActions(this[param1]);
}
protected function initCommonStateActions(param1:Object) : void
{
var _loc2_:Object = null;
param1.actions = [];
if(param1.noiseCode != undefined && param1.noiseCode != "")
{
param1.actions.push({
"method":_e.noisePlay,
"args":new NoiseObject({"code":param1.noiseCode})
});
}
if(param1.ibId != undefined && param1.ibId != "")
{
_loc2_ = {
"id":param1.ibId,
"reference":this._clip
};
if(param1.ibRef != undefined)
{
if(param1.ibRef.position != undefined)
{
_loc2_.position = param1.ibRef.position;
}
_loc2_.x = param1.ibRef.x;
_loc2_.y = param1.ibRef.y;
}
param1.actions.push({
"method":_e.ibShow,
"args":_loc2_
});
this.onRollOutState.actions.push({
"method":_e.ibHide,
"args":null
});
this.onClickState.actions.push({
"method":_e.ibHide,
"args":null
});
}
if(param1.label != undefined)
{
param1.actions.push({
"method":this.gotoAndStop,
"args":param1.label
});
}
}
public function hasLabel(param1:String) : Boolean
{
var _loc2_:int = 0;
while(_loc2_ < this._clip.currentLabels.length)
{
if(param1 == this._clip.currentLabels[_loc2_].name)
{
return true;
}
_loc2_++;
}
return false;
}
public function gotoAndStop(param1:*, param2:Object = null) : void
{
var frameOrLabel:* = param1;
var params:Object = param2;
if(params == null)
{
params = {};
}
params.labelStop = frameOrLabel;
params.labelLastCallback = params.labelLastCallback != undefined ? params.labelLastCallback : function():void
{
};
this._timeline.GotoAndPlayUntil(params);
}
private function playEnterFrameHandler(param1:Event) : void
{
if(this.playLabelTemp.lastFrameOrLabel is String)
{
if(this._clip.currentLabel != this.playLabelTemp.lastFrameOrLabel)
{
return;
}
}
else if(this._clip.currentFrame != this.playLabelTemp.lastFrameOrLabel)
{
return;
}
this._clip.removeEventListener(Event.ENTER_FRAME,this.playEnterFrameHandler);
this.stop();
if(this.playLabelTemp.callback != null)
{
this.playLabelTemp.callback();
}
}
public function play(param1:* = null, param2:* = null, param3:Function = null) : void
{
if(param2 != null)
{
this.playLabelTemp = {
"firstFrameOrLabel":param1,
"lastFrameOrLabel":param2,
"callback":param3
};
this._clip.addEventListener(Event.ENTER_FRAME,this.playEnterFrameHandler);
}
this._timelineController.play(param1);
}
public function stop() : void
{
if(this._clip != null)
{
this._clip.removeEventListener(Event.ENTER_FRAME,this.playEnterFrameHandler);
this._timelineController.stop();
this._timeline.Stop();
}
}
public function gotoAndPlay(param1:*, param2:Object = null) : void
{
if(param2 == null)
{
param2 = {};
}
if(param1 == "nextLabel")
{
param1 = this._clip.currentLabels[this._timeline.getPosFrameLabelByName(this._clip,this._clip.currentLabel) + 1].name;
}
else if(param1 == "firstLabel")
{
param1 = this._clip.currentLabels[0].name;
}
param2.labelStop = param1;
this._timeline.GotoAndPlayUntil(param2);
}
public function getChildByName(param1:String) : DisplayObject
{
var _loc2_:Array = param1.split(".");
var _loc3_:* = this._clip;
var _loc4_:int = 0;
while(_loc4_ < _loc2_.length)
{
_loc3_ = _loc3_.getChildByName(_loc2_[_loc4_]);
if(_loc3_ == null)
{
return null;
}
_loc4_++;
}
return _loc3_;
}
public function getChildByPatternName(param1:String, param2:int, param3:int) : Array
{
var _loc5_:DisplayObject = null;
var _loc4_:Array = [];
var _loc6_:int = param2;
while(_loc6_ <= param3)
{
_loc5_ = this.clip.getChildByName(param1 + GlobalesFunctions.gimme2digits(_loc6_));
_loc4_.push(_loc5_);
_loc6_++;
}
return _loc4_;
}
public function get totalFrames() : int
{
return this._clip.totalFrames;
}
public function get currentFrame() : int
{
return this._clip.currentFrame;
}
public function get currentLabel() : String
{
return this._clip.currentLabel;
}
public function get currentLabels() : Array
{
return this._clip.currentLabels;
}
public function get enabled() : Boolean
{
return this._interactiveZone.enabled;
}
public function set enabled(param1:Boolean) : void
{
this._interactiveZone.enabled = param1;
this._interactiveZone.mouseChildren = param1;
this._interactiveZone.mouseEnabled = param1;
this._interactiveZone.buttonMode = param1;
this._interactiveZone.useHandCursor = param1;
if(param1 && this._interactiveZone != null)
{
this.addListeners();
}
else
{
this.removeListeners();
}
}
public function set depthIndex(param1:int) : void
{
if(this.parent != null && this.parent.getChildIndex(this._clip) != param1)
{
this.parent.setChildIndex(this._clip,param1 > this.parent.numChildren - 1 ? int(this.parent.numChildren - 1) : int(param1));
}
}
public function get depthIndex() : int
{
return this.parent != null ? int(this.parent.getChildIndex(this._clip)) : -1;
}
public function comeBack() : void
{
var _loc1_:* = null;
for(_loc1_ in this._lastClickState)
{
this[_loc1_] = this._lastClickState[_loc1_];
}
}
override public function dissociate() : void
{
super.dissociate();
this._clip = null;
}
protected function dragListenersRemove() : void
{
this.dragTimer.stop();
this.dragTimer.removeEventListener(TimerEvent.TIMER,this.dragHandler);
game.stage.removeEventListener(MouseEvent.MOUSE_UP,this.releaseHandler);
}
override protected function _destroy() : void
{
super._destroy();
this.dragListenersRemove();
this.removeListeners();
this.stop();
if(this._timelineController != null)
{
this._timelineController.destroy();
}
if(this._timeline != null)
{
this._timeline.destroy();
}
if(this._clip != null)
{
if(this._initialState.parent != null && this._initialState.depthIndex != -1 && (this.depthIndex != this._initialState.depthIndex || this.parent != this._initialState.parent))
{
this.restore();
}
this.enabled = false;
if(this.initialState.parent == null)
{
this.parent = null;
}
}
this._clip = null;
this._interactiveZone = null;
this._timeline = null;
this._timelineController = null;
this.collisionTest.destroy();
this.collisionTest = null;
}
override public function restore() : void
{
var _loc1_:* = null;
super.restore();
for(_loc1_ in this.initialState)
{
this[_loc1_] = this.initialState[_loc1_];
}
}
public function get alpha() : Number
{
return this._clip.alpha;
}
public function set alpha(param1:Number) : void
{
this._clip.alpha = param1;
}
public function get height() : Number
{
return this._clip.height;
}
public function set height(param1:Number) : void
{
this._clip.height = param1;
}
public function get visible() : Boolean
{
return this._clip.visible;
}
public function set visible(param1:Boolean) : void
{
this._clip.visible = param1;
}
public function get width() : Number
{
return this._clip.width;
}
public function set width(param1:Number) : void
{
this._clip.width = param1;
}
public function get x() : Number
{
return this._clip.x;
}
public function set x(param1:Number) : void
{
this._clip.x = param1;
}
public function get y() : Number
{
return this._clip.y;
}
public function set y(param1:Number) : void
{
this._clip.y = param1;
}
public function set parent(param1:DisplayObjectContainer) : void
{
if(this._clip != null && param1 !== this._clip.parent)
{
if(this._clip.parent != null)
{
this._clip.parent.removeChild(this._clip);
}
if(param1 != null)
{
param1.addChild(this._clip);
}
}
}
public function get parent() : DisplayObjectContainer
{
return this._clip.parent;
}
public function get clip() : MovieClip
{
return this._clip;
}
override public function get name() : String
{
return _name;
}
override public function set name(param1:String) : void
{
_name = param1;
if(this._clip != null)
{
this._clip.name = param1;
}
}
public function set onFrameExit(param1:Function) : void
{
this._onFrameExit = param1;
}
public function get onFrameExit() : Function
{
return this._onFrameExit;
}
public function set onFrameEnter(param1:Function) : void
{
this._onFrameEnter = param1;
}
public function get onFrameEnter() : Function
{
return this._onFrameEnter;
}
public function set onLabelEnter(param1:Function) : void
{
this._onLabelEnter = param1;
}
public function get onLabelEnter() : Function
{
return this._onLabelEnter;
}
public function set onLabelExit(param1:Function) : void
{
this._onLabelExit = param1;
}
public function get onLabelExit() : Function
{
return this._onLabelExit;
}
public function set onLabelEnd(param1:Function) : void
{
this._timeline.onLabelEnd = param1;
}
public function get onLabelEnd() : Function
{
return this._timeline.onLabelEnd;
}
public function get onClickState() : Object
{
return this._onClickState;
}
public function set onClickState(param1:Object) : void
{
this._onClickState = param1;
}
public function get onRollOverState() : Object
{
return this._onRollOverState;
}
public function set onRollOverState(param1:Object) : void
{
this._onRollOverState = param1;
}
public function get onClick() : Function
{
return this._onClick;
}
public function set onClick(param1:Function) : void
{
this._onClick = param1;
}
public function get onRollOver() : Function
{
return this._onRollOver;
}
public function set onRollOver(param1:Function) : void
{
this._onRollOver = param1;
}
public function get onRollOut() : Function
{
return this._onRollOut;
}
public function set onRollOut(param1:Function) : void
{
this._onRollOut = param1;
}
public function get clickMode() : String
{
return this._clickMode;
}
public function set clickMode(param1:String) : void
{
this._clickMode = param1;
}
public function get initialState() : Object
{
return this._initialState;
}
public function set initialState(param1:Object) : void
{
this._initialState = param1;
}
public function get onRollOutState() : Object
{
return this._onRollOutState;
}
public function set onRollOutState(param1:Object) : void
{
this._onRollOutState = param1;
}
public function get onDragStart() : Function
{
return this._onDragStart;
}
public function set onDragStart(param1:Function) : void
{
this._onDragStart = param1;
}
public function get onDrag() : Function
{
return this._onDrag;
}
public function set onDrag(param1:Function) : void
{
this._onDrag = param1;
}
public function get onDrop() : Function
{
return this._onDrop;
}
public function set onDrop(param1:Function) : void
{
this._onDrop = param1;
}
public function get onRelease() : Function
{
return this._onRelease;
}
public function set onRelease(param1:Function) : void
{
this._onRelease = param1;
}
public function get dragDrop() : DragDropParams
{
return this._dragDrop;
}
public function get dragEnabled() : Boolean
{
return this._dragEnabled;
}
public function set dragEnabled(param1:Boolean) : void
{
this._dragEnabled = param1;
}
public function get limitZone() : *
{
return this._limitZone;
}
public function set limitZone(param1:*) : void
{
this._limitZone = param1;
}
}
}