0
votes

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

1
please note that since i cannot post more links as i dont have 10 reputation..... var image2 , image 3 are all links eg : somewhere.com/imageX.jpgjimmy

1 Answers

1
votes

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.