Hi trying to swap and image when user presses a button. Simple task but I cant seem to do without an error. Heres a snippet of my class. The issue lies with when I remove the original image, I think it removes the whole object. Please help. 
[code]
function Balloon.new()
local balloon = display.newImageRect( âBalloonBasic.pngâ, 71, 89 )
balloon.id = âballoonâ
balloon.x = 200
balloon.y = 200
physics.addBody( balloon, âdynamicâ, { density=0.2, friction=1, bounce=0.0, radius=40 } )
balloon.rotation = 0
balloon.isFixedRotation = true
balloon.health = 100
function balloon:applyImpulse(wind, hotAir)
balloon:applyLinearImpulse( wind, hotAir, 20, balloon.y )
â this cause the error, how can I swap image???
balloon:removeSelf()
balloon = display.newImageRect( âballoon-flame.pngâ, 71, 89 )
end
function balloon:destroy()
balloon:removeSelf()
balloon = nil
end
return balloon
end
return Balloon
[/code] [import]uid: 118379 topic_id: 22359 reply_id: 322359[/import]
[import]uid: 118379 topic_id: 22359 reply_id: 89128[/import]