Alert component usage

xiaoxiao2021-03-06  177

Alert components about Flash

About Flash's Alert components in the Help manual of FlashMX2004, the general usage is as follows: 1. Drag the Alert from the component panel to delete (enumerate in the library). 2. Add code:

Import mx.controls.alert;

3. Use the ALERT component method to display the Alert component is relatively simple, with Alert.show, as follows: Alert.show (Message [, Title [, Flags [, Parent [, ClickHandler [, Icon [, DefaultButton]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] ): -------------------------------------------- Message : Tips Title: Title Flags: Button, can be any combination of Alert.ok, Alert.cancel, Alert.yes, Alert.no, use a bit or (|) connection, such as displaying OK and Cancel Button, using Alert .Ok | alert.cancel. The text on the button can be changed. If you use alert.oklabel = "good" to change the OK button to display I Know, other similar Parent: parent, if you use the main scene as a parent, use _root. If the code is originally _root, with this. ClickHandler: Alert Click the handle of the button event, you need your own definition. ICON: An icon, displayed on the left side of the message. Quote the link in a component in the library, so you can embide the animation defaultButton: Default get the focus button --------------------------- -------- Alert's style can be changed, using mylert.setstyle, such as change theme color: myalert.setStyle ("THEMECOLOR", "haloblue"); In addition to Haloblue, the topic color is also Can be Halogreen or HalooraNGE. Change the Border Style MyAlert.setStyle ("BorderStyle", "INSET"); more might want to view the mm website. Look at a simple usage example:

Import mx.controls.alert;

Var myclickhandler = new object (); // Define the operation object

/ / Change button text

Alert.oklabel = "OK";

Alert.cancellabel = "Cancel";

Var myalert = alert.show ("You haven't logged in!", "Tips", Alert.ok | Alert.cancel, _root, MyclickHandler, "Inforicon", Alert.ok;

Mylert.setStyle ("THEMECOLOR", "Haloblue");

MyAlert.setStyle ("Borderstyle", "INSET");

MyClickHandler.Click = function (evt) {

? trace (evt.detail); // Get the Detail of the EVT (button in Alert), here is the value corresponding to the button

? if (evt.detail == alert.ok) TRACE ('ok')? Else Trace ('Cancel');

}

If you only display information, you can use it.

Alert.show ("You haven't logged in yet!", "Tips");

A good debugging tool that doesn't lose TRACE. For more details, please refer to: [Alert] in the Flex Help] It can be seen that MM is eccentric with Flex.

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

New Post(0)