Troubles with function object:tap ( event )

Long story short I am new here and this is what I have and I dont understand where I am making my mistake. What I want is for the "cover" (Page0.jpg 768x1024) to be tapped then "topMenu" (tapMenuBtn.png 768x150) to display (toggled). Then If I tap "topMenu" to have "topMenuDD" (tapMenuBtnDD.png 650x400) display.

The "topMenu" displays but no matter where I tap on the screen, "topMenu" goes away and "topMenuDD" never comes up. I figure it has something to do with not being able to tap "topMenu" but I dont know for sure.

PLZ help. Lemme know what I can do to make this work.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

local cover = display.newImage ("Page0.jpg")

function cover:tap ( event )
if topMenu == nil then
topMenu = display.newImage ("tapMenuBtn.png",0,0)
else
topMenu:removeSelf()
topMenu=nil
end
end

cover:addEventListener ("tap", cover)

function topMenu:tap ( event )
topMenuDD = display.newImage ("tapMenuBtnDD.png",0,150)
end
topMenu:addEventListener ("tap", topMenu)

views:1316 update:2011/12/30 9:10:41
corona forums © 2003-2011