| Package | com.soma |
| Class | public class Soma |
| Implements | IModelLocator |
Author: Romuald Quantin - www.soundstep.com
Information:
Blog page - SomaUI
How does it work - Soma Protest
Project Host - Google Code
Documentation - Soma ASDOC
Class version: 2.0.1
Actionscript version: 3.0
Copyright:
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied.
See the License for the specific language governing rights and
limitations under the License.
The Original Code is Soma.
The Initial Developer of the Original Code is Romuald Quantin.
Initial Developer are Copyright (C) 2008-2009 Soundstep. All Rights Reserved.
Usage:
The Soma Singleton (extendable) is the entry point to access to the framework.
Soma.getInstance().addEventListener(SomaEvent.INITIALIZED, initialized);
Soma.getInstance().addEventListener(ContentEvent.LOADED, contentLoaded);
Soma.getInstance().registerGloBalStyleSheet("css/styles.css");
Soma.getInstance().start(this, "data/site.xml", new Config());
private function contentLoaded(e:ContentEvent = null):void {
// xml and stylesheet have been loaded (components that don't require the XML Site Definition are initialized)
trace(Soma.getInstance().container);
trace(Soma.getInstance().content.data.toXMLString());
}
private function initialized(e:SomaEvent = null):void {
// Soma is initialized
trace(Soma.getInstance().page.currentPage);
}
| Property | Defined by | ||
|---|---|---|---|
| background : BackgroundManager
[read-only]
Get the background manager (containing the background container and the backgrounds).
| Soma | ||
| base : BaseManager
[read-only]
Get the base manager library.
| Soma | ||
| baseUI : BaseUI
[read-only]
Get the global BaseUI instance (used for loading class if centered and the layout if set to fixed).
| Soma | ||
| classImport : ClassImport
[read-only] Return the global ClassImport instance (use Soma.getInstance().registerClass and Soma.getInstance().getClass).
| Soma | ||
| config : IConfig
[read-only]
Get the config file.
| Soma | ||
| container : Sprite [read-only]
Get the main container of the site (contains pages, menu and loading);
| Soma | ||
| content : ContentManager
[read-only]
Get the content manager (containing the XML Site Definition).
| Soma | ||
| currentLanguage : String
Current language String (example: "en") set using Soma.getInstance().initLanguage(true, "en");
| Soma | ||
| GLOBAL_LOADING_CENTERED : Boolean [static] static global value whether or not the user loading display (super class: com.soma.view.Loading, interface: com.soma.loader.ILoading) of the main global loader (Soma.getInstance().loader) will be centered in the layout (default true).
| Soma | ||
| initialized : Boolean [read-only]
Whether or not Soma is initialized.
| Soma | ||
| languageEnabled : Boolean
Whether or not the language is enabled.
| Soma | ||
| library : ILibrary
[read-only]
Get the global library.
| Soma | ||
| loader : SomaLoader
[read-only]
Get the global loader (used to load the stylesheet, the XML Site Definition and the assets in the pages).
| Soma | ||
| menu : MenuManager
[read-only]
Get the menu manager (containing the global menu if used).
| Soma | ||
| page : PageManager
[read-only]
Get the page manager (containing the page container and the pages).
| Soma | ||
| referenceBaseUI : DisplayObjectContainer [read-only]
Get the reference of the global BaseUI instance, the reference is the main container if the layout is set to fixed or the stage if the layout is set to liquid.
| Soma | ||
| styles : StyleManager
[read-only]
Get the style manager (containing stylesheets loaded).
| Soma | ||
| ui : DisplayObjectContainer [read-only]
Get the main document class registered when Soma starts, usually Sprite or MovieClip.
| Soma | ||
| Method | Defined by | ||
|---|---|---|---|
|
Soma()
Soma is an extendable Singleton, use Soma.getInstance().
| Soma | ||
|
addEventListener(p_type:String, p_listener:Function, p_useCapture:Boolean = false, p_priority:int = 0, p_useWeakReference:Boolean = false):void
| Soma | ||
|
dispatchEvent(p_event:CairngormEvent):Boolean
| Soma | ||
|
getClass(className:String):Class
Get a Class registered using the method Soma.getInstance().registerClass.
| Soma | ||
|
[static]
Soma is an extendable Singleton, getInstance() is returning the Soma instance to access to the framework and its components.
| Soma | ||
|
getModel(model:String):*
Get a model instance from Soma (managers).
| Soma | ||
|
hasEventListener(type:String):Boolean
| Soma | ||
|
initLanguage(languageEnabled:Boolean, language:String = ""):void
Initialize a String language (the current language when Soma starts) to be used in the deep-linking URL with SWFAddress.
It must be used before starting Soma and it will prepend the value before the URL, example: mysite.com/#/home will become mysite.com/#/en/home. The value can be changed at run-time using Soma.getInstance().currentLanguage and will dispatch a SomaEvent.LANGUAGE_CHANGED event through the framework. | Soma | ||
|
registerClass(value:Class):String
Register a Class with the ClassImport instance to force its import by the compiler (useful with getDefinitionByName).
| Soma | ||
|
registerGloBalStyleSheet(url:String):void
Register the URL of a global stylesheet (css) to load at the initialization process.
| Soma | ||
|
removeEventListener(p_type:String, p_listener:Function, p_useCapture:Boolean = false):void
| Soma | ||
|
Starts the Soma framework.
| Soma | ||
|
startWithXML(ui:DisplayObjectContainer, xml:XML, config:IConfig):void
Starts the Soma framework with an XML already loaded.
| Soma | ||
|
willTrigger(type:String):Boolean
| Soma | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Indicates when an excluded page has been called. See Soma Protest Page Excluded section. Soma.getInstance().addEventListener(PageEvent.EXCLUDED, eventHandler); | Soma | |||
| Indicates when a page that contains excluded page children has been called. | Soma | |||
| Soma command to display a background using the id from the XML Site Definition, use from anywhere in the code: The parameter should the ID of the background (id attribute in the XML Site Definition) new BackgroundEvent(BackgroundEvent.HIDE, "myBackground").dispatch(); | Soma | |||
| Indicates when Soma has been initialized. Soma.getInstance().addEventListener(SomaEvent.INITIALIZED, eventHandler); | Soma | |||
| Indicates the language (string in the URL) has been changed. Soma.getInstance().addEventListener(SomaEvent.LANGUAGE_CHANGED, eventHandler); | Soma | |||
| Indicates when the XML Site Definition has been loaded. Soma.getInstance().addEventListener(StyleSheetEvent.LOADED, eventHandler); | Soma | |||
| Indicates when the XML Site Definition has been loaded. Soma.getInstance().addEventListener(ContentEvent.LOADED, eventHandler); | Soma | |||
| Soma command that will be received by the user's custom menu (IMenu) to update the state of this menu when a new page is about to be displayed. This event is automatically dispatched by the PageManager instance in some case, such as a URL change (Soma.getInstance().page). Can also be used as a command from anywhere in the code, the parameter should be the ID of the page (id attribute in the XML Site Definition): new MenuEvent(MenuEvent.OPEN_MENU, "myID").dispatch(); | Soma | |||
| Soma command to display a page using the id from the XML Site Definition, use from anywhere in the code. The parameter should the ID of the page (id attribute in the XML Site Definition) new PageEvent(PageEvent.SHOW, "myPageID").dispatch(); | Soma | |||
| Soma command to display a background using the id from the XML Site Definition, use from anywhere in the code: The parameter should the ID of the background (id attribute in the XML Site Definition) new BackgroundEvent(BackgroundEvent.SHOW, "myBackground").dispatch(); | Soma | |||
| Soma command to open a new browser window in case the page in the XML Site Definition is an external link, example: <page id="soundstep" externalLink="http://www.soundstep.com/"> <title><![CDATA[Soundstep]]></title> </page> This event can be automatically dispatched by the Singleton MenuContext (right-click menu). Can also be used as a command from anywhere in the code: new PageEvent(PageEvent.SHOW_EXTERNAL_LINK, null, "http://www.soundstep.com/").dispatch(); new PageEvent(PageEvent.SHOW_EXTERNAL_LINK, myPage.@id, myPage.@externalLink).dispatch(); | Soma | |||
| Indicates when a page is about to be instantiated by the PageManager instance (Soma.getInstance().page). This event can be default prevented to stop the page manager to display and hide pages. Soma.getInstance().addEventListener(PageEvent.STARTED, eventHandler); | Soma | |||
| Indicates when a page has been instantiated and is about to be displayed. Soma.getInstance().addEventListener(PageEvent.TRANSITION_IN, eventHandler); | Soma | |||
| Indicates when a background is about to be displayed by the BackgroundManager instance (Soma.getInstance().background). Soma.getInstance().addEventListener(BackgroundEvent.TRANSITION_IN, eventHandler); | Soma | |||
| Indicates when a page has been displayed. Soma.getInstance().addEventListener(PageEvent.TRANSITION_IN_COMPLETE, eventHandler); | Soma | |||
| Indicates when a page is about to be hidden. Soma.getInstance().addEventListener(PageEvent.TRANSITION_OUT, eventHandler); | Soma | |||
| Indicates when a background is about to be hidden by the BackgroundManager instance (Soma.getInstance().background). Soma.getInstance().addEventListener(BackgroundEvent.TRANSITION_OUT, eventHandler); | Soma | |||
| Indicates when a page has been hidden. Soma.getInstance().addEventListener(PageEvent.TRANSITION_OUT_COMPLETE, eventHandler); | Soma | |||
| Indicates when the XML Site Definition has been updated. Soma.getInstance().addEventListener(ContentEvent.UPDATED, eventHandler); | Soma | |||
| Constant | Defined by | ||
|---|---|---|---|
| FIXED_LAYOUT : String = "fixed" [static] Constant value used to defined that the layout of the site is a fixed user interface, the width and height are fixed values applied to the main container (Soma.getInstance().container).
| Soma | ||
| LIQUID_LAYOUT : String = "liquid" [static] Constant value used to defined that the layout of the site is a liquid user interface, the width and height of the main container is updated to fit the browser (Soma.getInstance().container).
| Soma | ||
| MODEL_BACKGROUND : String = "com.soma.Soma.MODEL_BACKGROUND" [static] Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_BACKGROUND) equivalent to Soma.getInstance().background
| Soma | ||
| MODEL_BASE : String = "com.soma.Soma.MODEL_BASE" [static] Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_BASE) equivalent to Soma.getInstance().base
| Soma | ||
| MODEL_BASEUI : String = "com.soma.Soma.MODEL_BASEUI" [static] Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_BASEUI) equivalent to Soma.getInstance().baseUI
| Soma | ||
| MODEL_CONFIG : String = "com.soma.Soma.MODEL_CONFIG" [static] Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_CONFIG) equivalent to Soma.getInstance().config
| Soma | ||
| MODEL_CONTENT : String = "com.soma.Soma.MODEL_CONTENT" [static] Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_CONTENT) equivalent to Soma.getInstance().content
| Soma | ||
| MODEL_LIBRARY : String = "com.soma.Soma.MODEL_LIBRARY" [static] Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_LIBRARY) equivalent to Soma.getInstance().library
| Soma | ||
| MODEL_LOADER : String = "com.soma.Soma.MODEL_LOADER" [static] Constant value used to get a specific model class (manager) with the method getModel example: Soma.getInstance().getModel(Soma.MODEL_LOADER) equivalent to Soma.getInstance().loader
| Soma | ||
| MODEL_MENU : String = "com.soma.Soma.MODEL_MENU" [static] Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_MENU) equivalent to Soma.getInstance().menu
| Soma | ||
| MODEL_PAGE : String = "com.soma.Soma.MODEL_PAGE" [static] Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_PAGE) equivalent to Soma.getInstance().page
| Soma | ||
| MODEL_STYLE : String = "com.soma.Soma.MODEL_STYLE" [static] Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_STYLE) equivalent to Soma.getInstance().styles
| Soma | ||
| VERSION : String = "2.0.2" [static] Constant value of the Soma Version.
| Soma | ||
| background | property |
background:BackgroundManager [read-only]Get the background manager (containing the background container and the backgrounds).
Implementation public function get background():BackgroundManager
Soma.getInstance().background.container // access to container of the backgrounds Soma.getInstance().background.currentBackground // access to currently displayed background
| base | property |
base:BaseManager [read-only]Get the base manager library. The Base is a Sprite layer between the backgrounds Sprite layer and the site container layer and is meant to easily add DisplayObject (even from the XML) that are always on the screen (such as a logo).
Implementation public function get base():BaseManager
Soma.getInstance().base.container; // access to the container of the Base layer
Soma.getInstance().base.getElementByID("my asset") // access to a Base DisplayObject (instantiated from the XML or by code).
| baseUI | property |
baseUI:BaseUI [read-only]Get the global BaseUI instance (used for loading class if centered and the layout if set to fixed).
Implementation public function get baseUI():BaseUI
| classImport | property |
classImport:ClassImport [read-only]Return the global ClassImport instance (use Soma.getInstance().registerClass and Soma.getInstance().getClass).
Implementation public function get classImport():ClassImport
| config | property |
config:IConfig [read-only]Get the config file.
Implementation public function get config():IConfig
Soma.getInstance().config.siteName(); // access to the site name MyConfig(Soma.getInstance().config).myConfigMethod(); // access to a specific user method
| container | property |
container:Sprite [read-only]Get the main container of the site (contains pages, menu and loading);
Implementation public function get container():Sprite
| content | property |
content:ContentManager [read-only]Get the content manager (containing the XML Site Definition).
Implementation public function get content():ContentManager
Soma.getInstance().content.data // access to the XML Site Definition
| currentLanguage | property |
currentLanguage:String [read-write]Current language String (example: "en") set using Soma.getInstance().initLanguage(true, "en");
Implementation public function get currentLanguage():String
public function set currentLanguage(value:String):void
| GLOBAL_LOADING_CENTERED | property |
public static var GLOBAL_LOADING_CENTERED:Booleanstatic global value whether or not the user loading display (super class: com.soma.view.Loading, interface: com.soma.loader.ILoading) of the main global loader (Soma.getInstance().loader) will be centered in the layout (default true). It must be changed before starting Soma, if the value is true, the loading display class will be added to the global baseUI instance (Soma.getInstance().baseUI).
| initialized | property |
initialized:Boolean [read-only]Whether or not Soma is initialized.
Implementation public function get initialized():Boolean
| languageEnabled | property |
languageEnabled:Boolean [read-write]Whether or not the language is enabled.
Implementation public function get languageEnabled():Boolean
public function set languageEnabled(value:Boolean):void
| library | property |
library:ILibrary [read-only]Get the global library. It contains special assets registered by the framework such as SomaText, SomaVideo, ... and used by a NodeParser instance to dynamically instantiate assets from the XML Site Definition.
Implementation public function get library():ILibrary
Soma.getInstance().library.registerAsset("myAsset", "com.mypackage.MyAssetClass"); // register a custom asset class
<myAsset id="myAssetID" x="10" y="10" /> // use of a registered custom asset in the XML Site Definition
| loader | property |
loader:SomaLoader [read-only]Get the global loader (used to load the stylesheet, the XML Site Definition and the assets in the pages).
Implementation public function get loader():SomaLoader
var itemloaded:Dictionary = Soma.getInstance().loader.getLoadedItems(); // access to a list of items previously loaded
Soma.getInstance().loader.add("image.jpg"); // add an image to load in the global loader
Soma.getInstance().loader.start(); // start to load
| menu | property |
menu:MenuManager [read-only]Get the menu manager (containing the global menu if used).
Implementation public function get menu():MenuManager
Soma.getInstance().menu.getMenu(Soma.getInstance().config.menuClassName) // access to the global menu
| page | property |
page:PageManager [read-only]Get the page manager (containing the page container and the pages).
Implementation public function get page():PageManager
Soma.getInstance().page.currentPage // access to the current page
| referenceBaseUI | property |
referenceBaseUI:DisplayObjectContainer [read-only]Get the reference of the global BaseUI instance, the reference is the main container if the layout is set to fixed or the stage if the layout is set to liquid.
Implementation public function get referenceBaseUI():DisplayObjectContainer
| styles | property |
styles:StyleManager [read-only]Get the style manager (containing stylesheets loaded).
Implementation public function get styles():StyleManager
Soma.getInstance().style.loadStyleSheet("myStylesheet", "myNewStyleSheet.css"); // load a stylesheet
Soma.getInstance().style.getStyleSheet("myStylesheet"); // get a stylesheet
Soma.getInstance().style.getGlobalStyle("myStyle"); // get a style from the global stylesheet
| ui | property |
ui:DisplayObjectContainer [read-only]Get the main document class registered when Soma starts, usually Sprite or MovieClip. To access to your own Document class methods and property you can cast to your own class: MyMainClass(Soma.getInstance().ui).myMethod()
Implementation public function get ui():DisplayObjectContainer
| Soma | () | constructor |
public function Soma()Soma is an extendable Singleton, use Soma.getInstance(). See the Soma Protest source code for an example to extend Soma and alter the initializing/starting process.
| addEventListener | () | method |
public function addEventListener(p_type:String, p_listener:Function, p_useCapture:Boolean = false, p_priority:int = 0, p_useWeakReference:Boolean = false):voidParameters
p_type:String |
|
p_listener:Function |
|
p_useCapture:Boolean (default = false) |
|
p_priority:int (default = 0) |
|
p_useWeakReference:Boolean (default = false) |
| dispatchEvent | () | method |
public function dispatchEvent(p_event:CairngormEvent):BooleanParameters
p_event:CairngormEvent |
Boolean |
| getClass | () | method |
public function getClass(className:String):ClassGet a Class registered using the method Soma.getInstance().registerClass.
var MyClassType:Class = Soma.getInstance().getClass("MyClass");
className:String — Class name (String) of a class to force its import by the compiler (useful with getDefinitionByName).
|
Class — A Class.
|
| getInstance | () | method |
public static function getInstance():SomaSoma is an extendable Singleton, getInstance() is returning the Soma instance to access to the framework and its components.
ReturnsSoma —
Soma instance
|
| getModel | () | method |
public function getModel(model:String):*Get a model instance from Soma (managers).
Parametersmodel:String |
* — the StyleManager instance.
|
// access to the background manager (equals to Soma.getInstance().background); var background:BackgroundManager = Soma.getInstance().getModel(Soma.MODEL_BACKGROUND) as BackgroundManager;
| hasEventListener | () | method |
public function hasEventListener(type:String):BooleanParameters
type:String |
Boolean |
| initLanguage | () | method |
public function initLanguage(languageEnabled:Boolean, language:String = ""):void
Initialize a String language (the current language when Soma starts) to be used in the deep-linking URL with SWFAddress.
It must be used before starting Soma and it will prepend the value before the URL, example: mysite.com/#/home will become mysite.com/#/en/home.
The value can be changed at run-time using Soma.getInstance().currentLanguage and will dispatch a SomaEvent.LANGUAGE_CHANGED event through the framework.
languageEnabled:Boolean — Enable or Disable the language String in the URL.
|
|
language:String (default = "") — Specify the language String used in the URL, example: "en", "de", and so on.
|
Soma.getInstance().initLanguage(true, "en"); Soma.getInstance().addEventListener(SomaEvent.LANGUAGE_CHANGED, languageHandler); Soma.getInstance().currentLanguage = "de";
| registerClass | () | method |
public function registerClass(value:Class):StringRegister a Class with the ClassImport instance to force its import by the compiler (useful with getDefinitionByName). You can get the class using the method Soma.getInstance().getClass.
Soma.getInstance().registerClass(MyClass);
value:Class — Class.
|
String — The String of the class name.
|
| registerGloBalStyleSheet | () | method |
public function registerGloBalStyleSheet(url:String):voidRegister the URL of a global stylesheet (css) to load at the initialization process. Soma will load the stylesheet (before the XML) and dispatch a StyleSheetEvent.LOADED event.
Parametersurl:String — URL of the global stylesheet.
|
Soma.getInstance().registerGloBalStyleSheet("css/styles.css");
Soma.getInstance().addEventListener(StyleSheetEvent.LOADED, stylesheetHandler);
Soma.getInstance().start(this, "data/site.xml", new Config());
private function stylesheetHandler(e:StyleSheetEvent):void {
trace(e.stylesheet);
trace(Soma.getInstance().style.getStyleSheet(StyleManager.GLOBAL_STYLESHEET_ID));
}
| removeEventListener | () | method |
public function removeEventListener(p_type:String, p_listener:Function, p_useCapture:Boolean = false):voidParameters
p_type:String |
|
p_listener:Function |
|
p_useCapture:Boolean (default = false) |
| start | () | method |
public function start(ui:DisplayObjectContainer, xmlFile:String, config:IConfig):void
Starts the Soma framework. The 3 parameters are required: the main document class, the URL of the XML Site definition describing the site structure and a Config file (interface: com.interface.IConfig) containing information needed by the framework.
Part 1: Soma starts, creates the containers and initializes the global managers (such as controller, loader, config, ...).
Part 2: Soma loads the XML Site definition (and stylesheet if set before starting).
Part 3: Soma initializes the managers that need the XML Site definition (such as menu, loading, pages, styles, ...).
Part 4: Soma dispatches a SomaEvent.INITIALIZED when done.
ui:DisplayObjectContainer — main Document Class (AS Entry Point), accessible using Soma.getInstance().ui
|
|
xmlFile:String — URL of the XML Site Definition to load (describing the structure of the site), accessible using Soma.getInstance().content.data
|
|
config:IConfig — user config file (containing framework options and global configuration), accessible using Soma.getInstance().config
|
Soma.getInstance().addEventListener(SomaEvent.INITIALIZED, initialized);
Soma.getInstance().addEventListener(ContentEvent.LOADED, contentLoaded);
Soma.getInstance().registerGloBalStyleSheet("css/styles.css");
Soma.getInstance().start(this, "data/site.xml", new Config());
private function contentLoaded(e:ContentEvent = null):void {
// xml and stylesheet have been loaded (components that don't require the XML Site Definition are initialized)
trace(Soma.getInstance().container);
trace(Soma.getInstance().content.data.toXMLString());
}
private function initialized(e:SomaEvent = null):void {
// Soma is initialized
trace(Soma.getInstance().page.currentPage);
}
| startWithXML | () | method |
public function startWithXML(ui:DisplayObjectContainer, xml:XML, config:IConfig):voidStarts the Soma framework with an XML already loaded.
Parametersui:DisplayObjectContainer — main Document Class (AS Entry Point), accessible using Soma.getInstance().ui
|
|
xml:XML — XML Site Definition (describing the structure of the site), accessible using Soma.getInstance().content.data
|
|
config:IConfig — user config file (containing framework options and global configuration), accessible using Soma.getInstance().config
|
Soma.getInstance().start(this, myXMLSiteDefinition, new Config());
| willTrigger | () | method |
public function willTrigger(type:String):BooleanParameters
type:String |
Boolean |
| EXCLUDED | event |
com.soma.events.PageEvent.EXCLUDED
Indicates when an excluded page has been called.
See Soma Protest Page Excluded section.
Soma.getInstance().addEventListener(PageEvent.EXCLUDED, eventHandler);
See also
| EXCLUDED_PARENT | event |
com.soma.events.PageEvent.EXCLUDED_PARENT
Indicates when a page that contains excluded page children has been called.
See Soma Protest Page Excluded section.
Soma.getInstance().addEventListener(PageEvent.EXCLUDED_PARENT, eventHandler);
See also
| HIDE | event |
com.soma.events.BackgroundEvent.HIDE
Soma command to display a background using the id from the XML Site Definition, use from anywhere in the code:
The parameter should the ID of the background (id attribute in the XML Site Definition)
new BackgroundEvent(BackgroundEvent.HIDE, "myBackground").dispatch();
See also
| INITIALIZED | event |
com.soma.events.SomaEvent.INITIALIZED
Indicates when Soma has been initialized.
Soma.getInstance().addEventListener(SomaEvent.INITIALIZED, eventHandler);
See also
| LANGUAGE_CHANGED | event |
com.soma.events.SomaEvent.LANGUAGE_CHANGED
Indicates the language (string in the URL) has been changed.
Soma.getInstance().addEventListener(SomaEvent.LANGUAGE_CHANGED, eventHandler);
See also
| LOADED | event |
com.soma.events.StyleSheetEvent.LOADED
Indicates when the XML Site Definition has been loaded.
Soma.getInstance().addEventListener(StyleSheetEvent.LOADED, eventHandler);
See also
| LOADED | event |
com.soma.events.ContentEvent.LOADED
Indicates when the XML Site Definition has been loaded.
Soma.getInstance().addEventListener(ContentEvent.LOADED, eventHandler);
See also
| OPEN_MENU | event |
com.soma.events.MenuEvent.OPEN_MENU
Soma command that will be received by the user's custom menu (IMenu) to update the state of this menu when a new page is about to be displayed.
This event is automatically dispatched by the PageManager instance in some case, such as a URL change (Soma.getInstance().page).
Can also be used as a command from anywhere in the code, the parameter should be the ID of the page (id attribute in the XML Site Definition):
new MenuEvent(MenuEvent.OPEN_MENU, "myID").dispatch();
See also
| SHOW | event |
com.soma.events.PageEvent.SHOW
Soma command to display a page using the id from the XML Site Definition, use from anywhere in the code.
The parameter should the ID of the page (id attribute in the XML Site Definition)
new PageEvent(PageEvent.SHOW, "myPageID").dispatch();
See also
| SHOW | event |
com.soma.events.BackgroundEvent.SHOW
Soma command to display a background using the id from the XML Site Definition, use from anywhere in the code:
The parameter should the ID of the background (id attribute in the XML Site Definition)
new BackgroundEvent(BackgroundEvent.SHOW, "myBackground").dispatch();
See also
| SHOW_EXTERNAL_LINK | event |
com.soma.events.PageEvent.SHOW_EXTERNAL_LINK
Soma command to open a new browser window in case the page in the XML Site Definition is an external link, example:
<page id="soundstep" externalLink="http://www.soundstep.com/">
<title><![CDATA[Soundstep]]></title>
</page>
This event can be automatically dispatched by the Singleton MenuContext (right-click menu).
Can also be used as a command from anywhere in the code:
new PageEvent(PageEvent.SHOW_EXTERNAL_LINK, null, "http://www.soundstep.com/").dispatch();
new PageEvent(PageEvent.SHOW_EXTERNAL_LINK, myPage.@id, myPage.@externalLink).dispatch();
See also
| STARTED | event |
com.soma.events.PageEvent.STARTED
Indicates when a page is about to be instantiated by the PageManager instance (Soma.getInstance().page).
This event can be default prevented to stop the page manager to display and hide pages.
Soma.getInstance().addEventListener(PageEvent.STARTED, eventHandler);
See also
| TRANSITION_IN | event |
com.soma.events.PageEvent.TRANSITION_IN
Indicates when a page has been instantiated and is about to be displayed.
Soma.getInstance().addEventListener(PageEvent.TRANSITION_IN, eventHandler);
See also
| TRANSITION_IN | event |
com.soma.events.BackgroundEvent.TRANSITION_IN
Indicates when a background is about to be displayed by the BackgroundManager instance (Soma.getInstance().background).
Soma.getInstance().addEventListener(BackgroundEvent.TRANSITION_IN, eventHandler);
See also
| TRANSITION_IN_COMPLETE | event |
com.soma.events.PageEvent.TRANSITION_IN_COMPLETE
Indicates when a page has been displayed.
Soma.getInstance().addEventListener(PageEvent.TRANSITION_IN_COMPLETE, eventHandler);
See also
| TRANSITION_OUT | event |
com.soma.events.PageEvent.TRANSITION_OUT
Indicates when a page is about to be hidden.
Soma.getInstance().addEventListener(PageEvent.TRANSITION_OUT, eventHandler);
See also
| TRANSITION_OUT | event |
com.soma.events.BackgroundEvent.TRANSITION_OUT
Indicates when a background is about to be hidden by the BackgroundManager instance (Soma.getInstance().background).
Soma.getInstance().addEventListener(BackgroundEvent.TRANSITION_OUT, eventHandler);
See also
| TRANSITION_OUT_COMPLETE | event |
com.soma.events.PageEvent.TRANSITION_OUT_COMPLETE
Indicates when a page has been hidden.
Soma.getInstance().addEventListener(PageEvent.TRANSITION_OUT_COMPLETE, eventHandler);
See also
| UPDATED | event |
com.soma.events.ContentEvent.UPDATED
Indicates when the XML Site Definition has been updated.
Soma.getInstance().addEventListener(ContentEvent.UPDATED, eventHandler);
See also
| FIXED_LAYOUT | constant |
public static const FIXED_LAYOUT:String = "fixed"Constant value used to defined that the layout of the site is a fixed user interface, the width and height are fixed values applied to the main container (Soma.getInstance().container). The values are set in the XML Site definition <site layout="fixed" width="800" height="600">.
| LIQUID_LAYOUT | constant |
public static const LIQUID_LAYOUT:String = "liquid"Constant value used to defined that the layout of the site is a liquid user interface, the width and height of the main container is updated to fit the browser (Soma.getInstance().container). The values are set in the XML Site definition <site layout="liquid"> or <site>.
| MODEL_BACKGROUND | constant |
public static const MODEL_BACKGROUND:String = "com.soma.Soma.MODEL_BACKGROUND"Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_BACKGROUND) equivalent to Soma.getInstance().background
| MODEL_BASE | constant |
public static const MODEL_BASE:String = "com.soma.Soma.MODEL_BASE"Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_BASE) equivalent to Soma.getInstance().base
| MODEL_BASEUI | constant |
public static const MODEL_BASEUI:String = "com.soma.Soma.MODEL_BASEUI"Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_BASEUI) equivalent to Soma.getInstance().baseUI
| MODEL_CONFIG | constant |
public static const MODEL_CONFIG:String = "com.soma.Soma.MODEL_CONFIG"Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_CONFIG) equivalent to Soma.getInstance().config
| MODEL_CONTENT | constant |
public static const MODEL_CONTENT:String = "com.soma.Soma.MODEL_CONTENT"Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_CONTENT) equivalent to Soma.getInstance().content
| MODEL_LIBRARY | constant |
public static const MODEL_LIBRARY:String = "com.soma.Soma.MODEL_LIBRARY"Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_LIBRARY) equivalent to Soma.getInstance().library
| MODEL_LOADER | constant |
public static const MODEL_LOADER:String = "com.soma.Soma.MODEL_LOADER"Constant value used to get a specific model class (manager) with the method getModel example: Soma.getInstance().getModel(Soma.MODEL_LOADER) equivalent to Soma.getInstance().loader
| MODEL_MENU | constant |
public static const MODEL_MENU:String = "com.soma.Soma.MODEL_MENU"Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_MENU) equivalent to Soma.getInstance().menu
| MODEL_PAGE | constant |
public static const MODEL_PAGE:String = "com.soma.Soma.MODEL_PAGE"Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_PAGE) equivalent to Soma.getInstance().page
| MODEL_STYLE | constant |
public static const MODEL_STYLE:String = "com.soma.Soma.MODEL_STYLE"Constant value used to get a specific model class (manager) with the method getModel, example: Soma.getInstance().getModel(Soma.MODEL_STYLE) equivalent to Soma.getInstance().styles
| VERSION | constant |
public static const VERSION:String = "2.0.2"Constant value of the Soma Version.