Actionscript 3 消息框?

发布于 2024-10-20 03:48:11 字数 481 浏览 5 评论 0原文

我需要显示一个带有是或否按钮的模式确认对话框,并获取用户在 ActionScript 3 中单击的结果,

确定保存对话框不会在调用退出时应用程序退出。

 Alert.show("Do you realy want to delete", "My Title", 3,null,
        function alertClickHandler(event:CloseEvent):void
        {
              if (event.detail==Alert.YES)
              {
                 canvas.save();     // does not popup when next line is present                        
                 exit();

              }
       } );

阿卜杜勒·哈利克

I need to show a modal confirmation dialog with yes no buttons and get the results what the user has clicked in ActionScript 3

ok save diaglog does not who up when exit is called the application just exits.

 Alert.show("Do you realy want to delete", "My Title", 3,null,
        function alertClickHandler(event:CloseEvent):void
        {
              if (event.detail==Alert.YES)
              {
                 canvas.save();     // does not popup when next line is present                        
                 exit();

              }
       } );

Abdul Khaliq

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

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

发布评论

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

评论(2

秋日私语 2024-10-27 03:48:11

这是警报框的示例:

Alert.show("Do you realy want to delete", "My Title", 3,null,
        function alertClickHandler(event:CloseEvent):void
        {
                        if (event.detail==Alert.YES)
                        {
                                //do stuff if clicked yes       
                        }
       } );

This is the example for an Alert box:

Alert.show("Do you realy want to delete", "My Title", 3,null,
        function alertClickHandler(event:CloseEvent):void
        {
                        if (event.detail==Alert.YES)
                        {
                                //do stuff if clicked yes       
                        }
       } );
蓝梦月影 2024-10-27 03:48:11

Actionscript 中的调用有时是异步的。

特别调用文件保存和所有。

你真正应该做的是:

Alert.show("Do you realy want to delete", "My Title", 3,null,
        function alertClickHandler(event:CloseEvent):void
        {
              if (event.detail==Alert.YES)
              {
                 canvas.save(true);     // does not popup when next line is present                        
                 exit();

              }
       } );

修改保存函数如下:

public function save(exitAfterSave:boolean):void
{
    //do whatever you need to do to save the file
    if(exitAfterSave)
    exit();
}

The calls in Actionscript are sometimes asynchronous.

Specially calls to file saves and all.

What you should really do is :

Alert.show("Do you realy want to delete", "My Title", 3,null,
        function alertClickHandler(event:CloseEvent):void
        {
              if (event.detail==Alert.YES)
              {
                 canvas.save(true);     // does not popup when next line is present                        
                 exit();

              }
       } );

Modify the save function as follows:

public function save(exitAfterSave:boolean):void
{
    //do whatever you need to do to save the file
    if(exitAfterSave)
    exit();
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文