Start Using Stack Initialization Location
Posted: Fri Sep 20, 2013 10:09 pm
I have a LiveCode app that has a number of libraries that are initialized when the stack starts. I use the following code:
This works great as long as it is placed in the preOpenStack handler, HOWEVER.
I have the application on a Mobile device and when the app starts it displays a BLACK screen until the stacks are started and then goes to the first card. The user doesn't know what is going on when the screen is black, so I created a Splash Card to be displayed while the application is initializing.
I moved the code from the preOpenStack to the openCard handler on the splash card and it fails. The application starts, but if I go into the Message Box, none of the stacks are started in the StacksInUse.
If I move the code back to the preOpenStack, everything works.
What is the problem. Shouldn't I be able to start a stack after the Main stack is Open?
I would appreciate any thoughts from the forum.
Thank you in advance.
Code: Select all
on preOpenStack
if "XMLControl" is not among the lines of the StacksInUse then
if the environment = "development" then
start using stack "../lib/saverXMLControl.livecode"
else
start using stack "saverXMLControl.livecode"
end if
end if
<for each stack that is needed>
end preOpenStack
I have the application on a Mobile device and when the app starts it displays a BLACK screen until the stacks are started and then goes to the first card. The user doesn't know what is going on when the screen is black, so I created a Splash Card to be displayed while the application is initializing.
I moved the code from the preOpenStack to the openCard handler on the splash card and it fails. The application starts, but if I go into the Message Box, none of the stacks are started in the StacksInUse.
If I move the code back to the preOpenStack, everything works.
What is the problem. Shouldn't I be able to start a stack after the Main stack is Open?
I would appreciate any thoughts from the forum.
Thank you in advance.