亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

用Flash AS代碼制作鼠標(biāo)點(diǎn)擊圖片緩沖放縮動畫效果

  發(fā)布時間:2014-10-20 16:07:03   作者:佚名   我要評論
下面小編為大家介紹利用Flash AS代碼制作鼠標(biāo)點(diǎn)擊圖片緩沖放縮動畫效果,教程比較簡單,也很好了解,推薦過來,一起來看看吧
 本文中我們用用Flash AS代碼制作鼠標(biāo)點(diǎn)擊圖片緩沖放縮動畫效果實(shí)例:按下鼠標(biāo)拖動圖片,圖片會緩沖放大并移到最前面,松開鼠標(biāo)停止拖動圖片緩沖縮小。教程很不錯,難度也不是很大,一起來學(xué)習(xí)吧!

  效果如下。


用鼠標(biāo)點(diǎn)擊圖片并拖動,您將看到圖片緩沖放縮效果

  Flash中制作步驟:

  先在Flash中導(dǎo)入幾張圖片,分別轉(zhuǎn)為影片元件,拖到主場景,實(shí)例名分別為pic0_mc、pic1_mc、pic2_mc……

  在幀上寫如下代碼:


復(fù)制代碼
代碼如下:
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;
}
};
};
}

  以上就是用Flash AS代碼制作鼠標(biāo)點(diǎn)擊圖片緩沖放縮動畫效果過程,希望對大家有所幫助!

相關(guān)文章

最新評論