当前位置: 首页 > 图文教程 > Flash动画 > Flash动画制作 > 极坐标在绘画方法中的运用

Flash动画制作
使用SetMask脚本制作沿路径运动的遮罩实例
Flash MX 2004 ActionScript图文教程(一)
拖出你的精彩:Flash MX课件中的拖动
Flash实例教程:鱼戏莲叶间
Flash MX pro的历史面板(一)
Flash MX pro的历史面板(二)
Flash MX pro的历史面板(三)
Flash常见问题解答集锦(1)
Flash MX行为功能初体验:相册的制作
Flash MX04文字特效:残影动画(图)
Flash游戏制作常用代码解析(图)
在Flash中巧妙替换字体
用FlashMX制作拖动悬浮窗口
让Flash课件在VCD上播放
PowerPoint中插入Flash动画的方法
使用Flash mx制作旋转的时钟效果
用Flash制作动感火焰字
Flash Mx使用技巧十二则
用Flash MX制作新年贺卡
Flash那样动感十足制作PPT按钮跟我来

Flash动画制作 中的 极坐标在绘画方法中的运用


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-22   浏览: 36 ::
收藏到网摘: n/a


话不多说,参考代码中的注释
var pice = 8;
//瓣数
var amp = 180;
//半径
x0 = 550/2;
//中心X坐标
y0 = 400/2;
//中心Y坐标
degree = 0;
//初始角
speed = 2;
//画线速度
colorF = 0xFF0000;
//线条颜色
_root.createEmptyMovieClip("flower", 1);
//创建MC
with (flower) {
   flower.moveTo(x0+amp, y0);
   //移动起始点
   flower.lineStyle(3, colorF, 100);
   //定义线条样式
}
flower.onEnterFrame = function() {
   //开始画线
   if (degree<=360) {
      for (i=1; i<=speed; i++) {
         radian = Math.PI/180*(degree);
         p = amp*Math.cos(pice/2*radian);
         x = x0+p*Math.cos(radian);
         y = y0+p*Math.sin(radian);
         this.lineTo(x, y);
         degree++;
      }
   }
};