why is this code crashing the simulator ?

Ok,

I am using the slimmed down director with this project, however I feel it isnt director related.

Iam using an analogue joystick module to control an object; I have stripped the code down to minimal for easier viewing.
Each time I remove the analog stick with a gameover function it crashes the sim or it will lock the next scene, as if removing the touch listeners on the textfield.
It may be a timer issue within the module?
Here is the whole project

http://www.tfgf.co.uk/corona/stick.zip

I did think not to delete the “stick” from the main game and remove it in the next scene but it caused the same issues.
Any help greatly appreciated.
[import]uid: 127675 topic_id: 31182 reply_id: 331182[/import]

Commented or uncommented it seems to crash. I don’t have time to comb over someone else’s library but one possible workaround could be setting it to invisible on scene change and visible when you return to the scene.

Really what I’d suggest doing is viewing the comments on the code exchange and see if others discuss this. [import]uid: 52491 topic_id: 31182 reply_id: 124768[/import]

@peach

yes peach I did consider that but I get multiples of the joystick when returning to the game if I use that method.
I have stripped it down even further and posted another link in the code exchange.
new download link here:

 www.pixelstick.co.uk/corona/test.zip

suggestions ideas welcome
[import]uid: 127675 topic_id: 31182 reply_id: 124848[/import]

You get multiples because you haven’t changed the code; check if it’s first play and load joystick if it is, if it’s not then just toggle visibility. Or, easier still, just do something like;
if joystick then joystick.isVisible = true else --do joystick here

:slight_smile:

May try and check out updated code this evening if I get some downtime, though. [import]uid: 52491 topic_id: 31182 reply_id: 124925[/import]

Commented or uncommented it seems to crash. I don’t have time to comb over someone else’s library but one possible workaround could be setting it to invisible on scene change and visible when you return to the scene.

Really what I’d suggest doing is viewing the comments on the code exchange and see if others discuss this. [import]uid: 52491 topic_id: 31182 reply_id: 124768[/import]

@peach

yes peach I did consider that but I get multiples of the joystick when returning to the game if I use that method.
I have stripped it down even further and posted another link in the code exchange.
new download link here:

 www.pixelstick.co.uk/corona/test.zip

suggestions ideas welcome
[import]uid: 127675 topic_id: 31182 reply_id: 124848[/import]

You get multiples because you haven’t changed the code; check if it’s first play and load joystick if it is, if it’s not then just toggle visibility. Or, easier still, just do something like;
if joystick then joystick.isVisible = true else --do joystick here

:slight_smile:

May try and check out updated code this evening if I get some downtime, though. [import]uid: 52491 topic_id: 31182 reply_id: 124925[/import]