im wondering how can i call this; suppose i need to create a next and pass some parameters. The following code give an error
[blockcode]
/Development/learn/main.lua:31: attempt to index local ‘mytext’ (a nil value)
[/blockcode]
[blockcode]
function newParticle()
local particle = display.newText("", 0, 0, “verdana”, 15 )
particle.xDefault = 0
particle.yDefault = 0
particle.text =“0”
particle:setReferencePoint (display.CenterReferencePoint )
particle:setTextColor( 255, 255, 255)
particle.objectName=“TracingObject”
function particle:update(_x,_y,_text)
particle.xDefault = _x
particle.yDefault = _y
particle.text =_text
end
function particle:destroy()
particle.xDefault = nil
particle.yDefault = nil
particle.text =nil
particle:removeSelf()
end
end
local mytext = newParticle()
mytext:update(“tap to continue”,100,100)
[/blockcode]
I appreciate your feedback [import]uid: 11038 topic_id: 4028 reply_id: 304028[/import]
