Packagesoi.core
Classpublic class Application
InheritanceApplication Inheritance mx.core.Application
Implementssoi.events.IHotSpotEventHandler, soi.events.IProjectEventHandler

The Application class is the core class at the root of the display list hierarchy which contains logic for processing events, managing data models, updating bindable properties of child display list objects, and managing the loading, unloading, opening, saving and closing of current project files. The application class also provides a LocalConnection listener to recieve communications from the AS2.0 flash document.swf of the current project regarding the status of initialising, processing, loading and completion of loading of the document.swf. The results of these communications from the document.swf are used to set the totalPages, currentPage and scaleRatio properties. This class also provides a toString method to return the current state of the links xml in a format ready to be written to file.



Public Properties
 PropertyDefined by
  activeProject : ProjectDetailsModel
The activeProject property is the root instance of the ProjectDetailsModel class.
Application
  contentsModel : ContentsModel
The contentsModel property is the root instance of the ContentsModel class.
Application
  currentLink : XML
This property is a reference to the currentLink property of the LinksModel class and is used by the hotspot control logic to place, change, and clear the x, y, w, and h values of the currently selected link in the links xml.
Application
  currentPage : Number
This property represents the number of the current open page in the eMag Viewer tab.
Application
  documentLoader : DocumentLoader
A reference to the documentLoader control.
Application
  hotSpotFactory : Canvas
A reference to the Canvas used as the container for the HotSpot control.
Application
  linksModel : LinksModel
The linksModel property is the root instance of the LinksModel class.
Application
  mainPanel : Panel
A reference to the mainPanel Panel.
Application
  mainTab : TabNavigator
A reference to the main TabNavigator control.
Application
  manageContents : ManageContents
A reference to the ManageContents palette in the main Accordion control.
Application
  manageLinks : ManageLinks
A reference to the ManageLinks palette in the main Accordion control.
Application
  palettes : Accordion
A reference to the main Accordion control.
Application
  splashScreen : Image
A reference to the Image used as the splash screen in the eMag Viewer tab.
Application
  totalPages : Number
This property represents the total number of pages of the active document in the eMag Viewer tab.
Application
Public Methods
 MethodDefined by
  
Constructor.
Application
  
The registered handler for soi.events.HotSpotEvent events.
Application
  
The registered handler for soi.events.ProjectEvent events.
Application
  
onDocumentComplete(returnedTotalPages:Number, returnedScaleRatio:Number):void
This method is called by the document.swf through the fromFlash LocalConnection.
Application
  
onLoadError(thisErrorCode:String, thisHTTPStatus:Number):void
This method is called by the document.swf through the fromFlash LocalConnection.
Application
  
onLoadInit():void
This method is called by the document.swf through the fromFlash LocalConnection.
Application
  
This method is called by the document.swf through the fromFlash LocalConnection.
Application
Events
 EventSummaryDefined by
   Dispatched when the document.swf has completed loading in the DocumentLoader control and called the onDocumentComplete method via the fromFlash LocalConnection.Application
   Dispatched when the project is loaded - to load the document.swf in the DocumentLoader control.Application
   Dispatched when the project is closed - to unload the document.swf from the DocumentLoader control.Application
Property detail
activeProjectproperty
activeProject:ProjectDetailsModel  [read-write]

The activeProject property is the root instance of the ProjectDetailsModel class.

This property can be used as the source for data binding.

Implementation
    public function get activeProject():ProjectDetailsModel
    public function set activeProject(value:ProjectDetailsModel):void
contentsModelproperty 
contentsModel:ContentsModel  [read-write]

The contentsModel property is the root instance of the ContentsModel class.

This property can be used as the source for data binding.

Implementation
    public function get contentsModel():ContentsModel
    public function set contentsModel(value:ContentsModel):void
currentLinkproperty 
public var currentLink:XML

This property is a reference to the currentLink property of the LinksModel class and is used by the hotspot control logic to place, change, and clear the x, y, w, and h values of the currently selected link in the links xml.

This property can be used as the source for data binding.

currentPageproperty 
currentPage:Number  [read-write]

This property represents the number of the current open page in the eMag Viewer tab. Setting this property will automatically set the currentPage property of the activeProject and linksModel classes.

The default value is null.

This property can be used as the source for data binding.

Implementation
    public function get currentPage():Number
    public function set currentPage(value:Number):void
documentLoaderproperty 
public var documentLoader:DocumentLoader

A reference to the documentLoader control.

hotSpotFactoryproperty 
public var hotSpotFactory:Canvas

A reference to the Canvas used as the container for the HotSpot control.

linksModelproperty 
linksModel:LinksModel  [read-write]

