flash中用脚本控制图片的问题

来源:百度知道 编辑:UC知道 时间:2024/06/09 21:13:53
在falsh中,我放置了好几张图片,我想点击某图片,图片可以聚中放大,再点一下图片可以退回原图,如何用语句来实现?
请高手指点.

如果你想简单点的话,请将图片的注册点放在中心
然后图片的影片名叫img
做好上面操作后

import mx.transitions.Tween;(这类可以查看帮助)
img.pressed=true
img.onRelease=function(){
if(this.pressed){
//放大
var myTween:Tween = new Tween(this, "_xscale", mx.transitions.easing.Elastic.easeOut, this._xscale, 150, 1, true);
}else{
//缩小
var myTween:Tween = new Tween(this, "_xscale", mx.transitions.easing.Elastic.easeOut, this._xscale, 100, 1, true);

}
this.pressed=!this.pressed
}

用按钮来实现这个效果应该容易一些了。

简单也简单,难也难的啊.

用TweenEvent吧.简单些.