home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 127
/
MOBICLIC127.ISO
/
mac
/
DATA
/
DSS127
/
DSS127_03
/
DSS127_03.swf
/
scripts
/
frame_70
/
DoAction.as
Wrap
Text File
|
2010-09-13
|
4KB
|
122 lines
stop();
BT_X._visible = 1;
LM_JEU_01._alpha = 40;
LM_JEU_02._alpha = 100;
ZONE_01._alpha = 0;
ZONE_02._alpha = 0;
ZONE_03._alpha = 0;
nbDrags = 1;
listCible = ["ZONE_01","ZONE_02","ZONE_03"];
dragClip = "PLANET";
var i = 1;
while(i <= nbDrags)
{
this[dragClip + "_" + gimme2digits(i)].pDrag = i;
this[dragClip + "_" + gimme2digits(i)].onRollOver = function()
{
this.useHandCursor = 0;
if(_root.drag == undefined)
{
joueBruitage({nomSon:"B_PLANETE"});
this.useHandCursor = 1;
gereCursor(3);
this.gotoAndStop("E2");
}
};
this[dragClip + "_" + gimme2digits(i)].onRollOut = function()
{
if(_root.drag == undefined)
{
gereCursor(1);
this.gotoAndStop("E1");
stopBruitage({nomSon:"B_PLANETE"});
}
};
this[dragClip + "_" + gimme2digits(i)].onPress = function()
{
if(_root.drag == undefined)
{
stopBruitage({nomSon:"B_PLANETE"});
joueBruitage({nomSon:"B_DRAG"});
gereCursor(1);
this.gotoAndStop("E1");
_root.drag = this.pDrag;
this.origX = this._x;
this.origY = this._y;
this.diffX = _root._xmouse - this._x;
this.diffY = _root._ymouse - this._y;
this.origDepth = this.getDepth();
this.swapDepths(15050);
}
};
this[dragClip + "_" + gimme2digits(i)].onRelease = this[dragClip + "_" + gimme2digits(i)].onReleaseOutside = function()
{
if(_root.foundDrop == undefined)
{
joueBruitage({nomSon:"B_NO"});
this._x = this.origX;
this._y = this.origY;
this.swapDepths(this.origDepth);
}
else
{
switch(foundDrop)
{
case 0:
this._x = this.origX;
this._y = this.origY;
this.swapDepths(this.origDepth);
joueSon({nomSon:"01_03_E1",actionFin:"RIEN"});
break;
case 1:
this.swapDepths(this.origDepth);
_root.gotoAndStop("01_03_S");
break;
case 2:
this._x = this.origX;
this._y = this.origY;
this.swapDepths(this.origDepth);
joueSon({nomSon:"01_03_E2",actionFin:"RIEN"});
}
}
_root.drag = undefined;
};
this[dragClip + "_" + gimme2digits(i)].onEnterFrame = function()
{
if(_root.drag == this.pDrag)
{
this._x = _root._xmouse - this.diffX;
this._y = _root._ymouse - this.diffY;
if(this._x < CONTRAINT._x + this._width / 2)
{
this._x = CONTRAINT._x + this._width / 2;
}
else if(this._x > CONTRAINT._x + CONTRAINT._width - this._width / 2)
{
this._x = CONTRAINT._x + CONTRAINT._width - this._width / 2;
}
if(this._y < CONTRAINT._y + this._height / 2)
{
this._y = CONTRAINT._y + this._height / 2;
}
else if(this._y > CONTRAINT._y + CONTRAINT._height - this._height / 2)
{
this._y = CONTRAINT._y + CONTRAINT._height - this._height / 2;
}
_root.foundDrop = undefined;
var _loc3_ = 0;
while(_loc3_ < _root.listCible.length)
{
if(_root[_root.listCible[_loc3_]].hitTest(_root._xmouse,_root._ymouse,1))
{
trace("FOUND");
_root.foundDrop = _loc3_;
_loc3_ = _root.listCible.length;
}
_loc3_ = _loc3_ + 1;
}
}
};
i++;
}