推 cjcat2266:trace(this["text" + i]); //感覺可以加到FAQ 05/11 15:27
推 dsmwang:應該是屬性問題吧?用字串看看? 05/11 15:28
→ dsmwang:name好像是用字串檔儲存的 05/11 15:29
→ jimi7788:可用array去存你的物件,arr:Array =[mc.text1,mc.text2] 05/11 15:39
→ jimi7788:再用for(var i:int=0;i<arr.length;i++){trace(arr[a])}; 05/11 15:41
→ STARGAZERs:Jimi 大的方式我正在測試.... 這問題真的感覺很基礎... 05/11 15:47
→ STARGAZERs:可是真的很容易想不到解答 Orz 05/11 15:47
→ STARGAZERs:用字串好像也不能 .... 05/11 15:49
→ STARGAZERs:我改創了一各物件 05/11 15:50
→ STARGAZERs:var obj:Object = { A1:"123", A2:"234", A3:"456"}; 05/11 15:50
→ STARGAZERs:之後去 trace 也是找不到.... >< 05/11 15:50
→ STARGAZERs:trace(this["obj"]); // 有找到 Object 05/11 15:53
→ STARGAZERs:trace(this["obj.A1"]) // undefined 05/11 15:53
推 cjcat2266: this["obj"]["A1"] 05/11 16:01
推 cjcat2266:這個語法叫作associative array,可以Google看看 05/11 16:03
→ STARGAZERs:喔喔喔喔喔喔喔.... 感謝 CJ 大.... 這應該就是解了!! 05/11 16:24
→ STARGAZERs:text1.text=String(obj["A1"]); 這種語法可以用!! 05/11 16:27
→ STARGAZERs:CJ 大人 您真是神人!! 05/11 16:28
→ jimi7788:CJ大有要開班授課嗎? 05/11 16:53