I'm working on this animated menu, and I'm in need of some help...

Here's what I've got basically.


The tweens are the menu animating up or down, and the keyframes in between the tweens are the seperate sub-menus under each item (DVR,PTZ,Bullet etc). The second tween is the one where it goes back to main menu (all options collapsed).

I'm using behaviors to move around the timeline for the animated sub menus.

What I need is like another line or behavior, that acts like or is an If Then statement. so like basically what I need is this kind of command in actionscript, or a method.

Press button, gotoandPlay ending_animation (DVRend etc)

then at the end of that action
if button=PTZ then gotoandplay PTZstart
if button=Dome then gotoandplay Domestart

So, any help? There's gotta be some method of doing this.