Director help

Does anyone know how to switch scenes using the Director class, so if I call a function from nav.lua from a list view this will work:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--setup functions to execute on touch of the list view items
function listButtonRelease( event )
        self = event.target
        local id = self.id
                        
        -- Trying to switch to item section based on id
                if (data[id].title == "item 1") 
                        director:changeScene("item_section1","moveFromLeft")) --does not work
                else if (data[id].title == "item 2") 
                        director:changeScene("item_section2","moveFromLeft")) --does not work
                else if (data[id].title == "item 3") 
                        director:changeScene("item_section3","moveFromLeft")) --does not work
                else if (data[id].title == "item 4") 
                        director:changeScene("item_section4","moveFromLeft")) --does not work
                else  
                        director:changeScene("item_section5","moveFromLeft")) --does not work
                end
 
        end
end

are there any lua files for item_section1,item_section2,...

???

you can find director class from code exchange with example see that

this is the link

http://developer.anscamobile.com/code/director-class-10

see how it works!!!!

:)

Thanks for the link. There were seperate lua files for all the sections. I found that I had a typo that was throwing an error.

views:1533 update:2011/9/30 9:15:39
corona forums © 2003-2011