Re: [問題] 可以幫我看一下~attachMovie&Button

看板Flash作者 (玉仔〒△〒)時間18年前 (2007/09/06 18:24), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串3/4 (看更多)
你把下面紅色的部份改成 this 試試看 ※ 引述《purplemio (噗哈~)》之銘言: attach Button之後,從array給label值 按下的時候~想要show出Button的label的值.... 可是一直是undefined..... 想請各位幫我看一下 是不是哪邊設錯 還是我用法錯誤了?>"< 先謝謝各位~ xml.onLoad = function(success) { var node:XMLNode; if (success) { len = this.firstChild.childNodes.length; for(var i=0;i<len;i++){ node = this.firstChild.childNodes[i]; array.push(node.attributes.userid); } A = array; for (var i = 0; i<len; i++) { _root.attachMovie("Button", "bb"+i, i,{_x:100, _y:20+50*i}); with (_root["bb"+i]) { _root["bb"+i].label = A[i]; } _root["bb"+i].onRelease = function(){ var userid = _root["bb"+i].label; trace(userid); //undefined~ } } } }; xml.load("http://127.0.0.1/shareobject/alluserid.php"); -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.171.176.34 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.64.173.38

09/06 18:36, , 1F
抱歉= = 這邊可以刪除了..
09/06 18:36, 1F
文章代碼(AID): #16tzLsJk (Flash)
文章代碼(AID): #16tzLsJk (Flash)