home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 127
/
MOBICLIC127.ISO
/
mac
/
DATA
/
DSS127
/
DSS127_01
/
DSS127_01.swf
/
scripts
/
frame_290
/
DoAction.as
Wrap
Text File
|
2010-09-13
|
8KB
|
265 lines
function initEtiDone()
{
var _loc2_ = 1;
while(_loc2_ <= 9)
{
if(listEtiDone[_loc2_ - 1] == 0)
{
this["ETI_" + gimme2digits(_loc2_)]._visible = 0;
}
else
{
this["ETI_" + gimme2digits(_loc2_)]._visible = 1;
this["ETI_" + gimme2digits(_loc2_)].gotoAndStop("E" + listEtiDone[_loc2_ - 1]);
}
_loc2_ = _loc2_ + 1;
}
}
function testValid()
{
if(listEtiDone.toString() == listOK.toString())
{
gotoAndStop("03_VALIDE_OK");
var _loc2_ = 0;
while(_loc2_ < listEtiDone.length)
{
_root["ETI_" + gimme2digits(_loc2_ + 1)].ANIM.gotoAndStop("E4");
_loc2_ = _loc2_ + 1;
}
}
else
{
gotoAndStop("03_VALIDE_NO");
_loc2_ = 0;
while(_loc2_ < listEtiDone.length)
{
if(listEtiDone[_loc2_] !== listOK[_loc2_])
{
listEtiDone[_loc2_] = 0;
_root["ETI_" + gimme2digits(_loc2_ + 1)]._visible = 0;
}
else
{
_root["ETI_" + gimme2digits(_loc2_ + 1)].ANIM.gotoAndStop("E4");
}
_loc2_ = _loc2_ + 1;
}
}
}
function initPhoto(hostClip, photo)
{
trace(hostClip);
trace(photo);
var _loc2_ = new MovieClipLoader();
_loc2_.addListener(mclListener);
myID = "I_" + gModuleName + "_" + photo;
trace(myID);
_loc2_.loadClip(_global.gModulePath + moduleInfo.getResourceById(myID).firstChild.attributes.src,hostClip);
}
stop();
initBT_X();
swfStocker["A_" + gModuleName + "_WIKI_ET"]._visible = 0;
var i = 1;
while(i <= 9)
{
this["ZONE_03_" + gimme2digits(i)].pZone = i;
this["ZONE_03_" + gimme2digits(i)].onRollOver = function()
{
gereCursor(2);
this.gotoAndStop("E2");
joueBruitage({nomSon:"B_03_PHOTO_ROLL"});
};
this["ZONE_03_" + gimme2digits(i)].onRollOut = function()
{
gereCursor(1);
this.gotoAndStop("E1");
stopBruitage({nomSon:"B_03_PHOTO_ROLL"});
};
this["ZONE_03_" + gimme2digits(i)].onPress = function()
{
gereCursor(1);
this.gotoAndStop("E1");
stopBruitage({nomSon:"B_03_PHOTO_ROLL"});
joueBruitage({nomSon:"B_03_PHOTO_CLIC"});
_root.gotoAndStop("03_" + gimme2digits(this.pZone));
};
i++;
}
if(listEtiDone == undefined)
{
listEtiDone = [0,0,0,0,0,0,0,0,0];
listOK = [1,2,1,1,2,1,1,2,1];
}
initEtiDone();
nbDrags = 2;
listCible = ["ZONE_03_01","ZONE_03_02","ZONE_03_03","ZONE_03_04","ZONE_03_05","ZONE_03_06","ZONE_03_07","ZONE_03_08","ZONE_03_09"];
dragClip = "ETIQUETTE";
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);
this.gotoAndStop("E2");
if(this.pDrag == 1)
{
joueBruitage({nomSon:"B_03_VRAI_ROLL"});
}
else
{
joueBruitage({nomSon:"B_03_FAUX_ROLL"});
}
}
};
this[dragClip + "_" + gimme2digits(i)].onRollOut = function()
{
if(_root.drag == undefined)
{
gereCursor(1);
this.gotoAndStop("E1");
if(this.pDrag == 1)
{
stopBruitage({nomSon:"B_03_VRAI_ROLL"});
}
else
{
stopBruitage({nomSon:"B_03_FAUX_ROLL"});
}
}
};
this[dragClip + "_" + gimme2digits(i)].onPress = function()
{
if(_root.drag == undefined)
{
gereCursor(1);
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);
if(this.pDrag == 1)
{
stopBruitage({nomSon:"B_03_VRAI_ROLL"});
joueBruitage({nomSon:"B_03_VRAI_DRAG"});
}
else
{
stopBruitage({nomSon:"B_03_FAUX_ROLL"});
joueBruitage({nomSon:"B_03_FAUX_DRAG"});
}
}
};
this[dragClip + "_" + gimme2digits(i)].onRelease = this[dragClip + "_" + gimme2digits(i)].onReleaseOutside = function()
{
if(_root.foundDrop == undefined)
{
joueBruitage({nomSon:"B_NO"});
}
else
{
if(_root.listEtiDone[_root.foundDrop] == 0)
{
if(this.pDrag == 1)
{
joueBruitage({nomSon:"B_03_VRAI_DROP"});
}
else
{
joueBruitage({nomSon:"B_03_FAUX_DROP"});
}
_root["ETI_" + gimme2digits(_root.foundDrop + 1)]._visible = 1;
}
else if(this.pDrag == 1)
{
joueBruitage({nomSon:"B_03_VRAI_DROP_2"});
}
else
{
joueBruitage({nomSon:"B_03_FAUX_DROP_2"});
}
_root.listEtiDone[_root.foundDrop] = this.pDrag;
_root["ETI_" + gimme2digits(_root.foundDrop + 1)].gotoAndStop("E" + this.pDrag);
_root["ETI_" + gimme2digits(_root.foundDrop + 1)].ANIM.gotoAndStop("E3");
}
this.swapDepths(this.origDepth);
this._x = this.origX;
this._y = this.origY;
_root.drag = undefined;
trace(_root.listEtiDone);
};
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++;
}
BT_VALID.onRollOver = function()
{
this.useHandCursor = 0;
if(getPos(listEtiDone,0) == -1)
{
gereCursor(2);
this.gotoAndStop("E2");
joueBruitage({nomSon:"B_BT_VALIDE_ROLL"});
}
};
BT_VALID.onRollOut = function()
{
if(getPos(listEtiDone,0) == -1)
{
gereCursor(1);
this.gotoAndStop("E1");
stopBruitage({nomSon:"B_BT_VALIDE_ROLL"});
}
};
BT_VALID.onPress = function()
{
if(getPos(listEtiDone,0) == -1)
{
gereCursor(1);
this.gotoAndStop("E1");
stopBruitage({nomSon:"B_BT_VALIDE_ROLL"});
joueBruitage({nomSon:"B_BT_VALIDE_CLIC"});
_root.testValid();
}
};