// A setter.
[Inspectable(defaultValue="default text")]
function set text(t:String)
Parameters can be any of the following supported types:
•
Array
•
Object
•
List
•
String
•
Number
•
Boolean
•
Font Name
•
Color
Handling events
The event model is a dispatcher-listener model based on the DOM Level 3 proposal for event
architectures. Every component in the architecture emits events in a standard format, as defined
by the convention. Those events vary across components, depending on the functionality that the
component provides.
Components generate and dispatch events and consume (listen to) other events. An object that
wants to know about another object's events registers with that object. When an event occurs, the
object dispatches the event to all registered listeners by calling a function requested during
registration. To receive multiple events from the same object, you must register for each event.
Although every component can define unique events, events are inherited from the core classes of
the architecture, mx.core.UIObject and mx.core.UIComponent. These classes define low-level
component events, such as
components. Subclasses of these classes inherit and broadcast these events.
Dispatching events
In the body of your component's ActionScript class file, you broadcast events using the
dispatchEvent()
dispatchEvent(eventObj)
The
argument is the event object that describes the event. You can explicitly build an
eventObj
event object before dispatching the event, as the following example shows:
var eventObj = new Object();
eventObj.type = "myEvent";
dispatchEvent(eventObj);
You can also use the following shortcut syntax that sets the value of the
event object and dispatches the event in a single line:
dispatchEvent({type:"myEvent"});
,
,
draw
resize
method. The
dispatchEvent()
,
, and others that are fundamental to all
move
load
method has the following signature:
Writing the component's ActionScript code
property for the
type
67
Need help?
Do you have a question about the FLEX - DEVELOPING COMPONENTS AND THEMES and is the answer not in the manual?
Questions and answers