如何在位图中加载多于一张图像(Flex)
我无法从
function processXML(e:ResultEvent):void
{
myXML = e.result as XML;
for (var i:Number=0;i<myXML.icon.length();i++)//amout of urls.Now there tree elements
{
loader.load( new URLRequest(myXML.image[i].imageURL.toString())); //get url
}
}
有 event.COMPLETE 功能的
private function handleLoadComplete( e:Event ):void
{
var bmp:Bitmap = ( e.target as LoaderInfo ).content as Bitmap;
imgColl.addItem(bmp); //sore elements
Alert.show("load complete");//scheck for loadin
img.source = imgColl.getItemAt(1) as Bitmap; // ERROR Store only one element
url
<mx:Image id="img" width="20" height="20"/>
下载多于一张图像我做错了什么?
i can't download more then one image from url
function processXML(e:ResultEvent):void
{
myXML = e.result as XML;
for (var i:Number=0;i<myXML.icon.length();i++)//amout of urls.Now there tree elements
{
loader.load( new URLRequest(myXML.image[i].imageURL.toString())); //get url
}
}
there is event.COMPLETE function
private function handleLoadComplete( e:Event ):void
{
var bmp:Bitmap = ( e.target as LoaderInfo ).content as Bitmap;
imgColl.addItem(bmp); //sore elements
Alert.show("load complete");//scheck for loadin
img.source = imgColl.getItemAt(1) as Bitmap; // ERROR Store only one element
MXML file
<mx:Image id="img" width="20" height="20"/>
What i'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要为每个并发请求使用单独的加载器。
文档中并没有明确说明这一点,但它确实这么说:
You need to use separate loaders for each concurrent request.
It's not explicitly clear from the docs, but it does say this: