Packageefnx.gui
Classpublic class ScrollArea
InheritanceScrollArea Inheritance flash.display.Sprite

ScrollArea is a sprite with scrollbars around a cropped area. The scrollbars are constructed with Buttons and TileBar.

See also

efnx.gui.Button
efnx.gui.TileBar


Public Properties
 PropertyDefined by
  background : TileArea
The tiled background object.
ScrollArea
  backgroundColor : uint = 0x00FFFFFF
The color of the background.
ScrollArea
  downArrow : Button
The lower scroll button.
ScrollArea
  height : Number
Sets the height of the ScrollArea.
ScrollArea
  leftArrow : Button
The left scroll button.
ScrollArea
  minHeight : uint
[read-only] Returns the minimum possible height of the ScrollArea.
ScrollArea
  minWidth : uint
[read-only] Returns the minimum possible width of the ScrollArea.
ScrollArea
  offsets : Object
The offsets object represents the number of pixels to allow the scrollBars to overlap the arrow buttons.
ScrollArea
  resize : Button
The resize button.
ScrollArea
  resizeable : Boolean = true
Determines whether or not the ScrollArea can be resized interactively from the resize button.
ScrollArea
  rightArrow : Button
The right scroll button.
ScrollArea
  scrollRate : uint = 10
The number of pixels ScrollArea will scroll per click of a scroll arrow.
ScrollArea
  scrollX : Number
Sets the horizontal scroll.
ScrollArea
  scrollY : Number
Sets the vertical scroll.
ScrollArea
  upArrow : Button
The upper scroll button.
ScrollArea
  width : Number
Sets the width of the ScrollArea.
ScrollArea
  xBar : TileBar
The horizontal scroll bar button.
ScrollArea
  xBarTrough : TileArea
The horizontal trough that the y scrollbar slides in.
ScrollArea
  yBar : TileBar
The vertical scroll bar button.
ScrollArea
  yBarTrough : TileArea
The vertical trough that the y scrollbar slides in.
ScrollArea
Public Methods
 MethodDefined by
  
ScrollArea
  
addContent(child:DisplayObject):DisplayObject
Adds a Display Object to the ScrollArea as content.
ScrollArea
  
addContentAt(child:DisplayObject, index:uint):DisplayObject
Adds a Display Object to the ScrollArea as content at the level index .
ScrollArea
  
inheritSkin(parent:ScrollArea):void
Applies the skin of a parent ScrollArea to this ScrollArea.
ScrollArea
  
init():void
The initialization function.
ScrollArea
  
removeContent(child:DisplayObject):DisplayObject
Removes a Display Object from the ScrollArea's content.
ScrollArea
  
removeContentAt(index:uint):DisplayObject
Removes a Display Object from the ScrollArea's content.
ScrollArea
  
xBarMove(event:MouseEvent):void
Moves the horizontal scroll bar.
ScrollArea
  
yBarMove(event:MouseEvent):void
Moves the horizontal scroll bar.
ScrollArea
Property detail
backgroundproperty
public var background:TileArea

The tiled background object. This will be visible behind your added content. If no bitmapData is supplied resizing will be much faster. This is really just for spiffy looks. If you want just one solid colored background, and not a tiled one, check out backgroundColor.

See also

backgroundColorproperty 
public var backgroundColor:uint = 0x00FFFFFF

The color of the background. This will not be shown if you have supplied background with a reference to a BitmapData object.

See also

downArrowproperty 
public var downArrow:Button

The lower scroll button. This button needs to be supplied with up, over and down references to bitmapData.

See also

heightproperty 
height:Number  [read-write]

Sets the height of the ScrollArea.

Implementation
    public function get height():Number
    public function set height(value:Number):void
leftArrowproperty 
public var leftArrow:Button

The left scroll button. This button needs to be supplied with up, over and down references to bitmapData.

See also

minHeightproperty 
minHeight:uint  [read-only]

Returns the minimum possible height of the ScrollArea.

Implementation
    public function get minHeight():uint
minWidthproperty 
minWidth:uint  [read-only]

Returns the minimum possible width of the ScrollArea.

Implementation
    public function get minWidth():uint
offsetsproperty 
public var offsets:Object

The offsets object represents the number of pixels to allow the scrollBars to overlap the arrow buttons. Members of offsets are rightArrow leftArrow upArrow downArrow

resizeproperty 
public var resize:Button

