Hi,
I'm having some sort of timing issues and would like to know what are best practices for this kind of problem in BGA Studio. Here's what it looks like:
I have some cards that I dojo.connect in the onEnteringState event. An action move the selected card somewhere, destroys it and then creates a new one (same HTML id as the original if it matters). The movement, destruction and re-creation happens in the action notification event. The destruction and re-creation is like 1 second into the animation process.
I've put some trace in my code and the events are triggered in the following order (the order is good):
1. MyActionNotification
2. onUpdateActionButtons
3. onEnteringState
So even though the MyActionNotification event is triggered first, the onEnteringState event is triggered before the animation is finished and the "new" card is not dojo.connect-ed because the dojo.connect is done on the card that will be destroyed less than 1 second later and not on the "new" card.
Looking for any advice for this situation.
I'm having some sort of timing issues and would like to know what are best practices for this kind of problem in BGA Studio. Here's what it looks like:
I have some cards that I dojo.connect in the onEnteringState event. An action move the selected card somewhere, destroys it and then creates a new one (same HTML id as the original if it matters). The movement, destruction and re-creation happens in the action notification event. The destruction and re-creation is like 1 second into the animation process.
I've put some trace in my code and the events are triggered in the following order (the order is good):
1. MyActionNotification
2. onUpdateActionButtons
3. onEnteringState
So even though the MyActionNotification event is triggered first, the onEnteringState event is triggered before the animation is finished and the "new" card is not dojo.connect-ed because the dojo.connect is done on the card that will be destroyed less than 1 second later and not on the "new" card.
Looking for any advice for this situation.