The linksModel property is the root instance of the LinksModel class. Setting this property to a non-null value automatically adds a propertyChange event listener which is used to handle changes to the currentLink property of the class made by the hotspot control, or child display list objects.

This property can be used as the source for data binding.

Implementation
    public function get linksModel():LinksModel
    public function set linksModel(value:LinksModel):void
mainPanelproperty 
public var mainPanel:Panel

A reference to the mainPanel Panel.

mainTabproperty 
public var mainTab:TabNavigator

A reference to the main TabNavigator control.

manageContentsproperty 
public var manageContents:ManageContents

A reference to the ManageContents palette in the main Accordion control.

manageLinksproperty 
public var manageLinks:ManageLinks

A reference to the ManageLinks palette in the main Accordion control.

palettesproperty 
public var palettes:Accordion

A reference to the main Accordion control.

splashScreenproperty 
public var splashScreen:Image

A reference to the Image used as the splash screen in the eMag Viewer tab.

totalPagesproperty 
totalPages:Number  [read-write]

This property represents the total number of pages of the active document in the eMag Viewer tab. User interface components such as the PageBrowser composite control monitor this property as part of their encapsulated business logic. Setting this property will automatically set the currentPage property, and the totalPages property of the activeProject class.

This property can be used as the source for data binding.

Implementation
    public function get totalPages():Number
    public function set totalPages(value:Number):void
Constructor detail
Application()constructor
public function Application()

Constructor. The constructor automatically instantiates the following: The fromFlash LocalConnection. The activeProject class. The linksModel class. The contentsModel class. The constructor also adds listeners for ProjectEvent and HotSpotEvent event objects.

Method detail
handleHotSpotEvent()method
public function handleHotSpotEvent(event:HotSpotEvent):void

The registered handler for soi.events.HotSpotEvent events.

Parameters
event:HotSpotEvent — event object.
handleProjectEvent()method 
public function handleProjectEvent(event:ProjectEvent):void

The registered handler for soi.events.ProjectEvent events.

Parameters
event:ProjectEvent — event object.
onDocumentComplete()method 
public function onDocumentComplete(returnedTotalPages:Number, returnedScaleRatio:Number):void

This method is called by the document.swf through the fromFlash LocalConnection. It is called when the document.swf has loaded and completed processing of its contents. This method sets the totalPages property, and the scaleRatio property. This method enables the palettes of the main Accordion, clears the splash screen Image, and dispatches the ProjectEvent.DOCUMENT_COMPLETE event.

Parameters
returnedTotalPages:Number — is the total pages of the document.swf returned by the document wrapper.
 
returnedScaleRatio:Number — is the scale ratio of the document.swf returned by the document wrapper calculated from the width of the HotSpotFactory Canvas passed in through the loadDocument method of the documentLoader control.
onLoadError()method 
public function onLoadError(thisErrorCode:String, thisHTTPStatus:Number):void

This method is called by the document.swf through the fromFlash LocalConnection. It processes a load error from the AS2.0 MovieClipLoader class.

Parameters
thisErrorCode:String — error code of the loader.
 
thisHTTPStatus:Number — HTTP Status number of the loader.
onLoadInit()method 
public function onLoadInit():void

This method is called by the document.swf through the fromFlash LocalConnection. It is unused - but exists for debugging purposes as it is called when the document.swf is loaded, but has not processed its contents.

onWrapperInit()method 
public function onWrapperInit():void

This method is called by the document.swf through the fromFlash LocalConnection. It processes the document wrapper's initialisation and calls the loadDocument method of the documentLoader control - passing the width of the hotSpotFactory canvas used as the container for the HotSpot control.

Event detail
documentCompleteevent 
Event object type: soi.events.ProjectEvent
ProjectEvent.type property = soi.events.ProjectEvent.DOCUMENT_COMPLETE

Dispatched when the document.swf has completed loading in the DocumentLoader control and called the onDocumentComplete method via the fromFlash LocalConnection. This event does not bubble.

The ProjectEvent.DOCUMENT_COMPLETE constant defines the value of the type property of the event object for a documentComplete event.

documentLoadevent  
Event object type: soi.events.ProjectEvent
ProjectEvent.type property = soi.events.ProjectEvent.DOCUMENT_LOAD

Dispatched when the project is loaded - to load the document.swf in the DocumentLoader control. This event does not bubble.

The ProjectEvent.DOCUMENT_LOAD constant defines the value of the type property of the event object for a documentLoad event.

documentUnloadevent  
Event object type: soi.events.ProjectEvent
ProjectEvent.type property = soi.events.ProjectEvent.DOCUMENT_UNLOAD

Dispatched when the project is closed - to unload the document.swf from the DocumentLoader control. This event does not bubble.

The ProjectEvent.DOCUMENT_UNLOAD constant defines the value of the type property of the event object for a documentUnload event.