views:

512

answers:

1

I have created a linkbar with two labels. Now, I need to keep a track of the label clicks.


10 100

i.e. If in the beginning "First" is clicked, the details will be displayed. After that, if without submitting the details, "Second" is clicked then an alert message should come to inform the user that "First is still in progress, do you want to cancel and begin Second operation". Vice-versa for Second to First transition. I need to know how to write events to keep track of which button clicked.

A: 

maybe....

var inProgress:Boolean = false;
var clickedButton:Button;


private function clickButtonHandler(event:MouseEvent):void{
  if(clickedButton != null){

    if(clickedButton  != event.currentTarget && inProgress){
      //handle alert
    }
  }
  else{
     clickedButton = event.currentTarget;
  }

  inProgress = true;
}

private function sumbitDetailsHandler(event:Event):void{
   inProgress = false;

   clickedButton = null;
}
Shua
Hi...Actually, am not working with buttons...Its a linkbar where I have 2 labels, each inside a HBOX...Its a viewstack that is being used for the linkbar..Any suggestions..Cos, this doen't work there..For the viewstack if I use itemClick or change, the event if cancelled does not take me back to the previous position. Instead, the change is already made, I just get the alert message. But, I cannot revert or change the event.
I made some changes..and it worked...thanks..