当前位置: 首页 > 图文教程 > Flash动画 > Flash动画制作 > Flash教程:AS数学课件—推导三角形面积

Flash动画制作
Flash5键盘鼠标应用(二)
Freehand和Flash的结合应用(4)
Flash5 有声音的三眼狼(二)
Freehand和Flash的结合应用(7)
Freehand和Flash的结合应用(10)
Freehand和Flash的结合应用(12)
Flash5 位移操作(二)
Flash5制作水波倒影效果(二)
Flash5任意两点间随机画线(三)
Flash 神奇遮罩之原理篇(3)
Flash 神奇遮罩之动态篇
Flash 神奇遮罩之图片篇(1)
Flash MX 视频导入功能详解(5)
利用Flash MX模板制作XML动态菜单(1)
用动作脚本动态创建和控制文本框 (6)
FW MX和Flash MX的亲密合作(2)
FW MX和Flash MX的亲密合作(5)
Flash中音量和左右声道平衡的控制(2)
Flash MX的AS绘图和时间控制 下
Flash5 有声音的三眼狼(四)

Flash动画制作 中的 Flash教程:AS数学课件—推导三角形面积


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

[思路]

先创建一个三角形,然后复制一个并旋转移动与原图拼成一个平行四边形,平行四边形面积=底×高,所以三角形面积=底×高÷2。

[演示]

看不到动画效果的朋友请去这里观看:http://bbs.ruanchen.com/"gadspro">

[过程]

1、创建一个影片剪辑,在帧上写如下代码:

 this.createEmptyMovieClip("sjx0", 1);
with (sjx0) {
lineStyle(2, 0x000000);
beginFill(0xFF0000);
moveTo(0, 0);
lineTo(0, 0);
lineTo(60, 100);
lineTo(-100, 100);
}
duplicateMovieClip(sjx0, "sjx1", 2);
sjx1._x = 0;
sjx1._y = 0;
my_txt.text = "";
sjx1.onEnterFrame = function() {
delete this.onRelease;
if (this._rotation<180) {
  this._rotation += 5;
} else {
  this._rotation += 0;
  if (this._y<100) {
   this._y += 5;
   this._x += 3;
  }
  if (this._y == 100) {
   this._y += 0;
   this._x += 0;
   createTextField("my_txt", 3, 50, 20, 80, 20);
   my_txt.text = "点击重来";
   my_txt.selectable = false;
   my_txt.autoSize = true;
   my_txt.textColor = 0xFFFFFF;
   this.onRelease = function() {
    my_txt.text = "";
    this._x = 0;
    this._y = 0;
    this._rotation = 0;
   };
  }
}
};

2、把上面元件拖入到主场景中合适的位置。