开发者

how can i download a set of variable images in flex/as3 and display them?

suppose i have 10 image variables like this

var image1:String = http://somewhere.com/image1.jpg

var image2:string = .....image2.jpg

var image3:string = .....image3.jpg

and so forth.........

i have a timer that displays each variable as an image one a time ....

how do i "buffer" the image and 开发者_开发问答display them instead of going out each time the timer runs? im asking because sometimes the server could slow or some other reason. so what i want to do is to download all those images and then display them from the clients computer. some sort like @Embed ???

complete newbie.. so please go slow on me ... :p


I'm not sure exactly how your displaying the images based on the code snippet. However, I assume you are using the image tag and changing the source URL to change the image?

Instead of a bunch of string instances; have you tried a bunch of image instances? Something like this:

var image1 : Image = new Image()
image1.source = 'http://somewhere.com/image1.jpg'
var image2 : Image = new Image()
image2.source = 'http://somewhere.com/image2.jpg'

Then you can write some code to display, or not display, the images as appropriate; using a viewStack or other navigator.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