魔幻线flash

对duplicateMovieClip函数的应用。

第一帧:
i=1
max=120
setProperty(”0″,_visible,false)
第二帧:
duplicateMovieClip(i-1, i, i);
setProperty(i, _alpha, getProperty(i-1, _alpha)-0.1);
setProperty(i, _xscale, getProperty(i-1, _xscale)+5);
setProperty(i, _y, getProperty(i-1, _y)+0.9);
setProperty(i, _rotation,random(721) );
i = i+1;

第三帧:
if (i<=max) {
gotoAndPlay(2);
} else {
gotoAndPlay(1);
}

Tags:, ,

相关日志

 

学痞网logo2

用了随机函数:

gotoAndStop(random(11));

Tags:, , ,

相关日志

 

学痞网logo1

看完整大小

看完整大小

其中云朵的as是:
getURL(”FSCommand:allowscale”, false);
–_root.y1._x;
if (y1._x < -50)
{
_root.y1._x = 838;
} // end if
_root.y2._x = _root.y2._x - 1 + 3.333333E-001;
if (y2._x < -30)
{
_root.y2._x = 838;
} // end if
_root.y3._x = _root.y3._x - 1 + 6.666667E-001;
if (y3._x < -20)
{
_root.y3._x = 800;
} // end if
_root.y4._x = _root.y4._x - 1 + 8.500000E-001;
if (y4._x < -110)
{
_root.y4._x = 830;
} // end if
_root.y5._x = _root.y5._x - 1 + 9.200000E-001;
if (y5._x < -90)
{
_root.y5._x = 850;
}

Tags:, , ,

相关日志

 

小球反弹

小球在房间里反弹,发声,片头有loading等等。

完整大小观看

第一帧:
a = getBytesTotal();
b = getBytesLoaded();
c = int(b / a * 100);
loader.gotoAndPlay(int(c));

第二帧:
if (c >= 100)
{
gotoAndPlay(4);
}
else
{
gotoAndPlay(1);
} // end else if

Tags:, , ,

相关日志

 

random(数字)

需要注意的是random(1)产生的是数字0,而不是1,因为random()产生的是由0到数字减一的效果。例如random(10)产生的实际上是0~9的数字。

实际中我们经常要用到一定范围的随机数,例如15~25之间的随机数,这样该怎么写呢?
具体思路是这样的,25减15等于10;而10的随机数是0~9之间,random(10)+15反应的是15~24之间的数字;因此正确的写法为a=random(10+1)+15;赋值给a。

Tags:, , ,

相关日志

Page 1 of 11