Defining Events In Actionscript Components - Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

You can use your custom component in the following Flex application:
<?xml version="1.0"?>
<!-- as/MainCodeBehindExample.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:MyComps="myComponents.*">
<MyComps:MyPanelComponent id="myP"/>
<mx:Button label="Copy" click="myP.xfer();"/>
</mx:Application>
If the value of the
id
name, Flex creates a property of the component, where the
the new property.
To support initialization from MXML, an inherited property must have the following
characteristics:
The inherited property must be public.
If you try to initialize a non-public inherited property, the Flex compiler issues an error.
The inherited property must be writable.
If you try to initialize a constant, or a property defined by a getter method without a
corresponding setter method, the Flex compiler issues an error.
The data type of the value that you specify to the inherited property must by compatible
with the data type of the property.
If you try to initialize a property with a value of an incompatible data type, the Flex
compiler issues an error.
Defining events in ActionScript
components
Flex components dispatch their own events and listen to other events. An object that wants to
know about another object's events registers as a listener with that object. When an event
occurs, the object dispatches the event to all registered listeners.
The core class of the Flex architecture, mx.core.UIComponent, defines core events, such as
,
updateComplete
resize
components. Subclasses of these classes inherit and dispatch these events.
140
Creating Simple Visual Components in ActionScript
property of a TextInput control does not match an inherited property
,
,
move
creationComplete
property defines the name of
id
, and others that are fundamental to all

Advertisement

Table of Contents
loading

Table of Contents