Subapp and "End the application"
In my application, a subapp is called at a certain point. When user clicks anywhere within subapp (which shares the global values / strings with the main app), the events are (in this order):
Set Global String "State" to "Play"
End the application.
However, the Global String "State" never gets changed to "Play". Does this mean "End the application" is always executed first?
Re: Subapp and "End the application"
During my expermentation I had problems like this. To answer your question...yes.
Marv
Re: Subapp and "End the application"
Francois would know for sure but perhaps the variables are updated at the end of the event loop cycle where end of application is executed immediately when its called.
Re: Subapp and "End the application"
To 'skip' it. Divorce it to two events in first one, change the variable in second one when variable is changed (it's equal to Play) end the application.
Re: Subapp and "End the application"
The global variable is updated immediately with the action. End the application sets a flag and the application actually ends at the end of the loop.
Are you sure the global variables are shared between the main application and the sub app?
Re: Subapp and "End the application"
Yes, they are shared. I did more experimenting and it seems that the problem wasn't in the Global String not being set correctly, but that the Button objects (which were on the layer underneath) were catching the clicks of the mouse (used as a trigger for closing the subapp) and resetting the Global String. The subapp was planned to be modal but I had to change it recently to comply with Flash exporting.
Statistically it's impossible but it seems I must have clicked the same spot where the button was 20+ times in a row during testing. Maybe I should just drop everything and go play lottery ;)
Re: Subapp and "End the application"
Hi Francois. I think the "end the application" loop is not working right. I have used it with variables and the application ends before updating the variables, but not since build 248.
Marv
Re: Subapp and "End the application"
So if you can send me an example, this would be good.