包含多行weblink图像的字符串。如何显示它们?

时间:2017-02-15 03:18:03

标签: string actionscript-3

我有一个充满网络链接图片的字符串(23个链接):

listItem.text = String(item.movieimage);

如果我做跟踪(String(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];

...等...

我该怎么做?

谢谢

1 个答案:

答案 0 :(得分: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];
}