Hello
Need a little help please. I found in the forum messages a prefered method to downloading an image from a web site to the DocumentsDirectory of an Android device and how the procedure can then show the image on a scene. The sample code uses the link: http://developer.anscamobile.com/demo/hello.png for the test image.
I “copied” the sample text to my lua file and the simulator shows the image is in fact in the DocumentDirectory (image does get downloaded). However, I can’t seem to get it show on the scene. I thought maybe it was the simulator, so I compiled the APP and tried placing the APP file on my phone and not even in the DocumentDirectory shows the file gets downloaded (much less the scene showing it). Here is what the code looks like:
local function networkListener( event )
if ( event.isError ) then
print ( “Network error - download failed” )
else
img3 = display.newImage( “helloCopy”, system.DocumentsDirectory, 60, 40 )
img3.alpha = 0
transition.to( img3, { alpha = 1.0 } )
end
print ( "RESPONSE: " … event.response )
end
network.download(
“http://developer.anscamobile.com/demo/hello.png”,
“GET”,
networkListener,
“test.png”,
system.DocumentsDirectory )
local baseDir = system.DocumentsDirectory
local img3 = display.newImage(“test.png”, baseDir)
img3.x=screen_maxx-(img1.width/2)+12
img3.y=screen_miny+(img1.height/2)+12
Any help would be very much appreciated!
- TIA [import]uid: 150241 topic_id: 28061 reply_id: 328061[/import]

