Packagecom.pcthomatos.components.swfscroll
Classpublic class SWFScroll
InheritanceSWFScroll Inheritance flash.display.Sprite

The SWFScroll class is the main class of the SWFScroll Project. It can render scrollbars horizontally, vertically or both horizontally and vertically.

Note: This class is primarily used when building fullscreen flash websites that need scrollbars to dynamically resize.
For easier implementation use the wrapper class See com.pcthomatos.components.swfscroll.SWFScrollFrame.

Some of the features of SWFScroll are:

See also

com.pcthomatos.components.swfscroll.SWFScrollFrame
com.pcthomatos.components.swfscroll.SWFScrollStaticSettings


Public Properties
 PropertyDefined by
  buttonBgColor : uint
[write-only] Sets the button background color.
SWFScroll
  buttonBgColorActive : uint
[write-only] Sets the button background color active state.
SWFScroll
  buttonBgColorOn : uint
[write-only] Sets the button background color on state.
SWFScroll
  buttonBgColorOver : uint
[write-only] Sets the button background color over state.
SWFScroll
  buttonTriangleColor : uint
[write-only] Sets the color of the triangle arrow inside the scroll button.
SWFScroll
  graceArea : int
[write-only] Sets the grace area of the scrubber in case a user's mouse isn't directly on the scrubber.
SWFScroll
  scrollbarSize : int
[write-only] Sets the thickness of the scrollbar.
SWFScroll
  scrollingArea : Sprite
Gives direct access to the scrolling area for x, y manipulation or scrolling area swapping.
SWFScroll
  scrubberBgColor : uint
[write-only] Sets the scrubber background color Applies to the current instance only.
SWFScroll
  scrubberBgColorActive : uint
[write-only] Sets the scrubber background color active state.
SWFScroll
  scrubberBgColorOn : uint
[write-only] Sets the scrubber background color on state.
SWFScroll
  scrubberBgColorOver : uint
[write-only] Sets the scrubber background color over state.
SWFScroll
  trackBgColor : uint
[write-only] Sets the scroll track background color.
SWFScroll
Public Methods
 MethodDefined by
  
SWFScroll(frameAreaP:Sprite, scrollingAreaP:Sprite, minWidthP:int, minHeightP:int, stageP:Stage, browserScrollMimicP:Boolean = false)
Creates the SWFScroll Object
SWFScroll
  
clean():void
Destructor method.
SWFScroll
  
Hides scrollbars until a showOrHide method is called again.
SWFScroll
  
originalframeAreaSize(frameWidthP:int, frameHeightP:int):void
Reverts to the original minimum width and minimum height properties.
SWFScroll
  
originalframeAreaSizeH(frameWidthP:int, frameHeightP:int):void
Reverts to the original minimum width and minimum height properties.
SWFScroll
  
originalframeAreaSizeV(frameWidthP:int, frameHeightP:int):void
Reverts to the original minimum width and minimum height properties.
SWFScroll
  
resetframeAreaSize(newMinWidthP:int, newMinHeightP:int, frameWidthP:int, frameHeightP:int):void
Updates the minimum width and minimum height properties.
SWFScroll
  
resetframeAreaSizeH(newMinWidthP:int, newMinHeightP:int, frameWidthP:int, frameHeightP:int):void
Updates the minimum width and minimum height properties.
SWFScroll
  
resetframeAreaSizeV(newMinWidthP:int, newMinHeightP:int, frameWidthP:int, frameHeightP:int):void
Updates the minimum width and minimum height properties.
SWFScroll
  
showOrHideScrollBarH(frameWidthP:int, frameHeightP:int):void
Displays a horizontal scrollbar depending on if the scrolling area width exceeds the frame width.
SWFScroll
  
showOrHideScrollBars(frameWidthP:int, frameHeightP:int):void
Displays a horizontal scrollbar depending on if the scrolling area width exceeds the frame width.
SWFScroll
  
showOrHideScrollBarV(frameWidthP:int, frameHeightP:int):void
Displays a vertical scrollbar depending on if the scrolling area height exceeds the frame height.
SWFScroll
  
Forces scrubbers to update.
SWFScroll
Property detail
buttonBgColorproperty
buttonBgColor:uint  [write-only]

Sets the button background color. Applies to the current instance only.

The default value is 0xD5D5D5.

Implementation
    public function set buttonBgColor(value:uint):void

See also

buttonBgColorActiveproperty 
buttonBgColorActive:uint  [write-only]

Sets the button background color active state. Applies to the current instance only.

The default value is 0x9EC7D9.

Implementation
    public function set buttonBgColorActive(value:uint):void

See also

buttonBgColorOnproperty 
buttonBgColorOn:uint  [write-only]

Sets the button background color on state. Applies to the current instance only.

The default value is 0xC5C5C5.

Implementation
    public function set buttonBgColorOn(value:uint):void

See also

buttonBgColorOverproperty 
buttonBgColorOver:uint  [write-only]

Sets the button background color over state. Applies to the current instance only.

The default value is 0xD6EEFB.

Implementation
    public function set buttonBgColorOver(value:uint):void

See also

buttonTriangleColorproperty 
buttonTriangleColor:uint  [write-only]

Sets the color of the triangle arrow inside the scroll button. Applies to the current instance only.

The default value is 0x252525.

Implementation
    public function set buttonTriangleColor(value:uint):void

See also

graceAreaproperty 
graceArea:int  [write-only]

Sets the grace area of the scrubber in case a user's mouse isn't directly on the scrubber. Applies to the current instance only.

The default value is 60.

Implementation
    public function set graceArea(value:int):void

See also

scrollbarSizeproperty 
scrollbarSize:int  [write-only]

Sets the thickness of the scrollbar. Applies to the current instance only.

