Re: [問題] 可以幫我看一下~attachMovie&Button
你把下面紅色的部份改成 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
討論串 (同標題文章)
Flash 近期熱門文章
PTT數位生活區 即時熱門文章