觸鼠感應的loadMoive框框縮放教程

來源:互聯網
上載者:User
感應|教程

今天研究了一個做FLASH網站經常會用到的效果,即點擊不同的按鈕,主情境用來loadMovie的框框的X,Y,H,W值也隨著變化。

  示範效果動畫:

http://www.flash8.net/bbs/UploadFile/2005-7/200571519313467.swf

點擊這裡下載源檔案


主要代碼如下:
stageWidth = 800;
stageHeight = 600;
wmodifier = 400;
hmodifier = 150;
bounce = 0.700000;
speed = 9;
expand = function (id){
this.destwidth = wmodifier;
this.poswidth = id._width;
this.velwidth = this.velwidth * bounce + (this.destwidth - this.poswidth) / speed;
id._width = id._width + Math.round(this.velwidth);
this.destheight = hmodifier;
this.posheight = id._height;
this.velheight = this.velheight * bounce + (this.destheight - this.posheight) / speed;
id._height = id._height + Math.round(this.velheight);
this.destx = (stageWidth - wmodifier) / 2;
this.posx = id._x;
this.velx = this.velx * bounce + (this.destx - this.posx) / speed;
id._x = id._x + Math.round(this.velx);
this.desty = (stageHeight - hmodifier) / 2;
this.posy = id._y;
this.vely = this.vely * bounce + (this.desty - this.posy) / speed;
id._y = id._y + Math.round(this.vely);
shadow._width = color_kuai._width + 20;
shadow._x = color_kuai._x - 10;
shadow._height = color_kuai._height + 20;
shadow._y = color_kuai._y - 10;
};
color_kuai.onEnterFrame = function (){
expand(this);
};
stop();
  源檔案裡面有詳細的說明。

相關文章

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。