First of all thanks so much for the attention so far.
Unfortunately, I have tried all the suggestions concerning the hide and unhide issue, but all of them are not working for me. I suppose I am not doing something right in this case.
More so, @Hendrix000007, may be I am not getting you right, but what I was asking for is, for instance, if you have a tableView with a number of rows, and you touch one of the rows, how would you get that rows left (x) and top (y) coordinates.
However, in other to get what I am talking about, concerning the toggle or say hide/unhide issue, this is how I am executing the action:
local composer = require( “composer” )
local page = composer.newScene()
local widget = require( “widget” )
local universal = require( “myUniversal” )
local leftSide = display.screenOriginX;
local rightSide = display.contentWidth-display.screenOriginX;
local topSide = display.screenOriginY;
local bottomSide = display.contentHeight-display.screenOriginY;
local totalWidth = display.contentWidth-(display.screenOriginX*2);
local totalHeight = display.contentHeight-(display.screenOriginY*2);
local centerX = display.contentCenterX;
local centerY = display.contentCenterY;
local joy
local joy2
local stopWelComAudio = function()
audio.stop( playWelcomeBackgdAudio )
playWelcomeBackgdAudio = nil
– Dispose the handles from memory and ‘nil’ out each reference
audio.dispose( welcomeAudio )
welcomeAudio = nil --prevents the handle from being used again
end
local toggleJoy = function()
--joy.isVisible = not(joy.isVisible)
--joy2.isVisible = (joy2.isVisible)
joy.alpha = 0
joy2.alpha = 1
end
function page:create(event)
local pageComponent = self.view
local pagePlatform = display.newRect(0,0, totalWidth, totalHeight)
pagePlatform:setFillColor( 1, 1, 1 )
pagePlatform.x = centerX
pagePlatform.y = centerY
pageComponent:insert(pagePlatform)
pagePlatform:addEventListener(“touch”, abortTouch)
local joy = display.newImageRect(“joy.png”, 250, 400)
joy.x = centerX/2
joy.y = centerY + centerY/3 + ((centerY/3)/5)
pageComponent:insert(joy)
joy.alpha = 1
joy:addEventListener(“touch”, abortTouch)
local joy2 = display.newImageRect(“joy2.png”, 250, 400)
joy2.x = centerX/2
joy2.y = centerY + centerY/3 + ((centerY/3)/5)
pageComponent:insert(joy2)
joy2.alpha = 0
joy2:addEventListener(“touch”, abortTouch)
– Load a welcome audio stream into memory as a background audio
local welcomeAudio = audio.loadStream( “audio/00_INTRODUCTION_unknown.wav” )
– Play the welcome audio stream as a background audio
local playWelcomeBackgdAudio = audio.play( welcomeAudio )
end
function page:show( event )
local pageComponent = self.view
end
function page:hide( event )
local pageComponent = self.view
–
– Clean up native objects
–
end
function page:destroy( event )
local pageComponent = self.view
end
page:addEventListener( “create”, page )
page:addEventListener( “show”, page )
page:addEventListener( “hide”, page )
page:addEventListener( “destroy”, page )
timer.performWithDelay( 2000, stopWelComAudio )
timer.performWithDelay( 3500, toggleJoy )
return page
Thanks once again!!