Actionscript 3 设置图像组件的源不工作

Actionscript 3 设置图像组件的源不工作,actionscript-3,apache-flex,actionscript,Actionscript 3,Apache Flex,Actionscript,我正在拉入一个xml文件,其中只有一个结果。其中一个节点是picture,它包含指向图片的链接。这是xml文件: <artist> <id>502</id> <name>Bad Religion</name> <picture>http://userserve-ak.last.fm/serve/500/46612615/Bad Religion BR 2010.jpg</picture>

我正在拉入一个xml文件,其中只有一个结果。其中一个节点是picture,它包含指向图片的链接。这是xml文件:

 <artist>
    <id>502</id>
    <name>Bad Religion</name>
    <picture>http://userserve-ak.last.fm/serve/500/46612615/Bad Religion BR 2010.jpg</picture>
    <twitter></twitter>
</artist>

这是因为
artist.picture
返回一个XMLList对象。请尝试以下代码:

var artist:XML = new XML(event.result);
artistPic.source = String(artist.picture[0]);
lblArtistName.text = artist.name; // This one is probably transtyped automagically by Flex.

我想我以前说过:“它不起作用”完全没有说明什么问题。除非你提供更多信息,否则帮助你是非常困难的,如果不是不可能的话。为了让这对你和其他人来说都更容易,你可以使用Flash Player内容调试器插件(只需谷歌搜索),你可以显示任何错误消息,你可以跟踪内容以查看变量设置不正确的地方,你至少应该为artistPic提供代码。
var artist:XML = new XML(event.result);
artistPic.source = String(artist.picture[0]);
lblArtistName.text = artist.name; // This one is probably transtyped automagically by Flex.