达达首页 | 设计教程 | 辅助工具 | 字体字库 | 素材贴图 | 非 主 流 | PS 笔刷 | 签名模版 | 网页模版 | 达达贴吧
设为首页

加入收藏

联系我们
PhotoShop 教程 | Illustrator 教程 | CorelDraw 教程 | FireWorks 教程 | 3D MAX 教程 | MAYA 教程 | Flash 教程 | After Effects 教程
相关教程
普通教程 Flash声音控制教程
普通教程 利用FLASH脚本语言制…
普通教程 Flash电子书鼠标拖拽…
普通教程 纯脚本的鼠标跟随效…
普通教程 利用遮罩实现的红旗…
普通教程 Adobe flash cs3 Ac…
普通教程 FLASH的动态文本如何…
普通教程 Flash ActionScript…
普通教程 FLASH 实现动态模糊…
普通教程 最常用的Flash语句
最新更新

Adobe flash cs3 …

FLASH的动态文本如…

由浅入深学习Flas…

用Flash AS三行代…
您现在的位置: 达达派 >> 教程中心 >> FLASH教程 >> 代码篇 >> 教程正文
利用FLASH脚本语言制作上升的水泡效果
作者:黑市魔旗 文章来源:天使梦工厂 点击数: 更新时间:2006-6-3 15:37:51
教程录入:carcass    责任编辑:雷公藤  添加到雅虎收藏+

先来看效果:


http://www.qq12345.cn/bbs/UploadFile/2006-1/200611811292875258.swf


让我们再来看代码:

po._visible = false;
var 水泡数量:Number = 30;
网址.onRollOver = function() {
getURL("http://www.qq12345.cn", _parent);
};
onLoad = function () {
for (var i = 0; i<水泡数量; i++) {
  duplicateMovieClip("po", "po"+i, 3*i);
  with (this["po"+i]) {
   _x = Math.floor(Math.random()*Stage.width);
   _y = Math.floor(Math.random()*Stage.height);
   _xscale = _yscale=Math.floor(Math.random()*i+20);
   this["泡泡运动速度"+i] = (i+10)/10;
   this["po_x"+i] = getProperty(this["po"+i], _x);
   this["e"+i] = 0;
  }
}
};
onEnterFrame = function () {
for (var k = 0; k<水泡数量; k++) {
  with (this["po"+k]) {
   _y -= this["泡泡运动速度"+k];
   _x = this["po_x"+k]+(k+40)*Math.cos(this["e"+k]/15);
   this["e"+k] += (k+1)/20;
   swapDepths(_y);
   if (_y<-_width) {
    _y = Stage.height+_width;
   }
   if (_x>Stage.width+_width/2) {
    _x = -_width/2;
   } else if (_x<-_width/2) {
    _x = Stage.width+_width/2;
   }
  }
}
};

不错吧?下边是源文件:

源文件下载

  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    关于我们 | 帮助(?) | 广告服务 | 版权声明 | 商业合作 | 发展历程 | 联系我们

    Copyright ? 2005-2008 CGFancy.com, All Rights Reserved,达达网络:陕ICP备06010337号

    技术交流:71125455(平面)、545534707(三维),业务合作:71125455