If you double/triple click on the myObject here the text does NOT disappear. Why is this not working when there are multiple events being fired?
That is, are there actually multiple “text” objects, with some existing but no longer having a reference to them held by the local “myText” variable? Do I have to manually removeSelf() on the local “myText” field before assigning it another “display.newText(…)”?
[code]
display.setStatusBar( display.HiddenStatusBar )
local myText
local function hideMyText(event)
print (“hideMyText”)
myText.isVisible = false
end
local function showTextListener(event)
if event.phase == “began” then
print(“showTextListener”)
myText = display.newText(“Hello World!”, 0, 0, native.systemFont, 30)
timer.performWithDelay(1000, hideMyText, 1 )
end
end
– Display object to press to show text
local myObject = display.newImage( “inventory_button.png”, display.contentWidth/2, display.contentHeight/2)
myObject:addEventListener(“touch”, showTextListener)
[/code] [import]uid: 140210 topic_id: 25345 reply_id: 325345[/import]
[import]uid: 52491 topic_id: 25345 reply_id: 102405[/import]
[import]uid: 52491 topic_id: 25345 reply_id: 102420[/import]