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; } }; }; } |