[問題] this[]的問題
當eval()變得evil之後,好像有看過這兩種替代方案
getChildByName 跟 this[variable]
我今天在使用this[]的時候遇到了個問題,想請問一下有沒有人了解的,
因為我以為
this.path.reference
is equivalent to
this["path"]["reference"]
and
this["path"].reference
and
this.path["reference"]
可是我用
this["map.avatar.a"+i].visible=false;
卻遇到
ReferenceError: Error #1069: Property map.avatar.a1 not found on the1952 and
there is no default value.
at the1952/init()
at the1952()
這個error,而使用
this.map.avatar["a"+i].visible=false;
卻完全正常,是否我的第一個式子有使用錯誤的地方? 感謝回答 <(_ _)>
--
Ray的遊樂場:http://ray.myftp.org
歡迎光臨~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 76.189.150.40
推
05/07 07:31, , 1F
05/07 07:31, 1F
推
05/07 07:37, , 2F
05/07 07:37, 2F
推
05/07 07:40, , 3F
05/07 07:40, 3F
推
05/07 07:46, , 4F
05/07 07:46, 4F
→
05/07 07:48, , 5F
05/07 07:48, 5F
→
05/07 08:17, , 6F
05/07 08:17, 6F
→
05/07 08:18, , 7F
05/07 08:18, 7F
→
05/07 08:45, , 8F
05/07 08:45, 8F
→
05/07 08:45, , 9F
05/07 08:45, 9F
→
05/07 08:47, , 10F
05/07 08:47, 10F