1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | //函數宣告 function Step1():void{...} function sTep2():void{...} function stEp3():void{...} function steP4():void{...} //函數執行 Step1(); sTep2(); stEp3(); steP4(); // ↓ //就可以做成陣列 var array:Array = [Step1,sTep2,stEp3,steP4]; //用迴圈執行 for(var i = 0 ; i < 4 ; i++){ var f:Function = array[i]; f.call(); } |
Direct link: https://paste.plurk.com/show/397638