?? 爆炸.sqe
字號:
========== Description Part Begin ==========
name = "爆炸";
description = "所選實例逐漸顯示,先聚在一起,然后向四周散開,仿佛爆炸一樣。";
version = "1.00";
bin = "Explode.bin";
========== Description Part End ==========
========== Parameter Part Begin ==========
$nCharacterCount(EDIT,INT,1,1 10000,"實例總數 ","指的是使用了該特效的實例的總數。這個值是由影片里所選中的實例數決定的,在這里不能設置。");
$nFrameCount(EDIT,INT,7,7 7,"總幀數","指的是含有動作代碼的總幀數。特效播放的總幀數可能比動作代碼的幀數多。");
$nMoveSpeed(EDIT,INT,10,0 1000,"移動速度","實例的移動速度。");
$nScaleSpeed(EDIT,INT,3,0 1000,"縮放速度","實例的縮放速度。");
$nAlphaSpeed(EDIT,INT,2,0 1000,"透明度變化速度","實例的透明度變化速度。");
========== Parameter Part End ==========
========== Function Part Begin ==========
nCharacterCount = 12;
nFrameCount = 10;
nMoveSpeed = 10;
nAlphaSpeed = 2;
nScaleSpeed = 3;
bMode = true;
nRotateArray = new Array(nCharacterCount);
nRadiusArray = new Array(nCharacterCount);
nTestCentreX = c1._x + (this["c" + nCharacterCount]._x - c1._x)/2;
nCentreX = nTestCentreX;
nTestCentreY = c1._y + (this["c" + nCharacterCount]._y - c1._y)/2;
nCentreY = nTestCentreY;
nOldPosX = new Array(nCharacterCount);
nOldPosY = new Array(nCharacterCount);
nOriginalSizeX = new Array(nCharacterCount);
nOriginalSizeY = new Array(nCharacterCount);
for(i = 1;i <= nCharacterCount;i++)
{
nRotateArray[i - 1] = random(360);
nRadiusArray[i - 1] = 1;
nOldPosX[i - 1] = this["c" + i]._x;
nOldPosY[i - 1] = this["c" + i]._y;
nOriginalSizeX[i - 1] = this["c" + i ]._xscale;
nOriginalSizeY[i - 1] = this["c" + i ]._yscale;
this["c" + i]._alpha = 0;
}
function fun()
{
for(i = 1;i <= nCharacterCount;i++)
{
this["c" + i]._alpha += nAlphaSpeed;
if( this["c" + i]._alpha > 100)
this["c" + i]._alpha = 100;
}
if( this["c" + nCharacterCount]._alpha == 100)
{
gotoAndPlay(4);
}
}
function shrink()
{
for (i = 1;i <= nCharacterCount; i++)
{
if(this["c" + i]._x != nCentreX)
if(this["c" + i]._x < nCentreX)
{
this["c" + i]._x += nMoveSpeed;
if(this["c" + i]._x > nCentreX)
this["c" + i]._x = nCentreX;
}
else
{
this["c" + i]._x -= nMoveSpeed;
if(this["c" + i]._x < nCentreX)
this["c" + i]._x = nCentreX;
}
}
if( Math.round(nCentreX) == Math.round(this["c" + nCharacterCount]._x))
gotoAndPlay(6);
}
function shrinkAgain()
{
gotoAndPlay(4);
}
function Explode()
{
for (i = 1; i <= nCharacterCount; i++)
{
this["c" + i]._x = Math.cos(Math.PI / 180 * nRotateArray[i -1]) * nRadiusArray[i - 1] + nCentreX;
this["c" + i]._y = Math.sin(Math.PI / 180 * nRotateArray[i -1]) * nRadiusArray[i - 1] + nCentreY;
this["c" + i]._alpha -= nAlphaSpeed;
this["c" + i]._xscale += nScaleSpeed;
this["c" + i]._yscale += nScaleSpeed;
nRadiusArray[i -1] += nMoveSpeed;
}
if(this["c" + nCharacterCount]._alpha < 0)
resume();
}
function resume()
{
for (i = 1; i <= nCharacterCount; i++)
{
this["c" + i]._xscale = 100;
this["c" + i]._yscale = 100;
this["c" + i]._x = nOldPosX[i -1];
this["c" + i]._y = nOldPosY[i -1];
this["c" + i ]._xscale = nOriginalSizeX[i - 1] ;
this["c" + i ]._yscale = nOriginalSizeY[i - 1];
}
gotoAndPlay(1);
}
function again()
{
gotoAndPlay(2);
}
function againExplode()
{
gotoAndPlay(6);
}
========== Function Part End ==========
========== Frame Part Begin ==========
$frame(fun,1,-1,"fun");
$frame(fun,2,-1,"fun");
$frame(again,3,-1,"again");
$frame(shrink,4,-1,"fadeout");
$frame(shrinkAgain,5,-1,"Shrink again");
$frame(Explode,6,-1,"Shrink again");
$frame(againExplode,7,-1,"Shrink again");
========== Frame Part End ==========
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -