home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 127
/
MOBICLIC127.ISO
/
mac
/
DATA
/
DSS127
/
DSS127_02
/
DSS127_02.swf
/
scripts
/
frame_186
/
DoAction.as
Wrap
Text File
|
2010-09-13
|
4KB
|
127 lines
function testSondes()
{
if(countSondes == 4)
{
gotoAndStop("02_01_FIN_A");
}
else
{
gotoAndStop("AT_SONDE");
}
}
stop();
if(countSondes == undefined)
{
countSondes = 0;
}
nbDrags = 8;
listCible = ["TERRE"];
dragClip = "SONDE_01";
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)
{
this.useHandCursor = 1;
gereCursor(3);
joueBruitage({nomSon:"B_SONDE"});
this.gotoAndStop("E2");
}
};
this[dragClip + "_" + gimme2digits(i)].onRollOut = function()
{
if(_root.drag == undefined)
{
gereCursor(1);
stopBruitage({nomSon:"B_SONDE"});
this.gotoAndStop("E1");
}
};
this[dragClip + "_" + gimme2digits(i)].onPress = function()
{
if(_root.drag == undefined)
{
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);
stopBruitage({nomSon:"B_SONDE"});
joueBruitage({nomSon:"B_DRAG"});
}
};
this[dragClip + "_" + gimme2digits(i)].onRelease = this[dragClip + "_" + gimme2digits(i)].onReleaseOutside = function()
{
this._x = this.origX;
this._y = this.origY;
this.swapDepths(this.origDepth);
if(_root.foundDrop == undefined)
{
joueBruitage({nomSon:"B_NO"});
}
else if(this.pDrag == 7)
{
joueSon({nomSon:"01_NO_B",actionFin:"RIEN"});
}
else if(this.pDrag == 8)
{
joueSon({nomSon:"01_NO_A",actionFin:"RIEN"});
}
else if(this.pDrag >= 5)
{
joueSon({nomSon:"01_NO_A",actionFin:"RIEN"});
}
else
{
_root.countSondes += 1;
this._visible = 0;
_root.gotoAndStop("01_" + gimme2digits(this.pDrag) + "_OK_A");
}
_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_ = _loc3_ + 1;
}
}
};
i++;
}