I'm trying to code a game of Poker in AS3, using Flash Professional CS5 (although I try to keep as little code as possible in the .fla).
When a player bets, for example, I need to be able to show an animation of some chips sliding into the center of the screen. After that happens, the AI decides what to do, and another animation of their chips occurs. Then a menu pops up so the player can choose their own next action. And so on.
I started writing a
UIBet interface with
raise(amount) methods and so on, that you would implement with a class extending MovieClip and fill in the methods with gotoAndPlays to various animations. But if I just have code that calls these graphics object like so:
playerUIBet.bet() aiUIBet.bet() menu.prompt()
Then, if I understand Flash correctly, what'll happen is that the code will finish executing, and then all of those animations will happen simultaneously.
How can I get these animations to happen sequentially? What if I want to insert pauses between them? Some kind of solution like this? What's the best way to do this in AS3?