2016-09-30 76 views
0
var theXML:XML = new XML(); 

theXML.ignoreWhite = true; 

theXML.onLoad = function() 
{ 

    var nodes = this.firstChild.childNodes; 

    for(i = 0; i < nodes.length; i++) 
    { 
     theList.addItem(nodes[i].firstChild.nodeValue, i); 
    } 
}; 

theXML.load("http://localhost/xampp/phpflash/account.php"); 

这些都是错误的:于Flash Professional CS6使用ActionScript 3

-1120:未定义的属性我的访问。

-1137:参数数量不正确。预计不会超过1.

我对这个问题很新手。请以您的善意和考虑帮助我。

回答

0

1:你应该申报我。 2:addItem函数应该只有一个参数。

var theXML:XML = new XML(); 

theXML.ignoreWhite = true; 

theXML.onLoad = function() 
{ 

    var nodes = this.firstChild.childNodes; 

    for(var i:int = 0; i < nodes.length; i++) 
    { 
     theList.addItem(nodes[i].firstChild.nodeValue); 
    } 
}; 

theXML.load("http://localhost/xampp/phpflash/account.php"); 
+0

非常感谢你的回答:D user3711105! –

+0

如果有帮助,请标记为解决方案thx。 – user3711105