Package | com.joebillman.containers |
Class | public class Window |
Inheritance | Window ![]() |
Property | Defined By | ||
---|---|---|---|
autoMask : Boolean
Gets or sets the autoMask value
| Window | ||
blurAmount : Number
Gets or sets the blur amount
| Window | ||
btmCurve : Number
Gets or sets the amount of curve on the bottom corners
| Window | ||
btnColor : uint
Gets or sets the color of the close button
| Window | ||
btnOverColor : uint
Gets or sets the color of the close button over glow
| Window | ||
btnSymbolColor : uint
Gets or sets the color of the 'X' symbol in the close button
| Window | ||
closeOnX : Boolean
Gets or sets whether the window closes automatically when the X button is pressed
| Window | ||
color : uint
Gets or sets the color value of the window
| Window | ||
colorAlpha : Number
Gets or sets the alpha value of the window
| Window | ||
content : DisplayObject
Gets or sets a reference to the content for the window
| Window | ||
contentBGAlpha : Number
Gets or sets the alpha of the inset content area for the window
| Window | ||
contentBGColor : uint
Gets or sets the color of the content area for the window
| Window | ||
contentHeight : Number
Gets or sets the value of the content height of the window
| Window | ||
contentWidth : Number
Gets or sets the value of the content width of the window
| Window | ||
contentX : Number
Gets or sets the value of the content starting x position
| Window | ||
contentY : Number
Gets or sets the value of the content starting y position
| Window | ||
curParent : DisplayObjectContainer
Gets or sets a reference to the parent value of the window
| Window | ||
destroyOnFade : Boolean
Gets or sets a reference to the destroyOnFade value
| Window | ||
fadeInOnBuild : Boolean
Gets or sets whether to fade in or not when buildWindow is called
| Window | ||
fadeInTime : Number
Gets or sets the time in seconds for the fade in
| Window | ||
fadeOutOnDestroy : Boolean
Gets or sets whether to fade out or not when destroyWindow is called
| Window | ||
fadeOutTime : Number
Gets or sets the time in seconds for the fade out
| Window | ||
hasBlur : Boolean
Gets or sets the blur mode for the window
| Window | ||
hasCloseX : Boolean
Gets the close X button mode for the window
| Window | ||
hasContentFill : Boolean
Gets or sets the main content fill for the window. | Window | ||
hasContentFillInset : Boolean
Gets or sets the main content inset for the window. | Window | ||
hasDropShadow : Boolean
Gets the drop shadow mode for the window
| Window | ||
hasTitleBG : Boolean
Gets or sets the value to signal whether to use a background inset fill behind the title in the top of the window
| Window | ||
hasTitleInset : Boolean
Gets or sets the inset on the text used as the title in the top of the window
| Window | ||
height : Number [override]
Gets or sets the value of the current height of the window
| Window | ||
icon : String
Gets or sets the icon for the window. | Window | ||
isCentered : Boolean | Window | ||
isDraggable : Boolean
Gets or sets whether the window is draggable or not
| Window | ||
isFading : Boolean [read-only]
Gets the window is currently fading. | Window | ||
isModal : Boolean
Gets or sets the modal mode for the window
| Window | ||
isPaddedToTitle : Boolean
Gets or sets whether to size the title background to the title or to the window. | Window | ||
isVisible : Boolean
Gets or sets visibility of the window. | Window | ||
leftAlignTitle : Boolean
Gets or sets the left align of the title. | Window | ||
modalAlpha : Number
Gets or sets the alpha of the modal. | Window | ||
modalColor : uint
Gets or sets the color of the modal. | Window | ||
ratio : Number
Gets or sets the ratio used in scaling the window. | Window | ||
sizeToContent : Boolean
Gets or sets whether the window is sized to the content. | Window | ||
title : String
Gets or sets the title for the window
| Window | ||
titleBGColor : uint
Gets or sets the color of the background of the title fill
| Window | ||
titleBGPadding : Number
Gets or sets the padding to be used for the background title fill
| Window | ||
titleColor : uint
Gets or sets the color value of the title text
| Window | ||
titleFormat : TextFormat
Gets or sets the title format for the window
| Window | ||
titleInsetColor : uint
Gets or sets the title inset color
| Window | ||
title_txt : TextField [read-only]
Gets a reference to the content for the window
| Window | ||
topCurve : Number
Gets or sets the amount of curve on the top corners
| Window | ||
updateBlur : Boolean
Gets or sets whether or not to update the blur. | Window | ||
width : Number [override]
Gets or sets a value for the current width of the window. | Window | ||
x : Number [override]
Gets or sets the x value of the window. | Window | ||
y : Number [override]
Gets or sets the y value of the window. | Window |
Method | Defined By | ||
---|---|---|---|
Window(content:DisplayObject = null)
The default constructor has an optional content parameter. | Window | ||
applyMask():void
Creates and applies a mask to the content
| Window | ||
build(customAlignW:Number = 0, customAlignH:Number = 0, delayTime:Number = 0):void
This function calls all the functions neccessary to build the pop-in window. | Window | ||
cleanup(complete:Boolean = true):void
This function removes any and all references created by the window
| Window | ||
destroyWindow():void
This function dispatches an event to destroy the pop in window
| Window | ||
fadeIn(delayTime:Number = 0, duration:Number):void
Fades window in
| Window | ||
fadeOut(delayTime:Number = 0, duration:Number):void
Fades window out
| Window | ||
rebuild(customAlignW:Number = 0, customAlignH:Number = 0):void
Rebuilds window
| Window |
Method | Defined By | ||
---|---|---|---|
onFadeOut():void
Handles when the fade out is finished
| Window |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when the window is destroyed by pushing the corner x button. | Window | |||
Dispatched when the window is destroyed by pushing the corner x button and closeOnX is set to true. | Window | |||
Dispatched when the window begins to fade in. | Window | |||
Dispatched when the window has faded in. | Window | |||
Dispatched when the window begins to fade out. | Window | |||
Dispatched when the window has faded out. | Window |
autoMask | property |
autoMask:Boolean
Gets or sets the autoMask value
The default value is true
.
public function get autoMask():Boolean
public function set autoMask(value:Boolean):void
blurAmount | property |
blurAmount:Number
Gets or sets the blur amount
The default value is 5
.
public function get blurAmount():Number
public function set blurAmount(value:Number):void
btmCurve | property |
btmCurve:Number
Gets or sets the amount of curve on the bottom corners
The default value is 0
.
public function get btmCurve():Number
public function set btmCurve(value:Number):void
btnColor | property |
btnColor:uint
Gets or sets the color of the close button
The default value is 0xCC0000
.
public function get btnColor():uint
public function set btnColor(value:uint):void
btnOverColor | property |
btnOverColor:uint
Gets or sets the color of the close button over glow
The default value is 0xFF0000
.
public function get btnOverColor():uint
public function set btnOverColor(value:uint):void
btnSymbolColor | property |
btnSymbolColor:uint
Gets or sets the color of the 'X' symbol in the close button
The default value is 0xFFFFFF
.
public function get btnSymbolColor():uint
public function set btnSymbolColor(value:uint):void
closeOnX | property |
closeOnX:Boolean
Gets or sets whether the window closes automatically when the X button is pressed
The default value is true
.
public function get closeOnX():Boolean
public function set closeOnX(value:Boolean):void
color | property |
color:uint
Gets or sets the color value of the window
The default value is 0x000000
.
public function get color():uint
public function set color(value:uint):void
colorAlpha | property |
colorAlpha:Number
Gets or sets the alpha value of the window
The default value is 1
.
public function get colorAlpha():Number
public function set colorAlpha(value:Number):void
content | property |
content:DisplayObject
Gets or sets a reference to the content for the window
The default value is null
.
public function get content():DisplayObject
public function set content(value:DisplayObject):void
contentBGAlpha | property |
contentBGAlpha:Number
Gets or sets the alpha of the inset content area for the window
The default value is .95
.
public function get contentBGAlpha():Number
public function set contentBGAlpha(value:Number):void
contentBGColor | property |
contentBGColor:uint
Gets or sets the color of the content area for the window
The default value is 0xFFFFFF
.
public function get contentBGColor():uint
public function set contentBGColor(value:uint):void
contentHeight | property |
contentHeight:Number
Gets or sets the value of the content height of the window
The default value is 62
.
public function get contentHeight():Number
public function set contentHeight(value:Number):void
contentWidth | property |
contentWidth:Number
Gets or sets the value of the content width of the window
The default value is 86
.
public function get contentWidth():Number
public function set contentWidth(value:Number):void
contentX | property |
contentX:Number
Gets or sets the value of the content starting x position
The default value is 7
.
public function get contentX():Number
public function set contentX(value:Number):void
contentY | property |
contentY:Number
Gets or sets the value of the content starting y position
The default value is 29
.
public function get contentY():Number
public function set contentY(value:Number):void
curParent | property |
curParent:DisplayObjectContainer
Gets or sets a reference to the parent value of the window
The default value is null
.
public function get curParent():DisplayObjectContainer
public function set curParent(value:DisplayObjectContainer):void
destroyOnFade | property |
destroyOnFade:Boolean
Gets or sets a reference to the destroyOnFade value
The default value is null
.
public function get destroyOnFade():Boolean
public function set destroyOnFade(value:Boolean):void
fadeInOnBuild | property |
fadeInOnBuild:Boolean
Gets or sets whether to fade in or not when buildWindow is called
The default value is true
.
public function get fadeInOnBuild():Boolean
public function set fadeInOnBuild(value:Boolean):void
fadeInTime | property |
fadeInTime:Number
Gets or sets the time in seconds for the fade in
The default value is 2
.
public function get fadeInTime():Number
public function set fadeInTime(value:Number):void
fadeOutOnDestroy | property |
fadeOutOnDestroy:Boolean
Gets or sets whether to fade out or not when destroyWindow is called
The default value is true
.
public function get fadeOutOnDestroy():Boolean
public function set fadeOutOnDestroy(value:Boolean):void
fadeOutTime | property |
fadeOutTime:Number
Gets or sets the time in seconds for the fade out
The default value is 1
.
public function get fadeOutTime():Number
public function set fadeOutTime(value:Number):void
hasBlur | property |
hasBlur:Boolean
Gets or sets the blur mode for the window
The default value is true
.
public function get hasBlur():Boolean
public function set hasBlur(value:Boolean):void
hasCloseX | property |
hasCloseX:Boolean
Gets the close X button mode for the window
The default value is true
.
public function get hasCloseX():Boolean
public function set hasCloseX(value:Boolean):void
hasContentFill | property |
hasContentFill:Boolean
Gets or sets the main content fill for the window. When this is true a box is drawn to represent the content area. Leaving this off will leave the window at the window color with no differentiation for the content area
The default value is true
.
public function get hasContentFill():Boolean
public function set hasContentFill(value:Boolean):void
hasContentFillInset | property |
hasContentFillInset:Boolean
Gets or sets the main content inset for the window. When this is true a inset effect is drawn around the box that represents the content area.
The default value is true
.
public function get hasContentFillInset():Boolean
public function set hasContentFillInset(value:Boolean):void
hasDropShadow | property |
hasDropShadow:Boolean
Gets the drop shadow mode for the window
The default value is true
.
public function get hasDropShadow():Boolean
public function set hasDropShadow(value:Boolean):void
hasTitleBG | property |
hasTitleBG:Boolean
Gets or sets the value to signal whether to use a background inset fill behind the title in the top of the window
The default value is false
.
public function get hasTitleBG():Boolean
public function set hasTitleBG(value:Boolean):void
hasTitleInset | property |
hasTitleInset:Boolean
Gets or sets the inset on the text used as the title in the top of the window
The default value is false
.
public function get hasTitleInset():Boolean
public function set hasTitleInset(value:Boolean):void
height | property |
height:Number
[override] Gets or sets the value of the current height of the window
The default value is 100
.
public function get height():Number
public function set height(value:Number):void
icon | property |
icon:String
Gets or sets the icon for the window. Note: 24 X 24 is the optimized size
The default value is null
.
public function get icon():String
public function set icon(value:String):void
isCentered | property |
public var isCentered:Boolean
isDraggable | property |
isDraggable:Boolean
Gets or sets whether the window is draggable or not
The default value is true
.
public function get isDraggable():Boolean
public function set isDraggable(value:Boolean):void
isFading | property |
isFading:Boolean
[read-only] Gets the window is currently fading.
The default value is true
.
public function get isFading():Boolean
isModal | property |
isModal:Boolean
Gets or sets the modal mode for the window
The default value is false
.
public function get isModal():Boolean
public function set isModal(value:Boolean):void
isPaddedToTitle | property |
isPaddedToTitle:Boolean
Gets or sets whether to size the title background to the title or to the window. When set to true the title background fill will size itself to the title text plus the padding. When set to false it will size to the window minus the padding
The default value is true
.
public function get isPaddedToTitle():Boolean
public function set isPaddedToTitle(value:Boolean):void
isVisible | property |
isVisible:Boolean
Gets or sets visibility of the window.
The default value is true
.
public function get isVisible():Boolean
public function set isVisible(value:Boolean):void
leftAlignTitle | property |
leftAlignTitle:Boolean
Gets or sets the left align of the title.
The default value is false
.
public function get leftAlignTitle():Boolean
public function set leftAlignTitle(value:Boolean):void
modalAlpha | property |
modalAlpha:Number
Gets or sets the alpha of the modal.
The default value is .25
.
public function get modalAlpha():Number
public function set modalAlpha(value:Number):void
modalColor | property |
modalColor:uint
Gets or sets the color of the modal.
The default value is .25
.
public function get modalColor():uint
public function set modalColor(value:uint):void
ratio | property |
ratio:Number
Gets or sets the ratio used in scaling the window.
The default value is 1
.
public function get ratio():Number
public function set ratio(value:Number):void
sizeToContent | property |
sizeToContent:Boolean
Gets or sets whether the window is sized to the content.
The default value is true
.
public function get sizeToContent():Boolean
public function set sizeToContent(value:Boolean):void
title | property |
title:String
Gets or sets the title for the window
The default value is ""
.
public function get title():String
public function set title(value:String):void
title_txt | property |
title_txt:TextField
[read-only] Gets a reference to the content for the window
public function get title_txt():TextField
titleBGColor | property |
titleBGColor:uint
Gets or sets the color of the background of the title fill
The default value is 0xCC0000
.
public function get titleBGColor():uint
public function set titleBGColor(value:uint):void
titleBGPadding | property |
titleBGPadding:Number
Gets or sets the padding to be used for the background title fill
The default value is 6
.
public function get titleBGPadding():Number
public function set titleBGPadding(value:Number):void
titleColor | property |
titleColor:uint
Gets or sets the color value of the title text
The default value is 0xFFFFFF
.
public function get titleColor():uint
public function set titleColor(value:uint):void
titleFormat | property |
titleFormat:TextFormat
Gets or sets the title format for the window
The default value is 15 Arial 0xFFFFFF
.
public function get titleFormat():TextFormat
public function set titleFormat(value:TextFormat):void
titleInsetColor | property |
titleInsetColor:uint
Gets or sets the title inset color
The default value is 0x000000
.
public function get titleInsetColor():uint
public function set titleInsetColor(value:uint):void
topCurve | property |
topCurve:Number
Gets or sets the amount of curve on the top corners
The default value is 10
.
public function get topCurve():Number
public function set topCurve(value:Number):void
updateBlur | property |
updateBlur:Boolean
Gets or sets whether or not to update the blur. This would be useful if the parent has children with movement
The default value is false
.
public function get updateBlur():Boolean
public function set updateBlur(value:Boolean):void
width | property |
width:Number
[override] Gets or sets a value for the current width of the window.
The default value is 100
.
public function get width():Number
public function set width(value:Number):void
x | property |
x:Number
[override] Gets or sets the x value of the window.
The default value is 0
.
public function get x():Number
public function set x(value:Number):void
y | property |
y:Number
[override] Gets or sets the y value of the window.
The default value is 0
.
public function get y():Number
public function set y(value:Number):void
Window | () | Constructor |
public function Window(content:DisplayObject = null)
The default constructor has an optional content parameter. It also initializes variables
Parameterscontent:DisplayObject (default = null ) — Optional. Content used in the window. It saves one step in that you don't need to then call .content
|
applyMask | () | method |
public function applyMask():void
Creates and applies a mask to the content
build | () | method |
public function build(customAlignW:Number = 0, customAlignH:Number = 0, delayTime:Number = 0):void
This function calls all the functions neccessary to build the pop-in window. It calls functions to build the default text formats, creates a drop shadow if needed and draw the window
Parameters
customAlignW:Number (default = 0 ) — A custom number used as the width of the parent. This is important when it comes to centering the window.
| |
customAlignH:Number (default = 0 ) — A custom number used as the height of the parent. This is important when it comes to centering the window.
| |
delayTime:Number (default = 0 )
|
cleanup | () | method |
public function cleanup(complete:Boolean = true):void
This function removes any and all references created by the window
Parameters
complete:Boolean (default = true )
|
destroyWindow | () | method |
public function destroyWindow():void
This function dispatches an event to destroy the pop in window
fadeIn | () | method |
public function fadeIn(delayTime:Number = 0, duration:Number):void
Fades window in
Parameters
delayTime:Number (default = 0 )
| |
duration:Number (default = NaN )
|
fadeOut | () | method |
public function fadeOut(delayTime:Number = 0, duration:Number):void
Fades window out
Parameters
delayTime:Number (default = 0 )
| |
duration:Number (default = NaN )
|
onFadeOut | () | method |
protected function onFadeOut():void
Handles when the fade out is finished
rebuild | () | method |
public function rebuild(customAlignW:Number = 0, customAlignH:Number = 0):void
Rebuilds window
Parameters
customAlignW:Number (default = 0 ) — A custom number used as the width of the parent. This is important when it comes to centering the window.
| |
customAlignH:Number (default = 0 ) — A custom number used as the height of the parent. This is important when it comes to centering the window.
|
CLOSE | Event |
bf.containers.events.WindowEvent
bf.containers.events.WindowEvent
Dispatched when the window is destroyed by pushing the corner x button.
CLOSE_BTN | Event |
bf.containers.events.WindowEvent
bf.containers.events.WindowEvent
Dispatched when the window is destroyed by pushing the corner x button and closeOnX is set to true.
FADE_IN | Event |
bf.containers.events.WindowEvent
bf.containers.events.WindowEvent
Dispatched when the window begins to fade in.
FADE_IN_COMPLETE | Event |
bf.containers.events.WindowEvent
bf.containers.events.WindowEvent
Dispatched when the window has faded in.
FADE_OUT | Event |
bf.containers.events.WindowEvent
bf.containers.events.WindowEvent
Dispatched when the window begins to fade out.
FADE_OUT_COMPLETE | Event |
bf.containers.events.WindowEvent
bf.containers.events.WindowEvent
Dispatched when the window has faded out.
Note: The order of the statements is important. All changes must be made prior to calling build() and build() must be called after addChild().
Important GC Info: Make sure to listen for the close event. In that handler function make sure to remove the close listener, null the content variable if you used one, call removeChild() for the window and null out the window variable in that order.
package { import bf.containers.Window; import bf.containers.events.WindowEvent; import flash.display.MovieClip; import flash.display.Sprite; public class WindowExample extends MovieClip { private var myWindow:Window; public function WindowExample() { _init(); } private function _init():void { var winContent:Sprite = new Sprite(); winContent.graphics.beginFill(0x0066CC); winContent.graphics.drawRect(0,0,300,225); winContent.graphics.endFill(); myWindow = new Window(winContent); myWindow.title = "This window rocks!"; myWindow.hasTitleBG = true; myWindow.addEventListener(WindowEvent.CLOSE, handleClose); addChild(myWindow); myWindow.build(); } private function handleClose(evt:WindowEvent):void { myWindow.removeEventListener(WindowEvent.CLOSE, handleClose); removeChild(myWindow); myWindow = null; } } }