应一个CSDN网友制作的百分比旋转。

      5iFLASH 2005-1-4 14:1

Flash 动画

画一直线宽度为4,按F8转为元件(注意注册点为左),实例名称为“l_mc"。然后添加一动态文本实例名称为“t_txt”。最后画一圆,做为背景。在第一桢上输入:

i = 270;//直线的初始位置(270度)
degree = 360;//指旋转360度。
l_mc._visible = false;
onEnterFrame = function () {
    if (i<(270+degree)) {
        l_mc.duplicateMovieClip("g"+i, i);
        _root["g"+i]._rotation = i;
        i += 2;    // 2可改为1或3 速度相应的发现改变。
        t_txt.text = Math.round((i-270)/degree*100)+"%";// 统计百分比。
    }
};

最后Ctrl+Enter即可。

源码地址:http://free.efile.com.cn/biku/百分比旋转.fla
标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}