Need some help loading remote images

In html I'd simply do the img link.

Basically I work myself down to a screen that contains part details (auto parts) and as part of that I want to display a remote jpg.

I'm trying display.loadRemoteImage and it displays the image ok but I'm having trouble destroying the image when I destroy the screen..

I tried rpimg = display.loadRemoteImage(..... and then tried to set rpimg.isVisible = false but I'm getting a nil for rpimg, which I suspect is a scope problem.

What I have is a list of parts and on touching a part I open the detail screen with the image. Going back to the list is where I currently can't get rid of the image. I also have to make sure that on the next part-touch I get the new image.

Since I'm using same temp filename I'm hoping that following images will overwrite the previous one, or do I need to remove it first?

Of course I'm also looking for most efficient method to use for getting and displaying the remote jpegs.

Changing to local images is not an option as I'm dealing with thousands of images.

TIA for any suggestions you may have. I'm still exploring via trial and error but thought I'd ask in the meantime before I get too many bumps on my head :-)

Heinz

Update:
Was able to get the image removed.
Using display.loadRemoteImage(.... sample code
made myImage2 global
then used myImage2:removeSelf()

Also found that loadRemoteImage does not overwrite. Of course I may not be using it right.
Using os.remove() example to remove the temp jpg in back button function as an alternative.

Of course still open to suggestions if there is a better way.
I'm loading 300x300 jpegs from WAN connected WiFi. Performance is quite acceptable.
Have to do something re 3G. I'll ask in another post.

views:1718 update:2011/10/1 9:04:19
corona forums © 2003-2011