Class org.aswing.FloorPane

Description

Abstract class for A container with a decorative floor movieclip.

External content will be load automatically when the pane was create on the stage if floorEnabled.

See Also

Field Index

BOTTOM, CENTER, LEFT, PREFER_SIZE_BOTH, PREFER_SIZE_IMAGE, PREFER_SIZE_LAYOUT, RIGHT, TOP

Inherited from Container

Inherited from Component

Inherited from EventDispatcher

Method Index

disableFloor(), doLayout(), enableFloor(), getFloorMC(), getFloorOriginalSize(), getHorizontalAlignment(), getOffsetX(), getOffsetY(), getPath(), getPrefferSizeStrategy(), getVerticalAlignment(), isEnabledFloor(), isLoaded(), isMaskFloor(), isScaleImage(), reload(), setHorizontalAlignment(), setMaskFloor(), setOffsetX(), setOffsetY(), setPath(), setPrefferSizeStrategy(), setScaleImage(), setVerticalAlignment()

Inherited from Container

Inherited from Component

Inherited from EventDispatcher

Field Detail

PREFER_SIZE_BOTH

static public PREFER_SIZE_BOTH:Number
preffered size of this component will be the fit to contain both size of extenal image/animation and counted from LayoutManager

PREFER_SIZE_IMAGE

static public PREFER_SIZE_IMAGE:Number
preffered size of this component will be the size of extenal image/animation

PREFER_SIZE_LAYOUT

static public PREFER_SIZE_LAYOUT:Number
preffered size of this component will be counted by LayoutManager

CENTER

static public CENTER:Number
A fast access to ASWingConstants Constant

See Also

TOP

static public TOP:Number
A fast access to ASWingConstants Constant

See Also

LEFT

static public LEFT:Number
A fast access to ASWingConstants Constant

See Also

BOTTOM

static public BOTTOM:Number
A fast access to ASWingConstants Constant

See Also

RIGHT

static public RIGHT:Number
A fast access to ASWingConstants Constant

See Also

Method Detail

setPath

public function setPath(path:String):Void

Sets the path to load/attach image/animation file or symbol. This method will cause reload() action if the path is different from old one.

Parameters

paththe path of external image/animation file or the linkageID of a symbol.

See Also

getPath

public function getPath():String

setPrefferSizeStrategy

public function setPrefferSizeStrategy(p:Number):Void

Sets the preffered size counting strategy. Must be one of below:

getPrefferSizeStrategy

public function getPrefferSizeStrategy():Number

Returns the preffered size counting strategy.

See Also

getVerticalAlignment

public function getVerticalAlignment():Number

Returns the vertical alignment of the image/animation.

Return

the verticalAlignment property, one of the following values:

  • ASWingConstants.CENTER (the default)
  • ASWingConstants.TOP
  • ASWingConstants.BOTTOM

setVerticalAlignment

public function setVerticalAlignment(alignment:Number):Void

Sets the vertical alignment of the image/animation.

Parameters

alignmentone of the following values:
  • ASWingConstants.CENTER (the default)
  • ASWingConstants.TOP
  • ASWingConstants.BOTTOM
Default is TOP.

getHorizontalAlignment

public function getHorizontalAlignment():Number

Returns the horizontal alignment of the image/animation.

Return

the horizontalAlignment property, one of the following values:

  • ASWingConstants.RIGHT (the default)
  • ASWingConstants.LEFT
  • ASWingConstants.CENTER
Default is LEFT.

setHorizontalAlignment

public function setHorizontalAlignment(alignment:Number):Void

Sets the horizontal alignment of the image/animation.

Parameters

alignmentone of the following values:
  • ASWingConstants.RIGHT (the default)
  • ASWingConstants.LEFT
  • ASWingConstants.CENTER

setScaleImage

public function setScaleImage(b:Boolean):Void

Sets whether need scale the loaded image/animation to fit the pane's size.

Note:Take care to use scaleImage to load a swf, because swf has different size at different frame or when some symbol invisible/visible.

Parameters

bwhether need scale the loaded image/animation to fit the pane's size.

isScaleImage

public function isScaleImage():Boolean

Returns whether need scale the loaded image/animation to fit the pane's size.

Return

whether need scale the loaded image/animation to fit the pane's size.

setOffsetX

public function setOffsetX(offset:Number):Void

Sets the x offset of the position of the loaded image/animation. If you dont want to locate the content to the topleft of the pane, you can set the offsets.

Parameters

offsetthe x offset

setOffsetY

public function setOffsetY(offset:Number):Void

Sets the y offset of the position of the loaded image/animation. If you dont want to locate the content to the topleft of the pane, you can set the offsets.

Parameters

offsetthe y offset

getOffsetX

public function getOffsetX():Number

See Also

getOffsetY

public function getOffsetY():Number

See Also

getFloorMC

public function getFloorMC():MovieClip

Returns the floor target movie clip.
You should take care to do operation at this MC, if you remove it, the component will create another instead when next reload.

Return

the movieclip where the extenal image/animation will be loaded in or the movieclip attached.

See Also

disableFloor

public function disableFloor():Void

Disable the load ability. Removes loaded image or animation(by remove the LoadTarget MovieClip). And will not load any thing from now on.

See Also

enableFloor

public function enableFloor():Void

Enable the load ability, can call reload to try to load content if it is not loaded yet.

See Also

isEnabledFloor

public function isEnabledFloor():Boolean

Returns whether load function is enabled. Default is true.

See Also

isLoaded

public function isLoaded():Boolean

Returns is the extenal image/animation file was loaded ok.

Return

true if the file loaded ok, otherwish return false

getFloorOriginalSize

public function getFloorOriginalSize():Dimension

Returns the extenal image/animation/symbol 's original size. If the external content are not loaded yet, return null.

Return

the extenal content's original size. null if it is not loaded yet.

doLayout

public function doLayout():Void

layout this container

reload

public function reload():Void

Reload the floor image/animation when enabledFoor. otherwish do nothing.

See Also

isMaskFloor

public function isMaskFloor():Boolean

setMaskFloor

public function setMaskFloor(m:Boolean):Void