My question is about cleaning up. I have some code that creates an effect, using a movieclip, when its complete its removes it. Below is a simple example of the type of thing Im doing, but do I need to clean up the sprite in the code below ??
Im assuming that once the movieclip is cleaned up, the sprite has no reference and will also get cleaned up.
function myobject:createEffect()
local sprite = Bitmap.new(Texture.new("sprite.bmp"))
self.mc = MovieClip.new{
{1, 100, sprite, {x = {0, 200, "linear"}}}
}
self.mc:addEventListener(Event.COMPLETE, self.onComplete, self)
self.addChild(self.mc)
end
function myobject:onComplete()
self.removeChild(self.mc)
self.mc = nil
end
Comments