I’m trying to make a button disappear when you press on it. It would work, but I can’t place the button before the function, because the button needs the function in order to work. Here is the code:
local buttonHandler = function(event)
if event.phase == “release” then
if event.id == “play” then
bluebutton.x = display.contentWidth/0
bluebutton.y = display.contentHeight/0
myText.x = display.contentWidth/0
blueball.x = display.contentWidth/0
blueball.y = display.contentHeight/22
end
end
end
local playbutton = ui.newButton{
default = “buttonPurple.png”,
over = “buttonPurpleOver.png”,
onEvent = buttonHandler,
text = “Play”,
id = “play”,
size = 20,
emboss = true
}
playbutton.x = display.contentWidth/2
playbutton.y = display.contentHeight/1.6
Is it even possible to make it disappear by the press of itself? Any help is appreciated! [import]uid: 30901 topic_id: 5782 reply_id: 305782[/import]
[import]uid: 6645 topic_id: 5782 reply_id: 20001[/import]