How can I show an confirmation message in Actionscript 3?

13,445
Alert.show("Are you sure?", "Title",
    mx.controls.Alert.YES | mx.controls.Alert.NO, this, alertEventHandler);

Then create an alertEventHandler with the following code:

function alertEventHandler(event:CloseEvent):void {
    if(event.detail == Alert.YES) {
        // pressed yes.
    }
}

Or check out a custom Dialog class: http://fatal-exception.co.uk/blog/?p=69

Share:
13,445
Waseem
Author by

Waseem

Updated on August 03, 2022

Comments

  • Waseem
    Waseem almost 2 years

    How can I show an confirmation message in Actionscript 3 ?

    I use Adobe Flex 3 and as3 for Air application

  • Waseem
    Waseem over 14 years
    I get this error : 1119: Access of possibly undefined property No through a reference with static type Class.
  • Pindatjuh
    Pindatjuh over 14 years