I'm working on a quiz results page with an animated bar that displays the results. (The numbers tick up in a field and a graphical bar grows until the number of correct answers is reached.) It works fine when I run the script from the Code Editor window but when the card is opened by a Go or Open command (I've tried both) after the quiz finishes, the correct score and graphical bar are displayed, but the animation doesn't run. It's as if the animation is happening pre-Open... I've tried adding a Wait command to the on openCard handler, but oddly that just keeps the Quiz card on the screen longer, which doesn't make sense to me either.
The only hitch might be that the Results card is in a different (already open) stack... the main stack. The quiz stack isn't a substack but it's listed in the Stack Files in the Stack Inspector. Code highlights follow:
when the quiz is finished...
Code: Select all
Open card "Results" of stack "MainNavigation"
Code: Select all
on openCard
displayResults gScore [gCurrentChapter]
end openCard
on displayResults pNumberRight
--(animation stuff goes here; works fine when run in Code Editor. Also when opening the card for the first time from the Application Browser.
end displayResults
Thoughts? Thanks! --Dirk