• 【设为首页】
  • 【收藏闪客居】
当前位置:主页>FLASH AS 编程>AS基础篇>FLASH类>文章内容
  • Tween类:图片缓动浏览效果
  • 来源:闪吧 作者:kamanco 2007-11-08 【
图片缓动浏览效果,用Tween类做的一个图片浏览效果。

//////////////////////////////////////////////////////////
/////////      Flash8.net- Kamanco
///////////////////////////////////////////////////////////

import mx.transitions.Tween;
//定义成函数,方便调用 
// 如果你还不是很清楚Tween类,请查看FLASH帮助文档-->组件语言参考-->Tween类
//可更改缓动函数做出更多的效果
function mcTween(mcID, WEnd,HEnd) {
var myTween:Tween = new Tween(eval(mcID), "_width", mx.transitions.easing.Back.easeOut, eval(mcID)._width, WEnd, 1, true);
var myTween:Tween = new Tween(eval(mcID), "_height", mx.transitions.easing.Back.easeOut, eval(mcID)._height, HEnd, 1, true);
}
// 按钮事件 这里写的比较烦锁 回头用数组试试  代码精练一下
mc.onPress=function(){
//注意 下面调用前的函数
mcTween(mc,250,300);
startDrag("mc");
//改变深度至Front 
mx.behaviors.DepthControl.bringToFront(this);
}
mc.onRelease=function(){
mcTween(mc,125,150);
stopDrag();
}
mc2.onPress=function(){
mcTween(mc2,250,300);
startDrag("mc2");
mx.behaviors.DepthControl.bringToFront(this);
}
mc2.onRelease=mc2.onRollOut=function(){
mcTween(mc2,125,150);
stopDrag();
}
mc3.onPress=function(){
mcTween(mc3,250,300);
startDrag("mc3");
mx.behaviors.DepthControl.bringToFront(this);
}
mc3.onRelease=mc3.onRollOut=function(){
mcTween(mc3,125,150);
stopDrag();
}


图片缓动浏览效果:

 

源文件下载: 图片缓动浏览效果.rar




上一篇:制作时钟[Date类]   下一篇:FLASH AS 类 :LoadCursor类
  • 用户名:新注册) 密码: 匿名评论
  • 评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规)


推荐内容
FLASH源文件

Copyright © 2006-2008 flashas.net All Rights Reserved.
网站内容咨询: admin#flashas.net (#为@) 联系QQ:40777822 浙ICP备06033001号
(本网站最佳浏览解析度为1024*768, 建议使用IE 6.0或以上版本浏览器。)