Problem with changeScene! help!

Hi!
Tell them the problem I have now.
I have a native.showAlert opens in a function, So far so good. The problem comes when I try to call the function to change changeScene scene.
The problem is that no change of scene. Why can it be?
I expose the code:

local function fin1 ( event )  
if count \<1 then  
print("has perdido por la bola 1")  
  
 local alert = native.showAlert( "Game Over", "Has perdido!",   
 { "OK"})  
 reintentar = true  
  
local function changeScene()  
 if reintentar == true then  
 director:changeScene ("main2")  
 end  
end  
  
end  
end  
  

PD: I have set in the beginning of code a variable called “reintentar” which default value is false. The idea is that if this is true Make the change of scene.

Thank you very much for your help! [import]uid: 98258 topic_id: 32012 reply_id: 332012[/import]

I used Google Translate and it says “has lost ball 1” if that’s correct. But from looking at your code it seems you need an event listener at the end of your function. I’m assuming here, sorry if I’m wrong. I added “ground” assuming if the player doesn’t catch a ball, the game is lost.

[code]
local function fin1 ( event )
if count == 0 then
print(“has perdido por la bola 1”)

local alert = native.showAlert( “Game Over”, “Has perdido!”, { “OK”})

director:changeScene (“main2”)
end
end
– Whatever variable you have when your player ‘doesn’t’ catch the ball.
ground:addEventListener(“collision”, fin1)
[/code] [import]uid: 114389 topic_id: 32012 reply_id: 127610[/import]

Indeed, about the game is what you say. I tried what you say, and in the text console I get the following error:

stack traceback / users / user / desktop / test / main.lua: 138 in function ‘_listener’
? in function <?: 534>
: In function <?: 229>

At line 138 is where the director: changeScene (“main2”).
Still not open my main2.lua.

Any possible solution? [import]uid: 98258 topic_id: 32012 reply_id: 127611[/import]

You’re definitely missing something in your code. Show more of your code… [import]uid: 114389 topic_id: 32012 reply_id: 127644[/import]

You’re definitely missing something in your code. Show more of your code… [import]uid: 114389 topic_id: 32012 reply_id: 127645[/import]

now I get another error that seems to be something about the subject.

Director ERROR: Failed to load module ‘segundoArchivo’ - Please check if the file exists and it is correct.

Why can it be?
I searched and I have the file in the main directory (segundoArchivo.lua) also implemented the module “director”.

thks! [import]uid: 98258 topic_id: 32012 reply_id: 127701[/import]

now I get another error that seems to be something about the subject.

Director ERROR: Failed to load module ‘segundoArchivo’ - Please check if the file exists and it is correct.

Why can it be?
I searched and I have the file in the main directory (segundoArchivo.lua) also implemented the module “director”.

Help please! [import]uid: 98258 topic_id: 32012 reply_id: 127693[/import]

I used Google Translate and it says “has lost ball 1” if that’s correct. But from looking at your code it seems you need an event listener at the end of your function. I’m assuming here, sorry if I’m wrong. I added “ground” assuming if the player doesn’t catch a ball, the game is lost.

[code]
local function fin1 ( event )
if count == 0 then
print(“has perdido por la bola 1”)

local alert = native.showAlert( “Game Over”, “Has perdido!”, { “OK”})

director:changeScene (“main2”)
end
end
– Whatever variable you have when your player ‘doesn’t’ catch the ball.
ground:addEventListener(“collision”, fin1)
[/code] [import]uid: 114389 topic_id: 32012 reply_id: 127610[/import]

Indeed, about the game is what you say. I tried what you say, and in the text console I get the following error:

stack traceback / users / user / desktop / test / main.lua: 138 in function ‘_listener’
? in function <?: 534>
: In function <?: 229>

At line 138 is where the director: changeScene (“main2”).
Still not open my main2.lua.

Any possible solution? [import]uid: 98258 topic_id: 32012 reply_id: 127611[/import]

module(..., package.seeall)

Do you have that on top of your ‘segundoArchivo.lua’ file? [import]uid: 114389 topic_id: 32012 reply_id: 127791[/import]

You’re definitely missing something in your code. Show more of your code… [import]uid: 114389 topic_id: 32012 reply_id: 127644[/import]

You’re definitely missing something in your code. Show more of your code… [import]uid: 114389 topic_id: 32012 reply_id: 127645[/import]

hi Silky!
Now I got to do what I needed You told me the file “segundoArchivo.lua”.
Thank you very much for your help! [import]uid: 98258 topic_id: 32012 reply_id: 127822[/import]

now I get another error that seems to be something about the subject.

Director ERROR: Failed to load module ‘segundoArchivo’ - Please check if the file exists and it is correct.

Why can it be?
I searched and I have the file in the main directory (segundoArchivo.lua) also implemented the module “director”.

thks! [import]uid: 98258 topic_id: 32012 reply_id: 127701[/import]

now I get another error that seems to be something about the subject.

Director ERROR: Failed to load module ‘segundoArchivo’ - Please check if the file exists and it is correct.

Why can it be?
I searched and I have the file in the main directory (segundoArchivo.lua) also implemented the module “director”.

Help please! [import]uid: 98258 topic_id: 32012 reply_id: 127693[/import]

module(..., package.seeall)

Do you have that on top of your ‘segundoArchivo.lua’ file? [import]uid: 114389 topic_id: 32012 reply_id: 127791[/import]

hi Silky!
Now I got to do what I needed You told me the file “segundoArchivo.lua”.
Thank you very much for your help! [import]uid: 98258 topic_id: 32012 reply_id: 127822[/import]