home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 July
/
CMCD0704.ISO
/
Software
/
Demo
/
elearn
/
Fizica
/
interfata.swf
/
scripts
/
frame_7
/
DoAction.as
Wrap
Text File
|
2004-05-12
|
2KB
|
79 lines
var mili = 20;
var maxInst = 9;
var min = 180;
var max = 660;
var pas = 20;
var i = 1;
while(i <= maxInst)
{
this["d" + i].initY = this["d" + i]._y;
i++;
}
var doTheDew = function(inst, calea)
{
calea.hideThe.cursor(true);
txt = new String(inst);
var excludedInst = Number(txt.slice(1));
initYexcludedInst = calea["d" + excludedInst]._y;
gata = true;
if(calea["d" + excludedInst]._y > min)
{
calea["d" + excludedInst]._y += pas * -1;
gata = false;
}
excludedInst++;
var nextInst = excludedInst;
initYnextInst = calea["d" + nextInst]._y;
var j = nextInst;
while(j <= maxInst)
{
if(calea["d" + nextInst]._y < max)
{
calea["d" + j]._y += pas * 1;
gata = false;
}
j++;
}
if(gata)
{
clearInterval(intervalul);
excludedInst--;
calea["d" + excludedInst].play();
calea.hideThe.cursor(false);
}
};
var undoTheDew = function(inst, calea)
{
calea.hideThe.cursor(true);
txt = new String(inst);
var excludedInst = Number(txt.slice(1));
initYexcludedInst = calea["d" + excludedInst].initY;
gata = true;
if(calea["d" + excludedInst]._y < initYexcludedInst)
{
calea["d" + excludedInst]._y += pas * 1;
gata = false;
}
excludedInst++;
var nextInst = excludedInst;
initYnextInst = calea["d" + nextInst].initY;
var j = nextInst;
while(j <= maxInst)
{
if(calea["d" + nextInst]._y > initYnextInst)
{
calea["d" + j]._y += pas * -1;
gata = false;
}
j++;
}
if(gata)
{
clearInterval(intervalul);
excludedInst--;
calea["d" + excludedInst].play();
calea.hideThe.cursor(false);
}
};
stop();