I tried it and the code I have used works correctly by itself, but when it comes together with rest of my main.lua some problems appear. The code ‘floors’ were placed in appropriate order (I have tried all combinations), however there is some conflict between displays. The point here is: The image fades to clear, so it is no longer visible on the screen, so you can see the button and use it. Before the image has faded, the button had been covered by it.
This is my code; just copy it and try it.
[lua]-------------------------------background-----------------
local background = display.newImage(“background.png”)
background.width = display.actualContentWidth
background.height = display.actualContentHeight
-------------------------------covering image------------
local bg = display.newImage(“mannelig1.png”)
bg.x = display.contentCenterX
bg.y = display.contentCenterY
bg.alpha = 0
transition.to(bg, {delay = 2300, time = 1000, alpha = 1})
------------------------------------------sound playing button--------------
local widget = require(“widget”)
local BEEP = media.newEventSound(“BEEP.mp3”)
local button_BEEP_Press = function(event)
media.playEventSound(BEEP,button_BEEP_Press)
end
local button_BEEP = widget.newButton
{
defaultFile = “buttondefault.png”,
overFile = “buttonpressed.png”,
onPress = button_BEEP_Press,
}
button_BEEP.x = display.contentCenterX; button_BEEP.y = display.contentCenterY
–when the ‘sound playing button’ was located between ‘background’ and ‘covering image’ it still wasn’t working correctly with rest of the code.
[/lua]