2017-02-15 72 views
0

我有一个字符串全网络链接的图像(23个链接):具有多行网页链接图像的字符串。如何显示它们?

listItem.text = String(item.movieimage); 

如果我做跟踪(字符串(item.movi​​eimage));输出是:

http://www.thewebsite.nc/Content/images/AFFICHES/xxx_3.jpg 
http://www.thewebsite.nc/Content/images/AFFICHES/vaiana.jpg 
http://www.thewebsite.nc/Content/images/AFFICHES/tous_scene.jpg 
http://www.thewebsite.nc/Content/images/AFFICHES/fits.jpg 
http://www.thewebsite.nc/Content/images/AFFICHES/boyfriend.jpg 
http://www.thewebsite.nc/Content/images/AFFICHES/sahara2017.jpg 
http://www.thewebsite.nc/Content/images/AFFICHES/resident_evil_final.jpg 
http://www.thewebsite.nc/Content/images/AFFICHES/raid_dingue.jpg 
http://www.thewebsite.nc/Content/images/AFFICHES/passengers2017.jpg 
http://www.thewebsite.nc/Content/images/AFFICHES/lego_batman.jpg 
http://www.thewebsite.nc/Content/images/AFFICHES/grande_muraille.jpg 
http://www.thewebsite.nc/Content/images/AFFICHES/fille_brest.jpg 

知道,我的舞台上有9个UILoader。

所以我想这样做

uiloader1.source = item.movieimage[1]; 
uiloader2.source = item.movieimage[2]; 
uiloader3.source = item.movieimage[3]; 

...等...

我怎么能这样做?

感谢

+0

分开你有这样的“网络链接图像”的一个例子吗?谷歌搜索结果的[**首页**](https://www.google.co.uk/search?q=as3+load+image)有什么问题?手册的[**示例**](http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Loader.html#contentLoaderInfo)有什么问题?...您需要**显示你已经尝试过的代码**,所以我们可以帮你修复它。否则,通过网络搜索在线查找教程。 –

+0

我编辑了我的帖子,更多解释。你说得对,它不是很清楚。对不起。 – Steph

回答

0

假设他们被缩进

//Put all the links in an array 
var myItems:Array = listItem_txt.text.split("\n"); 

//You say you only have nine, so only iterate until the 9th 
for (var i:int = 0; i < 9; i++) 
{ 
    //Also assuming your "uiloader" is a custom class you made with a .source property 
    this.getChildByName("uiloader" + i).source = myItems[i]; 
} 
相关问题