mSprite

Sprite
mSprite

Preloader with color theme selection during main application load.

Summary
mSpritePreloader with color theme selection during main application load.
Public constructor
mSpritePreloader constructor.
Private methods
initInitializes text message fields.
onEnterFrameInitFirst creates color theme buttons one on each enter frame event, then switches to listen for mouse events.
onEnterFrameTermProgressively removes color theme buttons.
onMouseOverHighlights the color theme button the mouse hovers over.
onMouseOutRedraws the color theme button the mouse moved away from.
onMouseDownIf the mouse button was clicked down on a theme color button then stores the color and starts to remove the theme buttons.
removeButtonsStarts the progressive removal of the theme color buttons.
loadInitiates load of the main application
initHandlerIf the user already selected a theme color then starts the main application, otherwise unloads the loader, the application is ready in cache when the user has finished the color choice.
runContentInforms the main application of the selected theme color and adds it to the stage display list.
progressHandlerDisplays load progress information.
createScaleButtonCreates a color scale button and places it in a circle.
drawScaleButtonDraws a color scale button as a rounded rectangle with a gradient radial fill.
ioErrorHandlerDisplays a load error message.
securityErrorHandlerDisplays a security error message.
drawDraws a background rounded rectangle with a gradient radial fill.
MessageA dynamic text message class using the default font for minimal size.
Message constructor
MessageCreate a read-only text field with a default font.

Public constructor

mSprite

public function mSprite()

Preloader constructor.

Draws the background and informational messages.  Then initiates the main application load and concurrently uses enter frame events to draw a progressive selection of theme colors.  Uses mouse events to highlight theme colors.

Waits for load and theme color selection to be done before activating the main application with information about the selected theme color.

Private methods

init

private function init():void

Initializes text message fields.

onEnterFrameInit

private function onEnterFrameInit(event: Event):void

First creates color theme buttons one on each enter frame event, then switches to listen for mouse events.

onEnterFrameTerm

private function onEnterFrameTerm(event: Event):void

Progressively removes color theme buttons.  If the loader already finished loading then loads the application from cache.

onMouseOver

private function onMouseOver(event: MouseEvent):void

Highlights the color theme button the mouse hovers over.

onMouseOut

private function onMouseOut(event: MouseEvent):void

Redraws the color theme button the mouse moved away from.

onMouseDown

private function onMouseDown(event: MouseEvent):void

If the mouse button was clicked down on a theme color button then stores the color and starts to remove the theme buttons.

removeButtons

private function removeButtons():void

Starts the progressive removal of the theme color buttons.

load

private function load():void

Initiates load of the main application

initHandler

private function initHandler(event: Event):void

If the user already selected a theme color then starts the main application, otherwise unloads the loader, the application is ready in cache when the user has finished the color choice.

runContent

private function runContent():void

Informs the main application of the selected theme color and adds it to the stage display list.  Clears the preloader background graphics.

progressHandler

private function progressHandler(event: ProgressEvent):void

Displays load progress information.

createScaleButton

private function createScaleButton(i: uint):void

Creates a color scale button and places it in a circle.

drawScaleButton

private function drawScaleButton(button: Sprite,
color: uint):void

Draws a color scale button as a rounded rectangle with a gradient radial fill.

ioErrorHandler

private function ioErrorHandler(event: IOErrorEvent):void

Displays a load error message.

securityErrorHandler

private function securityErrorHandler(event: SecurityErrorEvent):void

Displays a security error message.

draw

private function draw():void

Draws a background rounded rectangle with a gradient radial fill.

Message

TextField
Message

A dynamic text message class using the default font for minimal size.

Summary
Message constructor
MessageCreate a read-only text field with a default font.

Message constructor

Message

public function Message(labelText: String,  
color: uint = defaultColor,
fontSize: uint = defaultFontSize)

Create a read-only text field with a default font.

Parameters

labelTextinitial text message
colorfont color (default 0xEEEEEE)
fontSizefont size (default 10)
public function mSprite()
Preloader constructor.
private function init():void
Initializes text message fields.
private function onEnterFrameInit(event: Event):void
First creates color theme buttons one on each enter frame event, then switches to listen for mouse events.
private function onEnterFrameTerm(event: Event):void
Progressively removes color theme buttons.
private function onMouseOver(event: MouseEvent):void
Highlights the color theme button the mouse hovers over.
private function onMouseOut(event: MouseEvent):void
Redraws the color theme button the mouse moved away from.
private function onMouseDown(event: MouseEvent):void
If the mouse button was clicked down on a theme color button then stores the color and starts to remove the theme buttons.
private function removeButtons():void
Starts the progressive removal of the theme color buttons.
private function load():void
Initiates load of the main application
private function initHandler(event: Event):void
If the user already selected a theme color then starts the main application, otherwise unloads the loader, the application is ready in cache when the user has finished the color choice.
private function runContent():void
Informs the main application of the selected theme color and adds it to the stage display list.
private function progressHandler(event: ProgressEvent):void
Displays load progress information.
private function createScaleButton(i: uint):void
Creates a color scale button and places it in a circle.
private function drawScaleButton(button: Sprite,
color: uint):void
Draws a color scale button as a rounded rectangle with a gradient radial fill.
private function ioErrorHandler(event: IOErrorEvent):void
Displays a load error message.
private function securityErrorHandler(event: SecurityErrorEvent):void
Displays a security error message.
private function draw():void
Draws a background rounded rectangle with a gradient radial fill.
public function Message(labelText: String,  
color: uint = defaultColor,
fontSize: uint = defaultFontSize)
Create a read-only text field with a default font.
Close