Thursday, September 16, 2010

Teach you how to make bubble drift


Tools: flash mx 2004

Ideas:

1. Blistered about random _x is shaking, you can set a variable for the variable x coordinate within a certain period of random value, value, let _x trend variables move, move to the variable point, then the variable re-value, _x and then move towards variable. _x always move to the variable.
2. Using attachMovie to copy the bubble, bubbles with unloadMovie achieve unloading.
3. To frame for recycling in order to produce more bubbles.

Practice:

The first step: New file, length and width for the 300 脳 200, background white, frame rate set to 60, allowing a number of bubbles flowing move a little bit faster.

Step two: paint bubbles, save for the mc, called pao.

Step Three: Add a new mc, named pp_mc, and set the output connection, called pp, to attachmovie call.鍦╩c鐨勫満鏅腑鎷栧叆pao锛屽潗鏍囦互闇?娉℃场鍑虹幇鐨勫ぇ浣撹寖鍥翠负鍑嗭紝鎴戣鐨勬槸x=98,y=10锛宲p_mc闇?瀹炵幇娉℃场鐨勯殢鏈虹Щ鍔紝鎵?互锛岄?瀹歱ao锛屾墦寮?ction闈㈡澘銆?Code:
onClipEvent (load) (
聽 a = random(140)+10;
聽 //褰搈c杞藉叆鏃讹紝棰勮a鍙橀噺銆俛鍙橀噺鏄帶鍒舵场娉¤繍鍔ㄦ柟鍚戠殑锛屽a杩涜10鍒?50涔嬮棿鐨勯殢鏈哄彇鍊?br />)

onClipEvent (enterFrame) (
if (this._x>a) {銆??銆??銆??銆??銆??銆??銆?br />聽 this._x = int(this._x)-1;
聽 this._y -= 1;
聽 this._alpha -= 0.01;
聽 if (this._alpha == 0) {
聽聽聽 this.unloadMovie();
)
} else if (this._x聽聽 this._x = int(this._x)+1;
聽 this._y -= 1;
聽 this._alpha -= 0.01;
聽 if (this._alpha == 0) {
聽聽聽 this.unloadMovie();銆??//褰撻?鏄庡害涓?鏃讹紝鍗歌浇娉℃场
)

//浠ヤ笂涓や釜鎵ц璇彞涓紝绗竴鍙ヤ负this._x鍙栨暣杩欎竴鐐瑰緢鍏抽敭锛屽洜涓哄鏋滀笉灏忓績娉℃场鐨剎鍧愭爣涓嶆槸鏁存暟锛屽埌鏈?帴杩慳鐨勯偅涓?鏃讹紝x鎬绘槸鏃犳硶绛変簬a锛宊x锛?灏卞皬浜巃锛屼細鎵цxa鐨勮鍙ワ紝杩欎篃鏄垜鍒氬仛鏃舵场娉℃?鏄繍琛屼竴娆″氨鐩寸嚎涓婂崌鐨勫師鍥犮?

聽 } else {
聽聽聽 a = random(140)+10;
)
}//x=a鏃讹紝瀵筧閲嶆柊鍙栧?

銆??绗洓姝ワ細鍥炲埌鍦烘櫙锛屽湪绗竴甯т笂鍐欏涓嬩唬鐮?br />
j=0;
//璁惧畾鎺у埗寰幆浠ヤ究浜х敓澶氫釜娉℃场鐨勫彉閲?j

銆??绗簲姝ワ細鍦ㄧ浜屽抚鍐欏涓嬩唬鐮?br />
_root.attachMovie("pp", "pp"+j, j);
//浠庡簱閲屽鍒舵场娉?br />_root["pp"+j]._x = random(140)+10;
//涓烘场娉¤瀹歺鍧愭爣鍊硷紝杩欓噷鏄?0鍒?50涔嬮棿鐨勯殢鏈哄?
_root["pp"+j]._y = 200;
//璁惧畾y鍧愭爣鍊?br />_root["pp"+j]._xscale = random(70)+30;
//30%鍒?00%鐨勯殢鏈簒缂╂斁鍊糭root["pp"+j]._yscale = _root["pp"+j]._xscale;
//30%鍒?00%鐨勯殢鏈簓缂╂斁鍊?br />绗叚姝ワ細绗笁甯т唬鐮佸涓?br />if (j<10) {
聽 //杩欎釜鍒ゆ柇涓簀璧嬫渶澶у?
聽 j = j+1;
) Else (
j = 0;
聽 //褰搄锛?0鏃讹紝j杩斿洖0鍊?br />)
gotoAndPlay (2);

銆??鍦ㄦ渶鍒濆仛杩欎釜娉℃场鏃讹紝鎴戞病鏈変负j璁惧畾鏈?ぇ鍊硷紝璁﹋涓嶆柇绱姞锛屽鑷磗wf鏂囦欢鏋佸崰cpu璧勬簮锛屽叾瀹?0涓场娉″浜庢垜鍋氱殑杩欎釜鍑虹幇棰戠巼灏卞浜嗭紝j鍙互鏍规嵁瀹為檯鎯呭喌璁惧畾銆?br />
銆??濂戒簡锛屼綘涔熷彲浠ュ仛涓场娉′簡锛岃繕鏈変竴鐐瑰氨鏄紝鎴戜负浜嗚娉℃场涓嶈鍑哄緱杩欎箞棰戠箒锛岃绗簩甯у拰绗笁甯т箣闂撮殧浜嗗ソ浜涗釜绌虹櫧甯э紝濡傛灉鎯冲涓?簺锛屾尐杩戜竴鐐瑰氨琛屼簡銆?br />銆??寰?笂鍗囨槸娉℃场锛屽鏋滃線涓嬮鍙互鍋氶洦锛岄洩浠?箞鐨勩?璇曡瘯鐪嬪惂 :p
銆??杩欎釜鏄湡浜哄竷缃殑浣滀笟锛屼负浜嗗姞娣卞嵃璞★紝鍐嶅啓涓?亶鏁欑▼銆傝窡澶у涓?捣瀛︿範
銆??绗竴娆″啓鏁欑▼锛屾湁璇寸殑涓嶆竻妤氱殑鍦版柟锛岃澶у鎸囧嚭锛屾湁璇寸殑涓嶅鐨勫湴鏂癸紝璇峰ぇ瀹舵寚鐐广? :)






相关链接:



convert .mod to .MPG



matroska format



Top Religion



Data Domain's Position Once Again Tend To NetApp



Shanghai university GRADUATES overall employment rate of 07 97.25%



ADO programming in the definition of the problem encountered by ATL



"Cottage" Toxic



reviews Geography EDUCATION



What is DIGITAL TV renovation project?



.avi to .mp4 converter



Youtube M2ts



Talent war broke out, the direct selling industry executives 300 000 -50 million annual salary



Catalogs GRAPHIC



In SDH / SONET 155M on carrying IP packet SOLUTION



Bohai Shipbuilding Heavy Industry under the overall management planning branch of the Digitization p



The SMTP user authentication based on QMail Setup Guide (Part Two)



No comments:

Post a Comment