Can not remove display image downloaded from internet

Hi,

I have this portion of code into a scene:enterScene storyboard :

 local myFichier = tostring(params.nomVille..myId..".jpg")  
 local myStaticImage  
  
 local function chargeImageListener( event )  
 if (event.isError ) then  
 --print ("erreur de chargement")  
 else  
 myStaticImage = display.newImageRect( myFichier, system.TemporaryDirectory, 316, 136)  
 myStaticImage:setReferencePoint(TopLeftReferencePoint)  
 myStaticImage.x = display.contentWidth/2  
 myStaticImage.y = (myStaticImage.height/2)+40  
 myStaticImage:setReferencePoint(TopLeftReferencePoint)  
 myStaticImage.alpha = 0  
 transition.to( myStaticImage, { alpha = 1.0 } )  
 end  
 end  
 network.download( maCarte, "GET", chargeImageListener, myFichier, system.TemporaryDirectory )  

maCarte is a url to a image on a server.

It works well but when i go out the scene, the display object do not remove itself.

I have written in exitScene :

display.remove(myStaticImage)  

bit it is still here.

I have try display.removeSelf but it crashes.

What do I miss ?

Regards

Frédéric
[import]uid: 5578 topic_id: 27693 reply_id: 327693[/import]

I’m new to this myself but don’t you need to put this :

myStaticImage:removeSelf() [import]uid: 155133 topic_id: 27693 reply_id: 112334[/import]