Use information prompt component Alert

xiaoxiao2021-03-06  68

Flash MX 2004 adds Alert components to us, allowing us to easily construct the information dialog box by this UI component. Let me talk about how to use this component:

Step 1: Drag the Alert components to the stage;

Step 2: Delete the component just now;

Step 3: Write the following code on the timeline:

Inport Mx.Controls.alert

Var listenerobj: Object = new object ();

ListenerObject.click = function (evt) {

Switch (est.detail) {

Case alert.ok:

"You press /" OK / ".");

Break

Case alert.cancel:

"You press /" Cancel / ".");

Break;

}

}

Alert.show ("Tip! Do you want to enter Pengcheng IT?"

"Tips",

Alert.ok | alert.cancel,

this,

Listenerobj);

OK is as simple as it is. The results are shown in the figure:

转载请注明原文地址:https://www.9cbs.com/read-97822.html

New Post(0)