Using the Alert component
June 19th, 2006 by Posted in Macromedia Flash, Macromedia Products
Using the Alert component
Drag an Alert component onto the Stage. Then delete it. Then put this code on the main Timeline.
- import mx.controls.Alert;
- var listenerObj:Object = new Object();
- listenerObj.click = function(evt) {
- switch (evt.detail) {
- case Alert.OK :
- trace(“you hit “OK”.”);
- break;
- case Alert.CANCEL :
- trace(“you hit “CANCEL”.”);
- break;
- }
- };
- Alert.show(“ALERT! Do you want to delete the Internet?”, “Error”, Alert.OK | Alert.CANCEL, this, listenerObj);


























