CoronaPrototype missing from Current Public Release?

Hi, I’m trying to implement the CoronaClass type (as per https://docs.coronalabs.com/api/type/CoronaPrototype/newClass.html), which is listed as being available in the current Public release - 2015.2731. Although I am running this version, it seems like this type hasn’t been implemented yet (maybe just in Daily builds) - the example herefails with the following error: Attempt to index global ‘Prototype’ (a nil value).

Is the example wrong, or was this just prematurely listed as being available in Public?

Thanks!!!

Can you post your code? (Not all of it, but the relevant parts?)

Rob

Hi, Rob - I was trying to get the example here running: https://docs.coronalabs.com/api/type/CoronaPrototype/new.html

local paramsTable = { value = 3 } local Foo = Prototype:newClass( "Foo" ) function Foo:initialize( params ) print( params.value ) end -- Pass params to initialize() which prints '3' Foo:new( paramsTable )

Thanks!

Anything?

Hi @scbrent,

I think the documentation is missing the “require()”. Can you please try adding this above the current example?

[lua]

local Prototype = require( “CoronaPrototype” )

[/lua]

Thanks,

Brent

Can you post your code? (Not all of it, but the relevant parts?)

Rob

Hi, Rob - I was trying to get the example here running: https://docs.coronalabs.com/api/type/CoronaPrototype/new.html

local paramsTable = { value = 3 } local Foo = Prototype:newClass( "Foo" ) function Foo:initialize( params ) print( params.value ) end -- Pass params to initialize() which prints '3' Foo:new( paramsTable )

Thanks!

Anything?

Hi @scbrent,

I think the documentation is missing the “require()”. Can you please try adding this above the current example?

[lua]

local Prototype = require( “CoronaPrototype” )

[/lua]

Thanks,

Brent