Application.as

Summary
Application.as
events
org.silex.core.Application
silex_ptrReference to silex main Api object (org.silex.core.Api).
stageRectUsed to store the stage position and size in _root coordinate system.
sceneRectUsed to store the display region position and size in _root coordinate system.
bg_mcBackground clip.
embeddedFontsArray of swf names.
files preload
preloadFilesListarray of file names which will be preloaded, i.e.
preload_mclMovieClipLoader for the preloaded files.
preload_mcContainer for the preloaded files.
preloadIdx
layouts
layout_mclLayout loader.
layoutListenerListener object for the layout loader.
layoutContainerContainer for the first layout of the website.
layoutsLayouts array: contains references to the layouts.
screenSaverIntervalIdxIndex of the interval used for the screen saver (setInterval ActionScript function).
screenSaverMouseListenermouse listener for the screen saver activity detection
screen saver modes
SCREEN_SAVER_MODE_ON
SCREEN_SAVER_MODE_OFF
SCREEN_SAVER_MODE_ACTIVE
screenSaverModescreen saver current mode
ApplicationConstructor.
background events
bgPress
bgRelease
siteRefresh
siteRefreshNoCache
initAfterConfigLoadedInitialize context menu to display the about item.
stageResizeCallback executed when the window is resized
updateSceneSizeAfterPagesAreClosed
getMaxContentHeightcompute the content maximum height in all opened pages
stretchSceneCenter layouts and content <=> compute offset to apply to the scene.
centerSceneCenter layouts and content <=> compute offset to apply to the scene.
setBgColorChange bg_mc color.
aboutCallbackCallback function executed when the user select “about SILEX” in the context menu.
refreshLoginMenuStateBuild the context menu for SILEX.
loginCallbackCallback function executed when the user select “login” in the context menu.
flushLoginsCallbackCallback function executed when the user select “flush login” in the context menu.
promptPasswordCallbackCallback function executed when the user select “login” in the context menu and do not have a login + password stored in the cookie.
authenticationCallbackCallback function executed when the result of the authentication is arrived.
logoutCallbackCallback function executed when the user select “logout” in the context menu.
startStart the loading process.
dynDataLoadedOverride constants and config variables.
overrideConfigOverride constants and config variables.
preloadFileSuccessCallback executed when a file has been successfully preloaded.
preloadFileErrorCallback executed when a file has not been successfully preloaded.
preloadNextFilePreloads the next file in preloadFilesList array.
preloadFilesStartpreload files start<br /> call hooks<br /> call preloadNextFile
preloadFilesDoneCallback executed when all files have been loadded, with errors or not.
openWebsiteClose current website and open an other website on the same server.
openSectionStart the loading process of a section.<br /> call hooks<br />
layoutLoadedErrorCalled by layout_mcl when a layout is not loaded correctly.
layoutLoadedCompleteCalled by layout_mcl when a layout is loaded BEFORE 1st frame.
layoutLoadedInitCalled by layout_mcl when a layout is loaded AFTER 1st frame.
layoutLoadedInitNew
registerLayoutCalled by layoutLoadedInit.
unRegisterLayoutCalled by layoutLoadedComplete.
getLayoutFind the layout object (silexLayout) at the root of the layout containing a given MovieClip.
saveSave a section.
saveDoneCallback function executed when a save operation is done.
getSeoDataBuild an indexable object for seo, search engine, rss.
getPlayerByNameUse org.silex.ui.UiBase::playerName to retrieve the player named playerName_str in the players tool box.
fonts
registerEmbeddedFontStore all fonts in silex_ptr.config.embeddedFont array.
screen saver
screenSaverInitInitialize the screen saver system.
screenSaverDeactivateTurn back to normal mode because activity has been detected.
screenSaverActivateTurn into screen saver mode because there was no activity for a certain amount of time.
screenSaverSignalDelay the screen saver activation because activity is detected.
layers
refreshAllLayersCalled by org.silex.core.Api.config object (watch on globalContext).
isAChildDirtyCheck if one of the target’s child layout is dirty,

