Change pages via touch

Does anyone know how can I enable page switch via touch (swipe from left to right or vice-versa)? I am trying (without success) do the following:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module(..., package.seeall) 
function new() 
    local menuGroup = display.newGroup() 
    local drawScreen = function() 
           local Shape1   
           Shape1 = display.newImageRect( "Shape1.png", 83, 85 ); 
           Shape1.x = 137; Shape1.y = 112; Shape1.alpha = 0.10
           menuGroup:insert(Shape1) 
   end 
   drawScreen() 
   
   local function Shape1:touch(event)
                        print(event.name.."occurred")
                        return true
                end
                
                Shape1:addEventListener("touch", Shape1)
   
   return menuGroup 
end 
views:1333 update:2011/10/13 9:25:17
corona forums © 2003-2011