There is an error ‘<eof>’ expected near end. But there is no ends are written wrong.
Please, can anyone help me?
If there were no mistakes, you wouldn’t be getting an error. Post the code, and then someone can help.
local widget = require(“widget”)
local function handelbuttonEvenet( event )
local phase = event.phase
if “ended” == phase then
print(“Mission success”)
end
end
local PauseButton = widget.newButton ( “Pause”, “Pause 1”, 150, 200, 350, 150)
onEvent = handelbuttonEvenet( event )
There’s plenty to fix there. I’d recommend that you go read about how to create and use widget.newButton in the documentation: https://docs.coronalabs.com/api/library/widget/newButton.html
- I agree with @XeduR you need to take a look at the API and other docs for widget.
The code you provided will not work to create a button and has a number of errors and incorrect syntax issues.
-
The reason you got that error message is the last line
onEvent = handelbuttonEvenet( event )
Corona probably interprets this (via Lua) as you trying to create a function but not adding an end to it.
Again, please go read the API docs and use some of these examples verbatim, then modify them a little bit at a time till you understand how it works.
Cheers,
Ed
Please, can anyone help me?
If there were no mistakes, you wouldn’t be getting an error. Post the code, and then someone can help.
local widget = require(“widget”)
local function handelbuttonEvenet( event )
local phase = event.phase
if “ended” == phase then
print(“Mission success”)
end
end
local PauseButton = widget.newButton ( “Pause”, “Pause 1”, 150, 200, 350, 150)
onEvent = handelbuttonEvenet( event )
There’s plenty to fix there. I’d recommend that you go read about how to create and use widget.newButton in the documentation: https://docs.coronalabs.com/api/library/widget/newButton.html
- I agree with @XeduR you need to take a look at the API and other docs for widget.
The code you provided will not work to create a button and has a number of errors and incorrect syntax issues.
-
The reason you got that error message is the last line
onEvent = handelbuttonEvenet( event )
Corona probably interprets this (via Lua) as you trying to create a function but not adding an end to it.
Again, please go read the API docs and use some of these examples verbatim, then modify them a little bit at a time till you understand how it works.
Cheers,
Ed