events

org.silex.core.Application

mx.core.UIObject
org.silex.core.Application
Summary
silex_ptrReference to silex main Api object (org.silex.core.Api).
stageRectUsed to store the stage position and size in _root coordinate system.
sceneRectUsed to store the display region position and size in _root coordinate system.
bg_mcBackground clip.
embeddedFontsArray of swf names.
files preload
preloadFilesListarray of file names which will be preloaded, i.e.
preload_mclMovieClipLoader for the preloaded files.
preload_mcContainer for the preloaded files.
preloadIdx
layouts
layout_mclLayout loader.
layoutListenerListener object for the layout loader.
layoutContainerContainer for the first layout of the website.
layoutsLayouts array: contains references to the layouts.
screenSaverIntervalIdxIndex of the interval used for the screen saver (setInterval ActionScript function).
screenSaverMouseListenermouse listener for the screen saver activity detection
screen saver modes
SCREEN_SAVER_MODE_ON
SCREEN_SAVER_MODE_OFF
SCREEN_SAVER_MODE_ACTIVE
screenSaverModescreen saver current mode
ApplicationConstructor.
background events
bgPress
bgRelease
siteRefresh
siteRefreshNoCache
initAfterConfigLoadedInitialize context menu to display the about item.
stageResizeCallback executed when the window is resized
updateSceneSizeAfterPagesAreClosed
getMaxContentHeightcompute the content maximum height in all opened pages
stretchSceneCenter layouts and content <=> compute offset to apply to the scene.
centerSceneCenter layouts and content <=> compute offset to apply to the scene.
setBgColorChange bg_mc color.
aboutCallbackCallback function executed when the user select “about SILEX” in the context menu.
refreshLoginMenuStateBuild the context menu for SILEX.
loginCallbackCallback function executed when the user select “login” in the context menu.
flushLoginsCallbackCallback function executed when the user select “flush login” in the context menu.
promptPasswordCallbackCallback function executed when the user select “login” in the context menu and do not have a login + password stored in the cookie.
authenticationCallbackCallback function executed when the result of the authentication is arrived.
logoutCallbackCallback function executed when the user select “logout” in the context menu.
startStart the loading process.
dynDataLoadedOverride constants and config variables.
overrideConfigOverride constants and config variables.
preloadFileSuccessCallback executed when a file has been successfully preloaded.
preloadFileErrorCallback executed when a file has not been successfully preloaded.
preloadNextFilePreloads the next file in preloadFilesList array.
preloadFilesStartpreload files start<br /> call hooks<br /> call preloadNextFile
preloadFilesDoneCallback executed when all files have been loadded, with errors or not.
openWebsiteClose current website and open an other website on the same server.
openSectionStart the loading process of a section.<br /> call hooks<br />
layoutLoadedErrorCalled by layout_mcl when a layout is not loaded correctly.
layoutLoadedCompleteCalled by layout_mcl when a layout is loaded BEFORE 1st frame.
layoutLoadedInitCalled by layout_mcl when a layout is loaded AFTER 1st frame.
layoutLoadedInitNew
registerLayoutCalled by layoutLoadedInit.
unRegisterLayoutCalled by layoutLoadedComplete.
getLayoutFind the layout object (silexLayout) at the root of the layout containing a given MovieClip.
saveSave a section.
saveDoneCallback function executed when a save operation is done.
getSeoDataBuild an indexable object for seo, search engine, rss.
getPlayerByNameUse org.silex.ui.UiBase::playerName to retrieve the player named playerName_str in the players tool box.
fonts
registerEmbeddedFontStore all fonts in silex_ptr.config.embeddedFont array.
screen saver
screenSaverInitInitialize the screen saver system.
screenSaverDeactivateTurn back to normal mode because activity has been detected.
screenSaverActivateTurn into screen saver mode because there was no activity for a certain amount of time.
screenSaverSignalDelay the screen saver activation because activity is detected.
layers
refreshAllLayersCalled by org.silex.core.Api.config object (watch on globalContext).
isAChildDirtyCheck if one of the target’s child layout is dirty,

