📄 散开5.sqe
字号:
========== Description Part Begin ==========
name = "散开5";
description = "实例各自分离出阴影,他们向随机的方向移动,直至消失。";
version = "1.00";
bin = "scattering5.bin";
========== Description Part End ==========
========== Parameter Part Begin ==========
$nCharacterCount(EDIT,INT,1,1 10000,"实例总数","指的是使用了该特效的实例的总数。这个值是由影片里所选中的实例数决定的,在这里不能设置。");
$nFrameCount(EDIT,INT,3,3 3,"总帧数","指的是含有动作代码的总帧数。特效播放的总帧数可能比动作代码的帧数多。");
$nInterval(EDIT,INT,5,1 10000,"时间间隔","前一个实例和后一个实例开始移动的时间间隔。");
$AlphaChangeSpeed(EDIT,INT,10,1 10000,"透明度变化速度","实例的透明度变化速度。");
$nSpeed(EDIT,INT,10,1 10000,"速度","实例的散开速度。");
========== Parameter Part End ==========
========== Function Part Begin ==========
nCharacterCount = 16;
nFrameCount = 8;
nSpeed = 8;
AlphaChangeSpeed = 5;
nInterval = 5;
nCentreXArray = new Array(nCharacterCount );
nCentreYArray = new Array(nCharacterCount );
nIsRun = new Array(nCharacterCount );
nRotateArray = new Array(nCharacterCount);
nRadiusArray = new Array(nCharacterCount);
for( i = 1; i <= nCharacterCount; i++)
{
this["c" + i]._alpha = 100;
this["c" + i]._rotation = 0;
nCentreXArray[i -1] = this["c" + i]._x;
nCentreYArray[i -1] = this["c" + i]._y;
nRotateArray[i - 1] = random(360);
nRadiusArray[i - 1] = 2;
if(i == 1)
nIsRun[0] = 0;
else
{
nIsRun[i - 1] = nIsRun[i - 2];
nIsRun[i - 1] += nInterval;
}
}
for(i = 1;i <= nCharacterCount ;i++)
{
nIndex = nCharacterCount + i;
this["c" + i].duplicateMovieClip("c"+nIndex, nIndex);
this["c" + nIndex]._alpha = 50;
this["c" + nIndex]._visible = false;
}
function fun()
{
for (i = 1; i <= nCharacterCount; i++)
{
if(nIsRun[i -1] < 0)
{
nIndex = nCharacterCount + i;
this["c" + nIndex]._visible = true;
this["c" + nIndex]._x = Math.cos(Math.PI / 180 * nRotateArray[i -1]) * nRadiusArray[i - 1] + nCentreXArray[i -1];
this["c" + nIndex]._y = Math.sin(Math.PI / 180 * nRotateArray[i -1]) * nRadiusArray[i - 1] + nCentreYArray[i -1];
if(this["c" + i]._alpha > 50)
this["c" + i]._alpha = 50;
this["c" + i]._alpha -= AlphaChangeSpeed;
this["c" + nIndex]._alpha -= AlphaChangeSpeed;
nRadiusArray[i -1] += nSpeed;
}
nIsRun[i -1] -= 2;
}
for (i = 1; i <= nCharacterCount; i++)
{
if(this["c" + i]._alpha >= 0)
return;
}
for (i = 1; i <= nCharacterCount; i++)
{
this["c" + i]._x = nCentreXArray[i -1];
this["c" + i]._y = nCentreYArray[i -1];
gotoAndPlay(1);
}
}
function again()
{
gotoAndPlay(2);
}
========== Function Part End ==========
========== Frame Part Begin ==========
$frame(fun,1,-1,"fun");
$frame(fun,2,-1,"fun");
$frame(again,3,-1,"again");
========== Frame Part End ==========
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -