FLASH中用鼠标点击图片放大然后鼠标变手形拖动

来源:百度知道 编辑:UC知道 时间:2024/09/21 22:54:44
一张很大的图片放在页面放不下,就想把它缩小了放在上面 但是看的不是太清楚。 就想做鼠标点击放大的效果 放大之后鼠标可以变手形 拖动可以看清楚图片局部部分 再点击鼠标的时候就返回放大前的样子 如果需要添加代码 麻烦可以写的清楚点不?代码部分不是很懂!分数可以追加的
应该在什么地方加那段代码啊?需要建什么元件吗?

点击图片变大代码for (var d:Number = 0; d<=2; d++) {
this["pic"+d+"_mc"].onPress = function() {
mx.behaviors.DepthControl.bringToFront(this);//移到最前
startDrag(this);
this.onEnterFrame = function() {
this._xscale += (200-this._xscale)/4;//缓冲放大
this._yscale += (200-this._yscale)/4;
if (this._xscale>=200) {
delete this.onEnterFrame;
}
};
};
this["pic"+d+"_mc"].onRelease = function() {
stopDrag();
this.onEnterFrame = function() {
this._xscale -= (this._xscale-100)/4;//缓冲缩小
this._yscale -= (this._yscale-100)/4;
if (this._xscale<=100) {
delete this.onEnterFrame;
}
};
};
}