LinkBar按钮/标签点击事件转换

发布于 2024-07-24 03:35:50 字数 377 浏览 2 评论 0原文

我创建了一个带有两个标签的链接栏。 现在,我需要跟踪标签点击次数。


10 100

即如果在开始时单击“First”,将显示详细信息。 之后,如果没有提交详细信息,则单击“第二个”,则应出现一条警报消息,通知用户“第一个操作仍在进行中,是否要取消并开始第二个操作”。 对于第二次到第一次的转换,反之亦然。 我需要知道如何编写事件来跟踪单击了哪个按钮。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笔芯 2024-07-31 03:35:50

或许....

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;
}

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;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文