silex_ptr

private var silex_ptr: org.silex.core.Api

Reference to silex main Api object (org.silex.core.Api).

stageRect

var stageRect: Object

Used to store the stage position and size in _root coordinate system.  Propeties: top,left,right,bottom.

sceneRect

var sceneRect: Object

Used to store the display region position and size in _root coordinate system.  Propeties: top,left,right,bottom.

bg_mc

var bg_mc: MovieClip

Background clip.

embeddedFonts

var embeddedFonts: Array

Array of swf names.  Each swf file should contain one font and will be loaded at start.

files preload

preloadFilesList

private var preloadFilesList: Array

array of file names which will be preloaded, i.e. loaded before SILEX starts to load the 1st page of the website.

preload_mcl

private var preload_mcl: MovieClipLoader

MovieClipLoader for the preloaded files.

preload_mc

private var preload_mc: MovieClip

Container for the preloaded files.

preloadIdx

var preloadIdx: Number
Indexin preloadFilesList, of the file which is curently being preloaded.

layouts

layout_mcl

public var layout_mcl: MovieClipLoader

Layout loader.  Used to unload layouts (in org.silex.core.Layout) and to monitor loading.

layoutListener

var layoutListener: Object

Listener object for the layout loader.

layoutContainer

var layoutContainer: MovieClip

Container for the first layout of the website.

layouts

var layouts: Array

Layouts array: contains references to the layouts.

screenSaverIntervalIdx

var screenSaverIntervalIdx: Number

Index of the interval used for the screen saver (setInterval ActionScript function).

screenSaverMouseListener

var screenSaverMouseListener: Object

mouse listener for the screen saver activity detection

screen saver modes

SCREEN_SAVER_MODE_ON

static var SCREEN_SAVER_MODE_ON: String

SCREEN_SAVER_MODE_OFF

static var SCREEN_SAVER_MODE_OFF: String

SCREEN_SAVER_MODE_ACTIVE

static var SCREEN_SAVER_MODE_ACTIVE: String

screenSaverMode

var screenSaverMode: String

screen saver current mode

Application

function Application(api: org.silex.core.Api)

Constructor.  Initialize context menu to display the about item.

background events

bgPress

function bgPress ()

bgRelease

function bgRelease ()

siteRefresh

function siteRefresh()

siteRefreshNoCache

function siteRefreshNoCache()

initAfterConfigLoaded

function initAfterConfigLoaded()

Initialize context menu to display the about item.

stageResize

function stageResize()

Callback executed when the window is resized

updateSceneSizeAfterPagesAreClosed

function updateSceneSizeAfterPagesAreClosed()

getMaxContentHeight

function getMaxContentHeight()

compute the content maximum height in all opened pages

stretchScene

function stretchScene()

Center layouts and content <=> compute offset to apply to the scene. layoutStageWidth and layoutStageHeight are read in config file, default is 800x600.

centerScene

function centerScene(centerVertically: Boolean,
centerHorizontally: Boolean)

Center layouts and content <=> compute offset to apply to the scene. layoutStageWidth and layoutStageHeight are read in config file, default is 800x600.

setBgColor

function setBgColor(color_str: String)

Change bg_mc color.

Parameters

param color_str the color to apply

aboutCallback

function aboutCallback()

Callback function executed when the user select “about SILEX” in the context menu.  Execute the command CONTEXT_MENU_ABOUT_COMMAND read in the config files

refreshLoginMenuState

function refreshLoginMenuState()

Build the context menu for SILEX.  Login, logout and about menus.

