Create Magic Rings in Flash 用 ActionScript 自動產出 random rings
Demo : http://annwongfresh.googlepages.com/duplicateRing.html (soucecode : duplicateRing.fla)
ActionScript:frame 1 :var i:Number =0; // start number for loopingvar max:Number =30; // dupliate maximum numberring0._visible =0; // hidden the 1st ring
frame 2 :duplicateMovieClip("ring0","ring" +i,900-i);// duplicateMovieClip( target , newname , depth )this["ring" +i]._x = Math.random()*400; // 400 is the stage widththis["ring" +i]._y = Math.random()*300;this["ring" +i]._xscale = i*5; // enlarge 5 timesthis["ring" +i]._yscale = i*5;this["ring" +i]._alpha = Math.random()*100; //random 0 <= n < 1 , 0-100% Alphai = i+1;
duplicateMovieClip(
target
,
newname
depth
)
frame 3:if(i<=max){ gotoAndPlay(_currentframe -1);}
Your teaching is quite good! I like it.
Post a Comment
1 Comment:
Your teaching is quite good! I like it.
Post a Comment