Adobe Flex 2 Language Reference - collected by Jimbob | Back to MY RESOURCES


Packagemx.core
Interfacepublic interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher
SubinterfacesIChartElement, IListItemRenderer, IToolTipManagerClient, IUIComponent
ImplementorsBitmapAsset, ButtonAsset, MovieClipAsset, MovieClipLoaderAsset, ProgrammaticSkin, SpriteAsset, SystemManager, TextFieldAsset, UIComponent

The IFlexDisplayObject interface defines the interface for skin elements. At a minimum, a skin must be a DisplayObject and implement this interface.



Public Properties
 PropertyDefined by
  alpha : Number
The transparency of this object.
IFlexDisplayObject
  height : Number
The height of this object, in pixels.
IFlexDisplayObject
  mask : DisplayObject
The DisplayObject used to mask this object so that only part of it is actually drawn.
IFlexDisplayObject
  measuredHeight : Number
[read-only] The measured height of this object.
IFlexDisplayObject
  measuredWidth : Number
[read-only] The measured width of this object.
IFlexDisplayObject
  name : String
The instance name of this object.
IFlexDisplayObject
  parent : DisplayObjectContainer
[read-only] The parent of this object.
IFlexDisplayObject
  scaleX : Number
The horizontal scaling factor for this object.
IFlexDisplayObject
  scaleY : Number
The vertical scaling factor for this object.
IFlexDisplayObject
  visible : Boolean
A flag that indicates whether this object is visible.
IFlexDisplayObject
  width : Number
The width of this object, in pixels.
IFlexDisplayObject
  x : Number
The horizontal position of this object relative to its parent, in pixel coordinates.
IFlexDisplayObject
  y : Number
The vertical position of this object relative to its parent, in pixel coordinates.
IFlexDisplayObject
Public Methods
 MethodDefined by
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
IEventDispatcher
 Inherited
Dispatches an event into the event flow.
IEventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
IEventDispatcher
  
move(x:Number, y:Number):void
Moves this object to the specified x and y coordinates.
IFlexDisplayObject
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
IEventDispatcher
  
setActualSize(newWidth:Number, newHeight:Number):void
Sets the actual size of this object.
IFlexDisplayObject
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
IEventDispatcher
Property detail
alphaproperty
alpha:Number  [read-write]

The transparency of this object. The value is a Number from 0.0 to 1.0, where 0.0 means transparent and 1.0 means fully opaque.

Implementation
    public function get alpha():Number
    public function set alpha(value:Number):void

See also

heightproperty 
height:Number  [read-write]

The height of this object, in pixels.

Implementation
    public function get height():Number
    public function set height(value:Number):void
maskproperty 
mask:DisplayObject  [read-write]

The DisplayObject used to mask this object so that only part of it is actually drawn. The mask object itself is not drawn.

Set mask to null to remove the mask.

To ensure that masking works when the stage is scaled, the mask display object must be in an active part of the display list.

Implementation
    public function get mask():DisplayObject
    public function set mask(value:DisplayObject):void

See also

measuredHeightproperty 
measuredHeight:Number  [read-only]

The measured height of this object.

This is typically hard-coded for graphical skins because this number is simply the number of pixels in the graphic. For code skins, it can also be hard-coded if you expect to be drawn at a certain size. If your size can change based on properties, you may want to also be an ILayoutManagerClient so a measure() method will be called at an appropriate time, giving you an opportunity to compute a measuredHeight.

Implementation
    public function get measuredHeight():Number
measuredWidthproperty 
measuredWidth:Number  [read-only]

The measured width of this object.

This is typically hard-coded for graphical skins because this number is simply the number of pixels in the graphic. For code skins, it can also be hard-coded if you expect to be drawn at a certain size. If your size can change based on properties, you may want to also be an ILayoutManagerClient so a measure() method will be called at an appropriate time, giving you an opportunity to compute a measuredHeight.

Implementation
    public function get measuredWidth():Number
nameproperty 
name:String  [read-write]

The instance name of this object.

Flash classes such as Sprite, TextField, etc. initialize the instance name to "instanceN", where N is a unique integer. Flex classes such as FlexSprite, FlexTextField, etc. initialize it to a string that combines the class name with a unique integer, such as "Button5". (This name is produced by the NameUtil.createUniqueName() method.) The Flex framework assigns instance names to some objects that it creates, such as "upSkin" for the "up"-state skin of a Button. If you have assigned an MXML id to this object, then the instance name is set to that id.

You can use the DisplayObjectContainer method getChildByName() to get an object by name from its parent container.

Implementation
    public function get name():String
    public function set name(value:String):void
parentproperty 
parent:DisplayObjectContainer  [read-only]

The parent of this object.

This property can be null if the object has not yet ben added to a DisplayObjectContainer with addChild() or addChildAt(), or if it has been removed from a DisplayObjectContainer with removeChild() or removeChildAt().

Implementation
    public function get parent():DisplayObjectContainer
scaleXproperty 
scaleX:Number  [read-write]

The horizontal scaling factor for this object. The value is a Number where 1.0 means the object isn't scaled horziontally, 2.0 means that it is stretched to twice its normal width, and 0.5 means that it is compressed to half its normal width.

Implementation
    public function get scaleX():Number
    public function set scaleX(value:Number):void
scaleYproperty 
scaleY:Number  [read-write]

The vertical scaling factor for this object. The value is a Number where 1.0 means the object isn't scaled vertically, 2.0 means that it is stretched to twice its normal height, and 0.5 means that it is compressed to half its normal height.

Implementation
    public function get scaleY():Number
    public function set scaleY(value:Number):void
visibleproperty 
visible:Boolean  [read-write]

A flag that indicates whether this object is visible.

Implementation
    public function get visible():Boolean
    public function set visible(value:Boolean):void
widthproperty 
width:Number  [read-write]

The width of this object, in pixels.

Implementation
    public function get width():Number
    public function set width(value:Number):void
xproperty 
x:Number  [read-write]

The horizontal position of this object relative to its parent, in pixel coordinates.

Implementation
    public function get x():Number
    public function set x(value:Number):void
yproperty 
y:Number  [read-write]

The vertical position of this object relative to its parent, in pixel coordinates.

Implementation
    public function get y():Number
    public function set y(value:Number):void
Method detail
move()method
public function move(x:Number, y:Number):void

Moves this object to the specified x and y coordinates.

Parameters
x:Number — The new x-position for this object.
 
y:Number — The new y-position for this object.
setActualSize()method 
public function setActualSize(newWidth:Number, newHeight:Number):void

Sets the actual size of this object.

This method is mainly for use in implementing the updateDisplayList() method, which is where you compute this object's actual size based on its explicit size, parent-relative (percent) size, and measured size. You then apply this actual size to the object by calling setActualSize().

In other situations, you should be setting properties such as width, height, percentWidth, or percentHeight rather than calling this method.

Parameters
newWidth:Number — The new width for this object.
 
newHeight:Number — The new height for this object.





collected by Jimbob 2007.05