How do i change director to composer cause it maybe the cause of my app unable to run on devices
although it is perfectly fine on simulator
How do i change director to composer cause it maybe the cause of my app unable to run on devices
although it is perfectly fine on simulator
the error i get is director.lua:1094 : attempt to call method ‘insert’ (a nil value)
and this is the code
for i = currentStage.numChildren, 1, -1 do
– Verify directorId
if type( currentStage[i].directorId ) == “nil” then
currentStage[i].directorId = newScene
end
– Insert into the NEXT group if it’s needed
if currentStage[i].directorId == newScene
and currentStage[i].directorId ~= “main” then
nextScreen:insert( currentStage[i] )
end
end
IMHO I would just re-build your app from start using Composer. Director is really old and no longer supported. Director code may run fine on devices (I have no idea) … but if you are thinking of redoing the code in Composer (and I think that is a good idea), it is best to start clean, and do it right. Even though it will be a lot of typing, if you are new at this stuff anyway; as you learn, it is good to do the typing. I think it helps new developers better understand the code.
In your original code, there may be pieces of code (loops, and functions and such) that are not Director specific and you could likely cut and paste those parts into your new composer files.
Just one man’s opinion.
Good luck!
the error i get is director.lua:1094 : attempt to call method ‘insert’ (a nil value)
and this is the code
for i = currentStage.numChildren, 1, -1 do
– Verify directorId
if type( currentStage[i].directorId ) == “nil” then
currentStage[i].directorId = newScene
end
– Insert into the NEXT group if it’s needed
if currentStage[i].directorId == newScene
and currentStage[i].directorId ~= “main” then
nextScreen:insert( currentStage[i] )
end
end
IMHO I would just re-build your app from start using Composer. Director is really old and no longer supported. Director code may run fine on devices (I have no idea) … but if you are thinking of redoing the code in Composer (and I think that is a good idea), it is best to start clean, and do it right. Even though it will be a lot of typing, if you are new at this stuff anyway; as you learn, it is good to do the typing. I think it helps new developers better understand the code.
In your original code, there may be pieces of code (loops, and functions and such) that are not Director specific and you could likely cut and paste those parts into your new composer files.
Just one man’s opinion.
Good luck!