Director Problem!

I keep getting this error with director. one file director works, the next file it doesn't (for scene changes) I think I've done it all right and I can't see a problem...

Please help...

1
2
3
4
5
6
7
8
9
Runtime error
        ...inistrator\Desktop\CoronaProjects\Flick\director.lua:268: attempt to
index a boolean value
stack traceback:
        [C]: ?
        ...inistrator\Desktop\CoronaProjects\Flick\director.lua:268: in function
 'loadScene'
        ...inistrator\Desktop\CoronaProjecspawn
spawn

Every time I have gotten this error it has always been a problem with my code and nothing to do with the director class. Usually for me it is a line or two of code I forgot to add or delete.

I know, what I meant was the director things aren't working because of code, but it appears to be right, the code, but the error doesn't really help me find the error AT all.

Could you post your code so I can try to help?

Yes director hides the usual terminal output and replaces it with it's own useless pop up and error messages.. not telling where or what the errors are.
I usually build my individual scenes without director and put them into director when i am sure they have no errors.

Director is still a great tool though!

Ok, I'll pastebin my code.

MAIN.LUA http://pastebin.com/0FWaGF1G

GAME.LUA http://pastebin.com/wuV05Hi8

Few things in game.lua I'm working on that may have errors, but the director thing is still a problem.

OH and by the way, the main thing I need fixing is the alert's director change.

Anyone?

I took a quick look.
I don't know if this is the solution but you need to put your game.lua in a module like this:

module(..., package.seeall)

otherwise everything in game.lua will be global.

another thing: I would put all the code in game lua inside the new() function.
director 1.3 comes with a template for scenes... you should take a look at that.

Hope this helps

OK, when I tried the module thing everything stops working, but I got the module thing working with game.lua eventually. However, I am still getting errors like

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Runtime error
        ...\Administrator\Desktop\CoronaProjects\Flick\game.lua:73: attempt to c
all method 'insert' (a nil value)
stack traceback:
        [C]: in function 'insert'
        ...\Administrator\Desktop\CoronaProjects\Flick\game.lua:73: in function
'_listener'
        ?: ispawn
Runtime error
        ...inistrator\Desktop\CoronaProjects\Flick\director.lua:183: attempt to
call method 'removeSelf' (a nil value)
stack traceback:
        [C]: in function 'removeSelf'
        ...inistrator\Desktop\CoronaProjects\Flick\director.lua:183: in function
 'cleanGspawn
spawn

with director, make sure you're using the right function calling methods.
I've had a lot of problems with object.function(var) and object:function(var)
usually because of the self reference that goes with :

views:1576 update:2011/10/12 18:33:00
corona forums © 2003-2011