Showcase and discover digital art at yex

Follow Design Stacks

Subscribe to our free newsletter to get all our latest tutorials and articles delivered directly to your inbox!

Using the Alert component

Using the Alert component

Drag an Alert component onto the Stage. Then delete it. Then put this code on the main Timeline.

  1. import mx.controls.Alert;
  2. var listenerObj:Object = new Object();
  3. = function(evt) {
  4.     switch (evt.detail) {
  5.     case Alert.OK :
  6.         trace(“you hit “OK”.”);
  7.         break;
  8.     case Alert.CANCEL :
  9.         trace(“you hit “CANCEL”.”);
  10.         break;
  11.     }
  12. };
  13.“ALERT! Do you want to delete the Internet?”, “Error”, Alert.OK | Alert.CANCEL, this, listenerObj);