loginCallback

function loginCallback()

Callback function executed when the user select “login” in the context menu.  Check if the user has a login + password stored in the cookie and eventually open a login dialog.

See Also

org.silex.core.Utils::promptPassword

flushLoginsCallback

function flushLoginsCallback()

Callback function executed when the user select “flush login” in the context menu.

promptPasswordCallback

function promptPasswordCallback(login_str,
pass_str)

Callback function executed when the user select “login” in the context menu and do not have a login + password stored in the cookie.  Called by the promptPassword dialog function opened by the loginCallback function.

Parameters

param login_str the user login
param pass_str the user password

See Also

org.silex.core.Application::loginCallback, org.silex.core.Utils::promptPassword

authenticationCallback

function authenticationCallback(success: Boolean)

Callback function executed when the result of the authentication is arrived.

Parameters

param success the state of the authentication. true if it succeded and false otherwise. 

logoutCallback

function logoutCallback()

Callback function executed when the user select “logout” in the context menu.

start

function start()

Start the loading process.  Call com.getDynData.  All _root properties of type number or string are considered as params passed to Flash by javascript.

dynDataLoaded

function dynDataLoaded(result: Array)

Override constants and config variables.  Init the Constant class with these constants.  Continue the loading process (preload files).

overrideConfig

function overrideConfig(result: Array):Boolean

Override constants and config variables.

preloadFileSuccess

function preloadFileSuccess()

Callback executed when a file has been successfully preloaded.  Preload the next file.

preloadFileError

function preloadFileError()

Callback executed when a file has not been successfully preloaded.  Preload the next file.

preloadNextFile

function preloadNextFile()

Preloads the next file in preloadFilesList array.  Or call preloadFilesDone if the end of the array was reached.

preloadFilesStart

function preloadFilesStart(preloadFilesListLocal: Array)

preload files start<br /> call hooks<br /> call preloadNextFile

preloadFilesDone

function preloadFilesDone()

Callback executed when all files have been loadded, with errors or not. call hooks<br />

openWebsite

function openWebsite(idsite: String)

Close current website and open an other website on the same server.

openSection

function openSection(sectionName_str: String,
layoutFileName_str: String,
targetLayout: org.silex.core.Layout,
deeplinkName: String):Boolean

Start the loading process of a section.<br /> call hooks<br />

Parameters

sectionName_strsection name that will give us the name of the xml file containing the data
layoutFilelayout swf file (does not contain the path to the layout folder of the website)
targetLayoutorg.silex.core.Layout object in which to open the section (load the layout)

Returns

true if the section loading could be started

layoutLoadedError

function layoutLoadedError(target_mc: MovieClip,
errorCode: String)

Called by layout_mcl when a layout is not loaded correctly. handle error

Parameters

target_mcmovie clip in which the section (the layout) was supposed to be loaded
errorCodeA string that explains the reason for the failure, either “URLNotFound” or “LoadNeverCompleted”. 

layoutLoadedComplete

function layoutLoadedComplete(target_mc: MovieClip)

Called by layout_mcl when a layout is loaded BEFORE 1st frame. create silexLayout object at the root of this layout and starts the xml loading process

Parameters

target_mcmovie clip in which the section (the layout) is loaded

layoutLoadedInit

function layoutLoadedInit(target_mc: MovieClip)

Called by layout_mcl when a layout is loaded AFTER 1st frame.

Parameters

target_mcmovie clip in which the section (the layout) is loaded

layoutLoadedInitNew

function layoutLoadedInitNew(target_mc: MovieClip)

registerLayout

function registerLayout(silexLayout: org.silex.core.Layout)

Called by layoutLoadedInit.  Add the layout to layouts array and set its onUnload function.

Parameters

silexLayoutthe layout to register

unRegisterLayout

function unRegisterLayout(silexLayout: org.silex.core.Layout)

