I get an error like:
attempt to index a boolean value
local function musicF( event )
local switch = event.target
if switch.isOn == true then
music = true
else
music = false
end
end
local musicW = widget.newSwitch(
{
left = 250,
top = 200,
style = "checkbox",
id = "Checkbox",
onPress = musicF
}
)
sceneGroup:insert(musicW)
if music == true then
musicW:setState(true)
else
musicW:setState(false)
end