快精灵印艺坊 您身边的文印专家
广州名片 深圳名片 会员卡 贵宾卡 印刷 设计教程
产品展示 在线订购 会员中心 产品模板 设计指南 在线编辑
 首页 名片设计   CorelDRAW   Illustrator   AuotoCAD   Painter   其他软件   Photoshop   Fireworks   Flash  

 » 彩色名片
 » PVC卡
 » 彩色磁性卡
 » 彩页/画册
 » 个性印务
 » 彩色不干胶
 » 明信片
   » 明信片
   » 彩色书签
   » 门挂
 » 其他产品与服务
   » 创业锦囊
   » 办公用品
     » 信封、信纸
     » 便签纸、斜面纸砖
     » 无碳复印纸
   » 海报
   » 大篇幅印刷
     » KT板
     » 海报
     » 横幅

触鼠感应的loadMoive框框缩放教程

今天研究了一个做FLASH网站常常会用到的效果,即点击不同的按钮,主场景用来loadMovie的框框的X,Y,H,W值也随着变化。

  演示效果动画:

http://www.flash8.net/bbs/UploadFile/2005-7/200571519313467.swf

« Full Screen »

点击这里下载源文件


主要代码如下:
stageWidth = 800;
stageHeight = 600;
wmodifier = 400;
hmodifier = 150;
bounce = 0.700000;
speed = 9;
expand = function (id){
this.destwidth = wmodifier;
this.poswidth = id._width;
this.velwidth = this.velwidth * bounce + (this.destwidth - this.poswidth) / speed;
id._width = id._width + Math.round(this.velwidth);
this.destheight = hmodifier;
this.posheight = id._height;
this.velheight = this.velheight * bounce + (this.destheight - this.posheight) / speed;
id._height = id._height + Math.round(this.velheight);
this.destx = (stageWidth - wmodifier) / 2;
this.posx = id._x;
this.velx = this.velx * bounce + (this.destx - this.posx) / speed;
id._x = id._x + Math.round(this.velx);
this.desty = (stageHeight - hmodifier) / 2;
this.posy = id._y;
this.vely = this.vely * bounce + (this.desty - this.posy) / speed;
id._y = id._y + Math.round(this.vely);
shadow._width = color_kuai._width + 20;
shadow._x = color_kuai._x - 10;
shadow._height = color_kuai._height + 20;
shadow._y = color_kuai._y - 10;
};
color_kuai.onEnterFrame = function (){
expand(this);
};
stop();

  源文件里面有具体的说明。
返回类别: Flash教程
上一教程: 初学者的FLASH基础教程
下一教程: Flash中FLV流媒体使用技巧

您可以阅读与"触鼠感应的loadMoive框框缩放教程"相关的教程:
· FlashMX 视频教程(18)-缩放工具的使用
· Flash视频教程:缩放工具
· 键盘感应的Flash动画的制作方式
· FlashMX 视频教程(42)-制作按钮
· Flash绘画技巧:对象绘制思路[Flash视频教程]
    微笑服务 优质保证 索取样品