Problem with New Button - shows only the label

I Have trouble with creating a new button. It shows only the labelname but not the chosen default.png and over.png. I did it exactly as in the video on corona website… :confused:

this is my code:

– Neuer Button

local widget = require (“widget”)

– Button Funktion

local function handleButtonEvent (event)

local phase = event.phase

if “ended” == phase then

print ( “you pressed and released a Button”)

end

end

– Button Erstellen

local StartButton = widget.newButton

{

left = 50,

top = 400,

width = 230,

height   = 100,

defaultfile = “ButtonD.png”,

overfile = “ButtonO.png”,

label = “los gehts”,

onEvent = handleButtonEvent,

}

Hello @pepew,

Remember that Lua is case-sensitive. In your code you write this:

[lua]

defaultfile = “ButtonD.png”,

overfile = “ButtonO.png”,

[/lua]

However, the correct code is as follows, as shown in the documentation for widget buttons (notice F ile with a capital “F”):

[lua]

defaultFile = “ButtonD.png”,

overFile = “ButtonO.png”,

[/lua]

At all times, be very careful that you obey case-sensitive rules in your code.

Take care,

Brent

Hello @pepew,

Remember that Lua is case-sensitive. In your code you write this:

[lua]

defaultfile = “ButtonD.png”,

overfile = “ButtonO.png”,

[/lua]

However, the correct code is as follows, as shown in the documentation for widget buttons (notice F ile with a capital “F”):

[lua]

defaultFile = “ButtonD.png”,

overFile = “ButtonO.png”,

[/lua]

At all times, be very careful that you obey case-sensitive rules in your code.

Take care,

Brent