Called by layoutLoadedComplete.  Remove the layout from the layouts array and unset its onUnload function.

Parameters

silexLayoutthe layout to unregister

getLayout

function getLayout(target_mc: MovieClip):org.silex.core.Layout

Find the layout object (silexLayout) at the root of the layout containing a given MovieClip.

Parameters

target_mcthe movie clip of which we want to find the layout object

Returns

the root of the layout containing a target_mc

save

function save (target_mc: MovieClip)

Save a section.  Build the XML object and send it to the db.

Parameters

param target_mc any clip contained in the section to be saved. 

saveDone

function saveDone (error_str: String)

Callback function executed when a save operation is done.

Parameters

param error_str the description of the error. null if no error occured. 

getSeoData

function getSeoData(layout: org.silex.core.Layout):Object

Build an indexable object for seo, search engine, rss.

Returns

an object with the properties title (string), link (string), pubDate (Date) and content (array of objects returned by ui.players.UiBase::getSeoData)

getPlayerByName

function getPlayerByName(playerName_str: String)/*:org.silex.ui.UiBase*/

Use org.silex.ui.UiBase::playerName to retrieve the player named playerName_str in the players tool box.

Parameters

playerName_strthe name of the player to find

Returns

the player named playerName_str in the players tool box

fonts

registerEmbeddedFont

function registerEmbeddedFont(fontName_str: String)

Store all fonts in silex_ptr.config.embeddedFont array.

screen saver

screenSaverInit

function screenSaverInit()

Initialize the screen saver system.

screenSaverDeactivate

function screenSaverDeactivate()

Turn back to normal mode because activity has been detected.  Called by screenSaverSignal.

See Also

org.silex.core.Application::screenSaverSignal

screenSaverActivate

function screenSaverActivate()

Turn into screen saver mode because there was no activity for a certain amount of time.  Only if user is not logged in.  Called by the system (setInterval callback).

screenSaverSignal

function screenSaverSignal()

Delay the screen saver activation because activity is detected.  Called by SILEX when activity is detected.

layers

refreshAllLayers

function refreshAllLayers()

Called by org.silex.core.Api.config object (watch on globalContext).

isAChildDirty

function isAChildDirty(targetLayout: org.silex.core.Layout):Boolean

Check if one of the target’s child layout is dirty,

Parameters

param targetLayout the layout to be checked

Returns

true if targetLayout has changed. null otherwise. 

