
50 Flex Classes
The alpha, scaleX, and scaleY properties
The alpha, scaleX, and scaleY properties now range from 0 to 1 instead of from 0 to 100.
For example, to make a UIObject 50% opaque, specify
alpha=0.5 instead of alpha=50. To
stretch the object horizontally by a factor of two, specify
scaleX=2 instead of scaleX=200.
The default value for the
focusAlpha property is now 0.3.
The width and height properties
The width and height properties are now typed as Number. In Flex 1.5, you could set the
width and height to a Number (such as 50) or a String (such as "50%"). Because the type is
now only a Number, you can no longer use the following syntax in your ActionScript:
myUIObject.width = "50%";
To set widths and heights using percentage values, you must now use the following syntax:
myUIObject.percentWidth = 50;
However, in MXML, you can express the width property as a pixel or percentage value. For
example, the following two lines of code are valid:
<Canvas width="50%">
<Canvas percentWidth="50">
The addEventHandler() method
The addEventHandler() method has been removed from UIObject. This method is now
inherited from the flash.events.EventDispatcher class.
NOTE
This change formerly applied to the UIObject class, but because UIObject and
UIComponent have been combined into a single base class, the change now applies to
the UIComponent class.
NOTE
This change formerly applied to the UIObject class, but because UIObject and
UIComponent have been combined into a single base class, the change now applies to
the UIComponent class.
NOTE
This change formerly applied to the UIObject class, but because UIObject and
UIComponent have been combined into a single base class, the change now applies to
the UIComponent class.
Komentáře k této Příručce