spya ahad ini tidak habes begitu sajerh..aku cuber menyettlekan dis lil scripting b4 i sleep..actually dis is da new template scripting for da new product website. actually aku da minum nescafe td dgn harapan aku tido lmbt menyiapkan kjr2 tertangguh ni..but end up i just staring at it.my pc very slow la.grrr.
_global.slidingMenu = this;
big_height = 260;
small_height = 42;
small_height_over = 20;
time_for_animation = 20;
time_for_animation2 = 25;
box1.id = 1;
box2.id = 2;
box3.id = 3;
box4.id = 4;
var i = 1;
while (i <= 4)
{
this["box" + i].area.onRelease = function ()
{
slidingMenu.moveBoxes(this._parent.id);
};
this["box" + i].area.onRollOver = function ()
{
slidingMenu.RollOverBoxes(this._parent.id);
};
this["box" + i].area.onRollOut = this["box" + i].area.onReleaseOutside = function ()
{
slidingMenu.RollOutBoxes(this._parent.id);
};
++i;
} // end while
slidingMenu.RollOverBoxes = function (boxNumber)
{
if (_root.link != boxNumber)
{
var cBox = eval("box" + boxNumber);
cBox.title_main.gotoAndPlay("s1");
var i = 1;
while (i <= 4)
{
var cBox = eval("box" + i);
ykoord = cBox.my_y;
if (i != boxNumber)
{
if (i <>
{
new mx.transitions.Tween(cBox, "_y", mx.transitions.easing.Back.easeOut, cBox._y, ykoord - small_height_over, time_for_animation2, false);
cBox.my_y = ykoord - small_height_over;
}
else
{
new mx.transitions.Tween(cBox, "_y", mx.transitions.easing.Back.easeOut, cBox._y, ykoord + small_height_over, time_for_animation2, false);
cBox.my_y = ykoord + small_height_over;
} // end if
} // end else if
++i;
} // end while
} // end if
};
slidingMenu.RollOutBoxes = function (boxNumber)
{
if (_root.link != boxNumber)
{
var cBox = eval("box" + boxNumber);
cBox.title_main.gotoAndPlay(cBox.title_main._totalframes - cBox.title_main._currentframe);
var i = 1;
while (i <= 4)
{
var cBox = eval("box" + i);
ykoord = cBox.my_y;
if (i != boxNumber)
{
if (i <>
{
new mx.transitions.Tween(cBox, "_y", mx.transitions.easing.Back.easeOut, cBox._y, ykoord + small_height_over, time_for_animation2, false);
cBox.my_y = ykoord + small_height_over;
}
else
{
new mx.transitions.Tween(cBox, "_y", mx.transitions.easing.Back.easeOut, cBox._y, ykoord - small_height_over, time_for_animation2, false);
cBox.my_y = ykoord - small_height_over;
} // end if
} // end else if
++i;
} // end while
} // end if
};
slidingMenu.moveBoxes = function (boxNumber)
{
if (_root.link != boxNumber)
{
k = 1;
var i = 1;
while (i <= 4)
{
var cBox = eval("box" + i);
if (i == boxNumber)
{
_root.link_prev = _root.link;
_root.link = boxNumber;
cBox.pages.gotoAndPlay("s1");
cBox.title_main.gotoAndPlay("s2");
var cBox2 = eval("box" + _root.link_prev);
cBox2.pages.gotoAndPlay(cBox2.pages._totalframes - cBox2.pages._currentframe);
_root.scroller.gotoAndStop(2);
} // end if
if (i <= boxNumber)
{
new mx.transitions.Tween(cBox, "_y", mx.transitions.easing.Regular.easeOut, cBox._y, k * small_height - 110, time_for_animation, false);
cBox.my_y = k * small_height - 110;
}
else
{
new mx.transitions.Tween(cBox, "_y", mx.transitions.easing.Regular.easeOut, cBox._y, k * small_height + big_height - 80, time_for_animation, false);
cBox.my_y = k * small_height + big_height - 80;
} // end else if
++k;
++i;
} // end while
} // end if
};
mari kiter mengetest n mengerror.
Her book - 365 days with the Prophet Muhammad
11 years ago

0 comments:
Post a Comment