Hi I am new here and i want to change my Button Image. But it dont works. It should change the Image when i click on the Button.
local widget = require( "widget" ) local function handleButtonEvent( event ) if ( "ended" == event.phase ) then print( "Button was pressed and released" ) button2.defaultFile = "english.png" end end local button2 = widget.newButton( { width = 120, height = 120, defaultFile = "german.png", label = "button", onEvent = handleButtonEvent } ) -- Center the button button2.x = display.contentCenterX button2.y = display.contentCenterY \* 1.3 -- Change the button's label text button2:setLabel( "" )
