⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 爆炸.sqe

📁 flash文档文档文档文档文档文档文档文档文档文档文档文档
💻 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 + -