home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 127
/
MOBICLIC127.ISO
/
mac
/
DATA
/
DSS127
/
DSS127_01
/
DSS127_01.swf
/
scripts
/
frame_120
/
DoAction.as
Wrap
Text File
|
2010-09-13
|
4KB
|
145 lines
function testDone()
{
if(countDone == 2)
{
gotoAndStop("01_OK");
}
}
stop();
if(_global.HOTE !== undefined)
{
_global.HOTE.gListeVu_DSS127[0][0] = 1;
}
initBT_X();
nbDrags = 2;
countDone = 0;
listCible = ["A","B"];
dragClip = "ZONE_01";
var i = 1;
while(i <= nbDrags)
{
this[dragClip + "_" + gimme2digits(i)].pDrag = i;
this[dragClip + "_" + gimme2digits(i)].pDone = undefined;
this[dragClip + "_" + gimme2digits(i)].onRollOver = function()
{
this.useHandCursor = 0;
if(this.pDone == undefined)
{
if(_root.drag == undefined)
{
this.useHandCursor = 1;
gereCursor(3);
this.gotoAndStop("E2");
joueBruitage({nomSon:"B_01_" + gimme2digits(this.pDrag) + "_ROLL"});
}
}
};
this[dragClip + "_" + gimme2digits(i)].onRollOut = function()
{
if(this.pDone == undefined)
{
if(_root.drag == undefined)
{
gereCursor(1);
this.gotoAndStop("E1");
stopBruitage({nomSon:"B_01_" + gimme2digits(this.pDrag) + "_ROLL"});
}
}
};
this[dragClip + "_" + gimme2digits(i)].onPress = function()
{
if(this.pDone == undefined)
{
stopBruitage({nomSon:"B_01_" + gimme2digits(this.pDrag) + "_ROLL"});
joueBruitage({nomSon:"B_01_" + gimme2digits(this.pDrag) + "_DRAG"});
if(_root.drag == undefined)
{
gereCursor(3);
this.gotoAndStop("E3");
_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()
{
gereCursor(3);
if(this.pDone == undefined)
{
if(_root.foundDrop == undefined)
{
joueBruitage({nomSon:"B_NO"});
this._x = this.origX;
this._y = this.origY;
this.swapDepths(this.origDepth);
}
else
{
trace("OK");
this.swapDepths(this.origDepth);
this._x = this.origX;
this._y = this.origY;
joueBruitage({nomSon:"B_01_" + gimme2digits(this.pDrag) + "_DROP"});
_root.countDone += 1;
this.pDone = 1;
this.gotoAndStop("E4");
}
_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");
switch(this.pDrag)
{
case 1:
if(_loc3_ == 0)
{
_root.foundDrop = _loc3_;
}
break;
case 2:
if(_loc3_ == 1)
{
_root.foundDrop = _loc3_;
}
}
}
_loc3_ = _loc3_ + 1;
}
}
};
i++;
}