I have a button. I created that button with the wdget.
local widget = require “widget”
buttonBee = widget.newButton{ – Create the button
defaultFile=“buttonDo.png”, – I’m using this image .png
onRelease = hideBee – And onRelease it performs this function “hideBee”
}
buttonBee.x = 969 – this is just the location for the image
buttonBee.y = 408 – location
Then I have the function, so when I release the mouse, it shows the image and plays the sound.
local function hideBee()
local Bee = display.newImage (“bee.png”)
doImage.x = 500
doImage.y = 600
audio.play(SoundReB5)
return true
end
-------------------------------------------- everything works great -----------------------
-----This is what I need------------
Now what I need is that when I touch first the mouse, or tap the finger, or touches began or phase = began one of those… the image shows or isVisible or alpha=1
and when I release the mouse or let go my finger, then hide the image or isVisible = false or alpha=0 or just hide the image or maybe image=removeSelf, something, and play the sound.
In a simple way
onTouch = display image
onRelease = hide image and play sound
http://www.youtube.com/watch?v=UKY3GSZRZBU&feature=youtu.be
Thank you for your help