The default value is 20.

Implementation
    public function set scrollbarSize(value:int):void

See also

scrollingAreaproperty 
public var scrollingArea:Sprite

Gives direct access to the scrolling area for x, y manipulation or scrolling area swapping.

scrubberBgColorproperty 
scrubberBgColor:uint  [write-only]

Sets the scrubber background color Applies to the current instance only.

The default value is 0xD5D5D5.

Implementation
    public function set scrubberBgColor(value:uint):void

See also

scrubberBgColorActiveproperty 
scrubberBgColorActive:uint  [write-only]

Sets the scrubber background color active state. Applies to the current instance only.

The default value is 0x9EC7D9.

Implementation
    public function set scrubberBgColorActive(value:uint):void

See also

scrubberBgColorOnproperty 
scrubberBgColorOn:uint  [write-only]

Sets the scrubber background color on state. Applies to the current instance only.

The default value is 0xC5C5C5.

Implementation
    public function set scrubberBgColorOn(value:uint):void

See also

scrubberBgColorOverproperty 
scrubberBgColorOver:uint  [write-only]

Sets the scrubber background color over state. Applies to the current instance only.

The default value is 0xD6EEFB.

Implementation
    public function set scrubberBgColorOver(value:uint):void

See also

trackBgColorproperty 
trackBgColor:uint  [write-only]

Sets the scroll track background color. Applies to the current instance only.

The default value is 0xE0E0E0.

Implementation
    public function set trackBgColor(value:uint):void

See also

Constructor detail
SWFScroll()constructor
public function SWFScroll(frameAreaP:Sprite, scrollingAreaP:Sprite, minWidthP:int, minHeightP:int, stageP:Stage, browserScrollMimicP:Boolean = false)

Creates the SWFScroll Object

Parameters
frameAreaP:Sprite — Container of the scrolled area. Usually the parent.
 
scrollingAreaP:Sprite — Area to be scrolled.
 
minWidthP:int — Minimum height before horizontal scrollbar appears.
 
minHeightP:int — Minimum width before vertical scrollbar appears.
 
stageP:Stage — An instance of Stage.
 
browserScrollMimicP:Boolean (default = false) — Allows your content to center when the browser window is bigger than the scrolling area and scroll when the browser window is smaller than the scrolling area.
Method detail
clean()method
public function clean():void

Destructor method. In order to properly destroy SWFScroll this method must be run first. Otherwise a memory leak will occur.

hideScrollBars()method 
public function hideScrollBars():void

Hides scrollbars until a showOrHide method is called again.

originalframeAreaSize()method 
public function originalframeAreaSize(frameWidthP:int, frameHeightP:int):void

Reverts to the original minimum width and minimum height properties. For use with both vertical and horizontal scrollbars.

Parameters
frameWidthP:int — Original minimum width.
 
frameHeightP:int — Original minimum height.
originalframeAreaSizeH()method 
public function originalframeAreaSizeH(frameWidthP:int, frameHeightP:int):void

Reverts to the original minimum width and minimum height properties. For use with horizontal scrollbars.

Parameters
frameWidthP:int — Original minimum width.
 
frameHeightP:int — Original minimum height.
originalframeAreaSizeV()method 
public function originalframeAreaSizeV(frameWidthP:int, frameHeightP:int):void

Reverts to the original minimum width and minimum height properties. For use with vertical scrollbars.

Parameters
frameWidthP:int — Original minimum width.
 
frameHeightP:int — Original minimum height.
resetframeAreaSize()method 
public function resetframeAreaSize(newMinWidthP:int, newMinHeightP:int, frameWidthP:int, frameHeightP:int):void

Updates the minimum width and minimum height properties. For use with both vertical and horizontal scrollbars.

Parameters
newMinWidthP:int — New minimum width.
 
newMinHeightP:int — New minimum height.
 
frameWidthP:int
 
frameHeightP:int
resetframeAreaSizeH()method 
public function resetframeAreaSizeH(newMinWidthP:int, newMinHeightP:int, frameWidthP:int, frameHeightP:int):void

Updates the minimum width and minimum height properties. For use with horizontal scrollbars.

Parameters
newMinWidthP:int — New minimum width.
 
newMinHeightP:int — New minimum height.
 
frameWidthP:int
 
frameHeightP:int
resetframeAreaSizeV()method 
public function resetframeAreaSizeV(newMinWidthP:int, newMinHeightP:int, frameWidthP:int, frameHeightP:int):void

Updates the minimum width and minimum height properties. For use with vertical scrollbars.

Parameters
newMinWidthP:int — New minimum width.
 
newMinHeightP:int — New minimum height.
 
frameWidthP:int
 
frameHeightP:int
showOrHideScrollBarH()method 
public function showOrHideScrollBarH(frameWidthP:int, frameHeightP:int):void

Displays a horizontal scrollbar depending on if the scrolling area width exceeds the frame width.

Parameters
frameWidthP:int — Current frame width.
 
frameHeightP:int — Current frame height.
showOrHideScrollBars()method 
public function showOrHideScrollBars(frameWidthP:int, frameHeightP:int):void

Displays a horizontal scrollbar depending on if the scrolling area width exceeds the frame width. Displays a vertical scrollbar depending on if the scrolling area height exceeds the frame height.

Parameters
frameWidthP:int — Current frame width.
 
frameHeightP:int — Current frame height.
showOrHideScrollBarV()method 
public function showOrHideScrollBarV(frameWidthP:int, frameHeightP:int):void

Displays a vertical scrollbar depending on if the scrolling area height exceeds the frame height.

Parameters
frameWidthP:int — Current frame width.
 
frameHeightP:int — Current frame height.
updateScrubbers()method 
public function updateScrubbers():void

Forces scrubbers to update.