Need help with Downloading & Displaying Multiple Images (AsynchImageDownload)

Hello, I am pretty new at Corona, and I have a problem.

I saw the example on the site called AsynchImageDownload, which demonstrates downloading and displaying images with a known file name. I need to do the same thing, however, the file names are unknown.

I need to download all of the thumbnail item images found on this site:

http://www.gamegavel.com/display.cgi?search=1&time=new

The format of the image links are as follows:

[http://www.gamegavel.com/sites/*/images/thumb_**********.JPG](http://www.gamegavel.com/sites/*/images/thumb_ **********.JPG)

I’m pretty sure I will have to parse some HTML, but I don’t know how to do that.

The following is a good example of what I need done, but it is using Cocos2D vs Corona, which I need.

http://www.raywenderlich.com/4295/multithreading-and-grand-central-dispatch-on-ios-for-beginners-tutorial

Any help would be greatly appreciated.

local \_ = require 'Allen' local myText = display.newText("(Waiting for response)", 0, 0, native.systemFont, 10) myText.x = display.contentCenterX myText.y = 120 local function networkListener( event ) if ( event.isError ) then myText.text = "Network error!" else myText.text = "See Corona Terminal for response" print ( "RESPONSE: " .. event.response ) myText.a = string.find(event.response, "http://www.gamegavel.com/sites/", 1) myText.b = string.find(event.response, ".JPG", 1) local s = event.response myText.text = s(myText.a, myText.b) --\> 'ell' myText.text = myText.text + ".JPG" local function networkListener( event ) if ( event.isError ) then print ( "Network error - download failed" ) else event.target.alpha = 0 transition.to( event.target, { alpha = 1.0 } ) end --print ( "RESPONSE: " .. event.response ) end display.loadRemoteImage( myText.text, "GET", event.response, "helloCopy.JPG", system.TemporaryDirectory, 50, 50 ) end end -- Access Google over SSL: network.request( "http://www.gamegavel.com/display.cgi?search=1&time=new", "GET", networkListener )

Above is what I have so far. It correctly grabs one of the images, downloads it, and then displays it.

The only thing I need it tot do now is to get it to loop corectly grabbing all of the thumbnails and then displaying each of them.

Any help with this would be appreciated. Thank you.

local \_ = require 'Allen' local myText = display.newText("(Waiting for response)", 0, 0, native.systemFont, 10) myText.x = display.contentCenterX myText.y = 120 local function networkListener( event ) if ( event.isError ) then myText.text = "Network error!" else myText.text = "See Corona Terminal for response" print ( "RESPONSE: " .. event.response ) myText.a = string.find(event.response, "http://www.gamegavel.com/sites/", 1) myText.b = string.find(event.response, ".JPG", 1) local s = event.response myText.text = s(myText.a, myText.b) --\> 'ell' myText.text = myText.text + ".JPG" local function networkListener( event ) if ( event.isError ) then print ( "Network error - download failed" ) else event.target.alpha = 0 transition.to( event.target, { alpha = 1.0 } ) end --print ( "RESPONSE: " .. event.response ) end display.loadRemoteImage( myText.text, "GET", event.response, "helloCopy.JPG", system.TemporaryDirectory, 50, 50 ) end end -- Access Google over SSL: network.request( "http://www.gamegavel.com/display.cgi?search=1&time=new", "GET", networkListener )

Above is what I have so far. It correctly grabs one of the images, downloads it, and then displays it.

The only thing I need it tot do now is to get it to loop corectly grabbing all of the thumbnails and then displaying each of them.

Any help with this would be appreciated. Thank you.

Can some one help me loop this so I can have it grab all the images instead of just one?

Thanks

Can some one help me loop this so I can have it grab all the images instead of just one?

Thanks