airSprite

Sprite
airSprite

Loader with AIR functions for basic load of settings and handling of commandline and drop events on desktop icon.

Summary
airSpriteLoader with AIR functions for basic load of settings and handling of commandline and drop events on desktop icon.
Private constants
SETTINGS_FILENAMEName of application configuration file.
Private members
appMain application object
streamA FileStream object temporarily used to read and write script files.
Constructor
airSpriteConstructor for muSprite desktop frontend.
Startup methods
onCompleteLoad settings and adds an event handler for commandline line arguments and drop events on the desktop icon and one for application shutdown.
onInvokeEventWhen a file is dropped on the desktop icon or given on the commandline then it is loaded as the current script in the application.
loadSettingsLoad the application configuration file.
deserializeSettingsApply the settings to the state of the application.
Shutdown methods
onApplicationShutdownSave settings when the application is terminated normally.
saveSettingsStore settings in XML serialized form.
serializeSettingsSerializes the current application state into an XML object.
storeSettingsWrites the XML settings object to the application configuration file.
Script loading
fileReadPrepare to read the script File asyncronously.
fileReadHandlerRead the contents of the loaded file and let the application load it.
readIOErrorHandlerAn I/O error occurred when reading a script file.

Private constants

SETTINGS_FILENAME

private const SETTINGS_FILENAME: String

Name of application configuration file.

Private members

app

private var app: muSprite

Main application object

stream

private var stream: FileStream

A FileStream object temporarily used to read and write script files.

Constructor

airSprite

public function airSprite()

Constructor for muSprite desktop frontend.

Startup methods

onComplete

private function onComplete(event: Event):void

Load settings and adds an event handler for commandline line arguments and drop events on the desktop icon and one for application shutdown.

onInvokeEvent

public function onInvokeEvent(invocation: InvokeEvent):void

When a file is dropped on the desktop icon or given on the commandline then it is loaded as the current script in the application.

loadSettings

private function loadSettings(settingsFile: File):void

Load the application configuration file.  The file is created if it does not exist.

deserializeSettings

private function deserializeSettings(settingsData: String):void

Apply the settings to the state of the application.

Shutdown methods

onApplicationShutdown

private function onApplicationShutdown(event: Event):void

Save settings when the application is terminated normally.

saveSettings

private function saveSettings():void

Store settings in XML serialized form.

serializeSettings

private function serializeSettings():XML

Serializes the current application state into an XML object.

storeSettings

private function storeSettings(settings: XML):void

Writes the XML settings object to the application configuration file.

Script loading

fileRead

private function fileRead(scriptFile: File):void

Prepare to read the script File asyncronously.

fileReadHandler

private function fileReadHandler(event: Event):void

Read the contents of the loaded file and let the application load it.

readIOErrorHandler

private function readIOErrorHandler(event: Event):void

An I/O error occurred when reading a script file.

private const SETTINGS_FILENAME: String
Name of application configuration file.
private var app: muSprite
Main application object
private var stream: FileStream
A FileStream object temporarily used to read and write script files.
public function airSprite()
Constructor for muSprite desktop frontend.
private function onComplete(event: Event):void
Load settings and adds an event handler for commandline line arguments and drop events on the desktop icon and one for application shutdown.
public function onInvokeEvent(invocation: InvokeEvent):void
When a file is dropped on the desktop icon or given on the commandline then it is loaded as the current script in the application.
private function loadSettings(settingsFile: File):void
Load the application configuration file.
private function deserializeSettings(settingsData: String):void
Apply the settings to the state of the application.
private function onApplicationShutdown(event: Event):void
Save settings when the application is terminated normally.
private function saveSettings():void
Store settings in XML serialized form.
private function serializeSettings():XML
Serializes the current application state into an XML object.
private function storeSettings(settings: XML):void
Writes the XML settings object to the application configuration file.
private function fileRead(scriptFile: File):void
Prepare to read the script File asyncronously.
private function fileReadHandler(event: Event):void
Read the contents of the loaded file and let the application load it.
private function readIOErrorHandler(event: Event):void
An I/O error occurred when reading a script file.
Close