remove a picture

Here is my code:

function onLoadComplete(event)  
 if event.target then  
  
 local photo=event.target  
 ------do something with the photo  
 end  
end  
local function showlibrary(event)   
 media.show( media.PhotoLibrary, onLoadComplete )  
 return true  
end  
  

How can I tell if there already is a photo loaded and if there is remove it?

I have tried:

if(photo) then
photo:removeSelf()
photo=nil
end

Maholm

[import]uid: 5717 topic_id: 17736 reply_id: 317736[/import]

Never mind, I found it, It was a typo :wink:

[import]uid: 5717 topic_id: 17736 reply_id: 67580[/import]