private var silex_ptr: org.silex.core.Api
Reference to silex main Api object (org.silex.core.Api).
var stageRect: Object
Used to store the stage position and size in _root coordinate system.
var sceneRect: Object
Used to store the display region position and size in _root coordinate system.
var bg_mc: MovieClip
Background clip.
var embeddedFonts: Array
Array of swf names.
private var preloadFilesList: Array
array of file names which will be preloaded, i.e.
private var preload_mcl: MovieClipLoader
MovieClipLoader for the preloaded files.
private var preload_mc: MovieClip
Container for the preloaded files.
var preloadIdx: Number
public var layout_mcl: MovieClipLoader
Layout loader.
var layoutListener: Object
Listener object for the layout loader.
var layoutContainer: MovieClip
Container for the first layout of the website.
var layouts: Array
Layouts array: contains references to the layouts.
var screenSaverIntervalIdx: Number
Index of the interval used for the screen saver (setInterval ActionScript function).
var screenSaverMouseListener: Object
mouse listener for the screen saver activity detection
static var SCREEN_SAVER_MODE_ON: String
static var SCREEN_SAVER_MODE_OFF: String
static var SCREEN_SAVER_MODE_ACTIVE: String
var screenSaverMode: String
screen saver current mode
function Application(api: org.silex.core.Api)
Constructor.
function bgPress ()
function bgRelease ()
function siteRefresh()
function siteRefreshNoCache()
function initAfterConfigLoaded()
Initialize context menu to display the about item.
function stageResize()
Callback executed when the window is resized
function updateSceneSizeAfterPagesAreClosed()
function getMaxContentHeight()
compute the content maximum height in all opened pages
function stretchScene()
Center layouts and content <=> compute offset to apply to the scene.
function centerScene(centerVertically: Boolean,
centerHorizontally: Boolean)
Center layouts and content <=> compute offset to apply to the scene.
function setBgColor(color_str: String)
Change bg_mc color.
function aboutCallback()
Callback function executed when the user select “about SILEX” in the context menu.
function refreshLoginMenuState()
Build the context menu for SILEX.
function loginCallback()
Callback function executed when the user select “login” in the context menu.
function flushLoginsCallback()
Callback function executed when the user select “flush login” in the context menu.
function promptPasswordCallback(login_str,
pass_str)
Callback function executed when the user select “login” in the context menu and do not have a login + password stored in the cookie.
function authenticationCallback(success: Boolean)
Callback function executed when the result of the authentication is arrived.
function logoutCallback()
Callback function executed when the user select “logout” in the context menu.
function start()
Start the loading process.
function dynDataLoaded(result: Array)
Override constants and config variables.
function overrideConfig(result: Array):Boolean
Override constants and config variables.
function preloadFileSuccess()
Callback executed when a file has been successfully preloaded.
function preloadFileError()
Callback executed when a file has not been successfully preloaded.
function preloadNextFile()
Preloads the next file in preloadFilesList array.
function preloadFilesStart(preloadFilesListLocal: Array)
preload files start<br /> call hooks<br /> call preloadNextFile
function preloadFilesDone()
Callback executed when all files have been loadded, with errors or not.
function openWebsite(idsite: String)
Close current website and open an other website on the same server.
function openSection(sectionName_str: String,
layoutFileName_str: String,
targetLayout: org.silex.core.Layout,
deeplinkName: String):Boolean
Start the loading process of a section.<br /> call hooks<br />
function layoutLoadedError(target_mc: MovieClip,
errorCode: String)
Called by layout_mcl when a layout is not loaded correctly.
function layoutLoadedComplete(target_mc: MovieClip)
Called by layout_mcl when a layout is loaded BEFORE 1st frame.
function layoutLoadedInit(target_mc: MovieClip)
Called by layout_mcl when a layout is loaded AFTER 1st frame.
function layoutLoadedInitNew(target_mc: MovieClip)
function registerLayout(silexLayout: org.silex.core.Layout)
Called by layoutLoadedInit.
function unRegisterLayout(silexLayout: org.silex.core.Layout)
Called by layoutLoadedComplete.
function getLayout(target_mc: MovieClip):org.silex.core.Layout
Find the layout object (silexLayout) at the root of the layout containing a given MovieClip.
function save (target_mc: MovieClip)
Save a section.
function saveDone (error_str: String)
Callback function executed when a save operation is done.
function getSeoData(layout: org.silex.core.Layout):Object
Build an indexable object for seo, search engine, rss.
function getPlayerByName(playerName_str: String)/*:org.silex.ui.UiBase*/
Use org.silex.ui.UiBase::playerName to retrieve the player named playerName_str in the players tool box.
function registerEmbeddedFont(fontName_str: String)
Store all fonts in silex_ptr.config.embeddedFont array.
function screenSaverInit()
Initialize the screen saver system.
function screenSaverDeactivate()
Turn back to normal mode because activity has been detected.
function screenSaverActivate()
Turn into screen saver mode because there was no activity for a certain amount of time.
function screenSaverSignal()
Delay the screen saver activation because activity is detected.
function refreshAllLayers()
Called by org.silex.core.Api.config object (watch on globalContext).
function isAChildDirty(targetLayout: org.silex.core.Layout):Boolean
Check if one of the target’s child layout is dirty,
public function promptPassword(text_str: String,
cbkFunction: Function):MovieClip
Ask the user to login