home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 108
/
jogo-disk-108.iso
/
Games
/
rush_hour.swf
/
scripts
/
__Packages
/
Vehicle.as
< prev
Wrap
Text File
|
2010-05-15
|
2KB
|
56 lines
class Vehicle extends MovieClip
{
function Vehicle()
{
super();
}
function onRelease()
{
delete this.onEnterFrame;
this._x = this.spacing * (this.xpos + this.ypos);
this._y = this.spacing / 2 * (this.xpos - this.ypos);
_root.adjustDepth(this);
this._parent.updateBoard();
}
function onReleaseOutside()
{
this.onRelease();
}
function onLoad()
{
var _loc10_ = undefined;
var _loc5_ = undefined;
var _loc4_ = undefined;
if(this.size[0] > this.size[1])
{
_loc10_ = this.size[0];
}
else
{
_loc10_ = this.size[1];
}
var _loc2_ = 1;
while(_loc2_ <= _loc10_)
{
if(this.size[0] > this.size[1])
{
_loc5_ = this.spacing * (this.xpos + _loc2_ + this.ypos);
_loc4_ = this.spacing / 2 * (this.xpos + _loc2_ - this.ypos);
}
else
{
_loc5_ = this.spacing * (this.xpos + this.ypos + _loc2_);
_loc4_ = this.spacing / 2 * (this.xpos - this.ypos - _loc2_);
}
var _loc3_ = this.getDepth().toString() + _loc2_.toString();
var _loc6_ = this.cartype + _loc2_;
this["child" + _loc2_] = this._parent.attachMovie(_loc6_,"car" + _loc3_,parseInt(_loc3_),{_x:_loc5_,_y:_loc4_,theparent:this});
_loc2_ = _loc2_ + 1;
}
}
function getPossibleX(a)
{
return this.spacing * (a[0] + a[1]);
}
}