Extensions Destroy Object

void object.destroy ( )

This method destroys the corresponding object in the MMF frame, as if a native "Destroy" action had been used.  Additionally, the Lua object on which destroy was called is also disabled, so that trying to further access or update the destroyed object results in an error.

Parameters

None.

Return Values

None.

Example

-- Assume we have a table of objects indexed by ID
object = mmf.objects[1]
 
-- If object touches the left screen edge, then
-- we will destroy it
if (object.xRight < 0) then
  object.destroy()
end
 
-- If an object is destroyed, all its fields will
-- return the nil value
if (object.fixed == nil) then
  print("Object destroyed!")
end

Copyright 2010 Justin Aquadro