Download Random image from remote server

Thanks in advance for any help, bit of a newb here.

I have been able to successfully pull a static image from a remote server and load it into my app, however the next step is to randomly pull the image.

Again I have been able to do this locally but am lost as to how to include the randomization in the url. Below is what I’ve used to successfully pull 2.png and load it (obviously with additional networking code.

network.download( "http://mydomain.com/2.png", "GET", networkListener, "2.png", system.TemporaryDirectory )  

Now I know this isnt right but thinking something like this to pull 1 or 10 possible images and save to temp dirct. as 2.png: Note: my attempt in the url

local r = math.random ( 1, 10 )   
network.download( "http://mydomain.com/"'r..'"2.png", "GET", networkListener, "2.png", system.TemporaryDirectory )  

Any help is greatly appreciated.
[import]uid: 81020 topic_id: 13564 reply_id: 313564[/import]

Try this

[lua]local r = math.random ( 1, 10 )
network.download( “http://mydomain.com/"..r..".png”, “GET”, networkListener, “2.png”, system.TemporaryDirectory )[/lua]
[import]uid: 63320 topic_id: 13564 reply_id: 49811[/import]

Darci,

Thank you so much!, I was missed the …rr… .

THanks again
[import]uid: 81020 topic_id: 13564 reply_id: 49900[/import]

HI all again,
Darci thanks again for the help,

I have another issue.
I load the game and pull the image from the server without any problems.

Problem is when using director to reload the scene the remote image download fails to pull another random image,
Here is my Director call

function button:touch(event)  
 local phase = event.phase  
 if "began" == phase then  
 print("Someone touched me!")  
 goToScene = "Game1"  
 fxMode = "fade"  
 director:changeScene( "Game1" )  
  
  
 end  
 end  
button:addEventListener( "touch", button )  

Is there an easy way to simply reload the entire app?
That would certainly solve the problem If I can just reload everything,

Thanks in advance
[import]uid: 81020 topic_id: 13564 reply_id: 49993[/import]

Mklein,
Unfortunately I don’t know much about the director class or how it works so I won’t be much help there. [import]uid: 63320 topic_id: 13564 reply_id: 49995[/import]