home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 161
/
MOBICLIC161.ISO
/
pc
/
DATA
/
DSS161
/
DSS161_03
/
DSS161_03.swf
/
scripts
/
dss161
/
ClickZonesSituation.as
next >
Wrap
Text File
|
2014-01-15
|
3KB
|
98 lines
package dss161
{
import com.milanpresse.tools.GlobalesFunctions;
import dss161.engineaddons.gamesprotos.Actor;
import dss161.engineaddons.gamesprotos.actors.actorClip.ActorClip;
import flash.display.DisplayObject;
public dynamic class ClickZonesSituation extends Actor
{
private var params:Object;
public var btns:Actor;
public function ClickZonesSituation(param1:Object)
{
var _loc2_:int = 0;
var _loc3_:int = 0;
var _loc4_:DisplayObject = null;
super(game);
this.params = param1;
this.btns = addActor();
if(param1.clips != undefined)
{
_loc2_ = 0;
while(_loc2_ < param1.clips.length)
{
this.targetMCInit(param1.clips[_loc2_]);
_loc2_++;
}
}
else
{
_loc3_ = param1.numeros[0];
while(_loc3_ <= param1.numeros[1])
{
if((_loc4_ = param1.container.getChildByName(param1.pattern.replace("##",GlobalesFunctions.gimme2digits(_loc3_)).replace("#",_loc3_))) != null)
{
this.targetMCInit(_loc4_,_loc3_);
}
_loc3_++;
}
}
}
private function targetMCInit(param1:DisplayObject, param2:int = -1) : ActorClip
{
var _loc4_:* = null;
var _loc3_:Object = {};
for(_loc4_ in this.params.onRollOverState)
{
_loc3_[_loc4_] = this.params.onRollOverState[_loc4_];
}
if(_loc3_.noiseCode != undefined)
{
_loc3_.noiseCode = _loc3_.noiseCode.replace("##",GlobalesFunctions.gimme2digits(param2)).replace("#",param2);
}
if(_loc3_.ibId != undefined)
{
_loc3_.ibId = _loc3_.ibId.replace("##",GlobalesFunctions.gimme2digits(param2)).replace("#",param2);
}
return this.btns.addActor({
"mc":param1,
"no":(param2 == -1 ? undefined : param2),
"onRollOverState":_loc3_,
"onRollOutState":this.params.onRollOutState,
"onClickState":this.params.onClickState,
"onClick":this.params.onClick,
"onRollOver":this.params.onRollOver,
"onRollOut":this.params.onRollOut,
"enabled":true
});
}
public function disableAll() : void
{
this.btns.foreach(function(param1:ActorClip):void
{
param1.enabled = false;
});
}
public function enableAll() : void
{
this.btns.foreach(function(param1:ActorClip):void
{
param1.enabled = true;
});
}
override protected function _destroy() : void
{
super._destroy();
}
}
}