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

📄 移动翻转.sqe

📁 flash文档文档文档文档文档文档文档文档文档文档文档文档
💻 SQE
字号:
========== Description Part Begin ==========
name = "移动翻转";
description = "当实例移动到各自的目的时才开始翻转。";
version = "1.00";
bin = "overturning.bin";
========== Description Part End ==========

========== Parameter Part Begin ==========
$nCharacterCount(EDIT,INT,1,1 10000,"实例总数","指的是使用了该特效的实例的总数。这个值是由影片里所选中的实例数决定的,在这里不能设置。");
$nFrameCount(EDIT,INT,3,3 3,"总帧数","指的是含有动作代码的总帧数。特效播放的总帧数可能比动作代码的帧数多。");

$nInterval(EDIT,INT,5,1 1000,"时间间隔","前一个实例和后一个实例开始移动的时间间隔。");
$nSpeed(EDIT,INT,10,1 10000,"移动速度","实例的移动速度。");
$nLeft(EDIT,INT,-100,-1000 10000,"左","左起始点的位置。");
$nRight(EDIT,INT,500,1 10000,"右","右起始点的位置。");
$bDirection(LIST,INT,1,"左":1 "右":0,"方向","控制实例从左到右,或从右到左进入影片。");
========== Parameter Part End ==========

========== Function Part Begin ==========
nCharacterCount = 8;
nFrameCount   = 30;
nInterval = 5;
nSpeed = 10;
nLeft = 0;
nRight = 500;
bDirection = true;


nIsRun = new Array(nCharacterCount + 1);
nXArray = new Array(nCharacterCount);
nOriginalSizeX = new Array(nCharacterCount);
nOriginalSizeY = new Array(nCharacterCount);



for (i = 1; i <= nCharacterCount ; i++)
{
	nOriginalSizeX[i - 1] = this["c" + i ]._xscale;
	nOriginalSizeY[i - 1] = this["c" + i ]._yscale;

	nXArray[i -1] = 	this["c" + i]._x;
	this["c" + i]._xscale = this["c" + i]._xscale * -1;
	if(bDirection)
		this["c" + i]._x = nLeft;
	else
		this["c" + i]._x = nRight;
	this["c" + i]._alpha = 10;
	this["c" + i]._visible = false;
	
}




for (i = 1; i <= nCharacterCount  + 1; i++)
{
	if(bDirection)
	{
		if(i == 1)
			nIsRun[0] = 0;
		else
		{
			nIsRun[i - 1] = nIsRun[i - 2];
			nIsRun[i - 1] += nInterval;
		}
	}
	else
	{
		if(i == 1)
			nIsRun[nCharacterCount -1] = 0;
		else
		{
			nIsRun[nCharacterCount - i] = nIsRun[nCharacterCount - (i -1) ];
			nIsRun[nCharacterCount - i] += nInterval ;
		}
		
	}

}





function fun()
{

	for (i = 1;i <= nCharacterCount ; i++)
    {
		
		if(nIsRun[i - 1] < 0)
		{
			this["c" + i]._visible = true;
			if(bDirection)
			{
				this["c" + i]._x +=  nSpeed;
				if(this["c" + i]._x >=  nXArray[i -1])
				{
					this["c" + i]._x =  nXArray[i -1];
					if(this["c" + i]._xscale < nOriginalSizeX[i - 1])
						this["c" + i]._xscale += nSpeed;
					this["c" + i]._alpha += 2;
					continue;
				}
				

			}
			else
			{
				this["c" + i]._x -=  nSpeed;
				if(this["c" + i]._x <  nXArray[i -1])
				{
					this["c" + i]._x =  nXArray[i -1];
					if(this["c" + i]._xscale < nOriginalSizeX[i - 1])
						this["c" + i]._xscale += nSpeed;
					this["c" + i]._alpha += 2;
					continue;
				}
				
			
			}
			
		}
		nIsRun[i -1]--;
	}
	
	
	if(bDirection)
	{
		if(this["c" + nCharacterCount]._xscale >= nOriginalSizeX[nCharacterCount - 1])
		{
			if(this["c" + nCharacterCount]._x >=  nXArray[nCharacterCount -1])
			{
				for (i = 1; i <= nCharacterCount ; i++)
				{
					 this["c" + i]._x = nXArray[i -1];
				}
			
				gotoAndPlay(1);
			}
		}
	}
	else
	{
		if(this["c" + 1]._xscale >= nOriginalSizeX[i - 1])
		{
			if(this["c" + 1]._x <=  nXArray[0])
			{
				for (i = 1; i <= nCharacterCount ; i++)
				{
					 this["c" + i]._x = nXArray[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 + -