Flexstore Analysis

xiaoxiao2021-03-06  40

Pure marker language

Module

Custom Module

{name.text}

{address.text}

{city.text}

{state.selecteditem.data}

{zip.text}

{email.text}

{cardtype.selectedItem.data}

{cardnumber.text}

{cardholder.text}

{CardexPmonth.Text}

{CardExPyear.Text}

Consistency, control data and MODEL consistency on the interface, no need for user writing code maintenance

Built-in verification control:

A control can be extended: custom properties, methods, events, very powerful

[Event ("Change")]]]

Var DataObject;

Var selecteditem;

Function setValue (str: string, item: object) {

IF (DataObject == Item) Return;

IF (item == undefined) {

Visible = false;

Return;

} else {

DataObject = Item;

Visible = true;

}

}

Introduced CSS and SCRIPT

the class defined in Script, the variable can be directly referenced in MXML

Dynamic Class:

In some cases, however, you might want to add and access properties or methods of a class at runtime that are not defined in the original class definition. The dynamic class modifier lets you do just that. For example, the following code adds the Dynamic Modifier To The Person Class Discussed Previously:

Dynamic class person2 {

VAR name: string;

VAR AGE: Number;

}

Now, Instances of the Person Class Can Add and Access Properties and Methods That Aren't Defined in The Original Class, AS Shown In The Following Example:

VAR A_PERSON: PERSON2 = New Person2 ();

A_PERSON.haircolor = "blue"; // no compiler error Because Class Is Dynamic

Trace (a_person.haircolor);

Subclasses of dynamic classes are also dynamic, with one exception. Subclasses of the built-in MovieClip class are not dynamic by default, even though the MovieClip class itself is dynamic. This implementation provides you with more control over subclasses of the MovieClip class, because You can choise to make your subclasses Dynamic or Not:

Class a extends movieclip {} // a is not Dynamic

Dynamic Class B Extends a {} // b IS Dynamic

Class C Extends B {} // C Is Dynamic

Class D Extends a {} // d is not Dynamic

Dynamic Class E Extends movieclip {} // e is Dynamic

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

New Post(0)