blackberry/GamePlay — pull request #851 by dgough (2013-02-07 22:13:18+00:00)
Title: Added a lua function "convert" to convert a userdata value to another gameplay class type

The purpose of this function is convert a Control to a Button, or PhysicsCollisionObject to a PhysicsRigidBody.

This function will change the meta table of the userdata value to the meta table of the class with the given name.

```lua
-- Function signature:
-- @param object The gameplay userdata object.
-- @param className The string name of the class to convert to.
function convert(object, className)

-- Example:
local launchButton = form:getControl("launch")
if launchButton ~= nil then
convert(launchButton, "Button")
print("text: " .. control:getText())
end
```