The resize button. This button needs to be supplied with up, over and down references to bitmapData.

See also

resizeableproperty 
public var resizeable:Boolean = true

Determines whether or not the ScrollArea can be resized interactively from the resize button.

The default value is true.

rightArrowproperty 
public var rightArrow:Button

The right scroll button. This button needs to be supplied with up, over and down references to bitmapData.

See also

scrollRateproperty 
public var scrollRate:uint = 10

The number of pixels ScrollArea will scroll per click of a scroll arrow.

The default value is 10.

scrollXproperty 
scrollX:Number  [read-write]

Sets the horizontal scroll.

Implementation
    public function get scrollX():Number
    public function set scrollX(value:Number):void
scrollYproperty 
scrollY:Number  [read-write]

Sets the vertical scroll.

Implementation
    public function get scrollY():Number
    public function set scrollY(value:Number):void
upArrowproperty 
public var upArrow:Button

The upper scroll button. This button needs to be supplied with up, over and down references to bitmapData.

See also

widthproperty 
width:Number  [read-write]

Sets the width of the ScrollArea.

Implementation
    public function get width():Number
    public function set width(value:Number):void
xBarproperty 
public var xBar:TileBar

The horizontal scroll bar button. This bar scales to represent the visible horizontal area of the ScrollArea. This instance of TileBar needs to be supplied with left, middle and right references to bitmapData.

See also

xBarTroughproperty 
public var xBarTrough:TileArea

The horizontal trough that the y scrollbar slides in. This represents the total area taken up by the ScrollArea's content. This instance of TileArea needs to be supplied with a reference to a bitmapData.

yBarproperty 
public var yBar:TileBar

The vertical scroll bar button. This bar scales to represent the visible vertical area of the ScrollArea. This instance of TileBar needs to be supplied with top, middle and bottom references to bitmapData.

yBarTroughproperty 
public var yBarTrough:TileArea

The vertical trough that the y scrollbar slides in. This represents the total area taken up by the ScrollArea's content. This instance of TileArea needs to be supplied with a reference to a bitmapData.

Constructor detail
ScrollArea()constructor
public function ScrollArea()

Method detail
addContent()method
public function addContent(child:DisplayObject):DisplayObject

Adds a Display Object to the ScrollArea as content. This is much like addChild(). Display Objects added with addContent can be removed with removeContent() and removeContentAt().

Parameters
child:DisplayObject — The Display Object to add.

Returns
DisplayObject — A reference to the added Display Object

See also

addContentAt()method 
public function addContentAt(child:DisplayObject, index:uint):DisplayObject

Adds a Display Object to the ScrollArea as content at the level index . This is much like addChildAt(). Display Objects added with addContentAt can be removed with removeContent() and removeContentAt().

Parameters
child:DisplayObject — The Display Object to add.
 
index:uint — The level in which to add child.

Returns
DisplayObject — A reference to the added Display Object

See also

inheritSkin()method 
public function inheritSkin(parent:ScrollArea):void

Applies the skin of a parent ScrollArea to this ScrollArea.

Parameters
parent:ScrollArea — The ScrollArea to inherit the skin from.
init()method 
public function init():void

The initialization function. Call this after supplying resource BitmapData to leftArrow, rightArrow, upArrow, downArrow, xBar, yBar, xBarTrough, yBarTrough and after specifying a width and a height. This function will correctly place all buttons in the ScrollArea. Hopefully.

See also

removeContent()method 
public function removeContent(child:DisplayObject):DisplayObject

Removes a Display Object from the ScrollArea's content. This is much like removeChild(). Display Objects added with addContent() can be removed with removeContent() and removeContentAt().

Parameters
child:DisplayObject — The Display Object to add.

Returns
DisplayObject — A reference to the added Display Object

See also

removeContentAt()method 
public function removeContentAt(index:uint):DisplayObject

Removes a Display Object from the ScrollArea's content. This is much like removeChild(). Display Objects added with addContent() can be removed with removeContent() and removeContentAt().

Parameters
index:uint — The level from which to remove child.

Returns
DisplayObject — A reference to the added Display Object

See also

xBarMove()method 
public function xBarMove(event:MouseEvent):void

Moves the horizontal scroll bar.

Parameters
event:MouseEvent
yBarMove()method 
public function yBarMove(event:MouseEvent):void

Moves the horizontal scroll bar.

Parameters
event:MouseEvent