Timer Not Being Created Again After Pausing

I have a pause button that works well until after I unpause the game. I have a timer that is supposed to be created again (I can't pause them as a trial user), but it isn't doing that.

Error to prove it's not being created:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Windows simulator build date: Dec  9 2011 @ 14:01:29
 
 
Copyright (C) 2009-2011  A n s c a ,  I n c .
        Version: 2.0.0
        Build: 2011.704
Paused
Unpaused
Paused
Runtime error
        ?:0: attempt to index a nil value
stack traceback:
        [C]: ?
        ?: in function 'cancel'
        ...le\documents\my code\corona sdk\makin' bank\game.lua:109: in function
 <...le\documents\my code\corona sdk\makin' bank\game.lua:98>
        ?: in function <?:21
Memory Usage: 0.132326171875 MB
Texture Usage: 8.912896

If you download build 704 I believe you should be able to pause them just fine. (704 is the latest stable build and available to test users.)

Peach :)

Thanks. I have one more question, though.

In my enterScene, my timer is created. In exitScene, it's paused. In destroyScene, it's canceled.

My question is, will I run into a similar problem as before because every time the player re-enters the game screen it will try and create a timer and fail?

Bump

Every time you bump a thread I've been in, I get an email notification. I got one when you posted the first time, bumping so soon just gives me more emails to dig through - so please, no more needless bumps ;)

You can avoid issues by checking if the timer exists when you enter the scene again. If it does you can resume it if it doesn't you can create it. That should work fine.

Peach :)

views:1413 update:2011/12/28 9:26:54
corona forums © 2003-2011