I tried searching docs and forums for this, but I have a toggle button that shows a CROSSED OUT image when the sound in my game is off. For some reason when I tried using alpha or invisible it wont accept presses. When I keep the image not hidden, it works fine and toggles the sound on and off.
Is there something Im missing? Or am I just not getting it?
[code]
–MAIN MENU:SOUND BUTTON
–==================================================================================================
–Create the sound button overlay
soundButton = display.newImageRect( “OptionRing@2x.png”, 56, 56 )
soundButton.x = 35
soundButton.y = 240
–When the Sound Overlay is Pressed it toggles the Sound On/Off
local function onSoundButtonTouch( event )
if (soundEnabled == true) then
–soundButton.alpha = 0
print(“soundEnabled”)
soundEnabled = false
media.playEventSound( “Menu_Presses.aif” )
else
–soundButton.alpha = 1
soundEnabled = true
media.playEventSound( “Menu_Presses.aif” )
end
print(soundEnabled)
end
soundButton:addEventListener(“tap”, onSoundButtonTouch )
[/code] [import]uid: 10051 topic_id: 3382 reply_id: 303382[/import]