ActionScript Reference - CMSMaster

 

CMSMaster.editMode

Availability

Flash Player 7

Usage

myCMSMaster.editMode:Boolean

Description

Boolean. If fCMS is in editing mode this property will return true, otherwise false

Example

The following code will output true if fCMS is in editing mode

trace(myCMSMaster.editMode)

 

 

CMSMaster.topLevel

Availability

Flash Player 7

Usage

myCMSMaster.topLevel:Number

Description

Number. fCMS dialogs are by default loaded in the highest depth of _level0. In cases where the fCMS enabled .swf is loading external files at higher levels, set this property to the highest existing _level. This way, the dialog windows will always be on top of the existing content.

Example

The following code will set topLevel to 5

myCMSMaster.topLevel = 5;


CMSMaster.end

Availability

Flash Player 7

Usage

myCMSMaster.end()

Parameters

None.

Returns

Nothing.

Description

Method; will exit from the administration mode. Same as clicking on the close button of fCMS shell.

Example

The following code will exit from the administration mode:

myCMSMaster.end();


CMSMaster.moduleInit

Availability

Flash Player 8

Usage

listenerObject = new Object();  
listenerObject.moduleInit = function( eventObject ){  	
// insert your code here   
trace( eventObject.moduleType );   
}  
myCMSMaster.addEventListener( "moduleInit", listenerObject )

Event Object Parameters

module - path to the module movieclip
moduleType - String; type of module. Can be: "fbrowser", "text", "image"
satellite - path to the satellite movieclip
satType - String; type of currently active satellite. Can be "text" or "image"

Description

Event; broadcast to all registered listeners when fCMS module is loaded and initialized.

Example 1

The following code will allow only JPEGs to be browsed and uploaded when 'Browse' button of image module is clicked:

myListener = new Object();
myListener.moduleInit = function( eo:Object ){
   	if ( eo.moduleType == "fbrowser" && eo.satelliteType == "image" ) {  	
	// disable files with other extensions from showing up inside server file browser  
		eo.module.fileBrowser.extensionFilter = ["jpg","jpeg"];  		
	// set up parameters for FileReference.browse method  
		eo.module.fileUploader.descriptions = ["JPEG files"];  	
		eo.module.fileUploader.extensions = ["*.jpg;*.jpeg"];  	
		eo.module.fileUploader.macTypes = ["JPEG;jp2_"];  
	}  
}
myCMSMaster.addEventListener("moduleInit", myListener);

Example 2

The following code will make text editor always have only "bold" and "italic" controls:

myListener = new Object();
myListener.moduleInit = function( eo:Object ){
   	if ( eo.satType == "text" ) {  	
	// set controls parameter of FlashTextEditor component inside "text" module  
		eo.module.fte.controls = ["bold","italic"];  
	} 
}   
myCMSMaster.addEventListener("moduleInit", myListener);

 

CMSMaster.dialog

Availability

Flash Player 7

Usage

listenerObject = new Object();  
listenerObject.dialog = function( eventObject ){  
// insert your code here
   	trace(eventObject.message); 
}  
myCMSMaster.addEventListener("dialog", listenerObject )

Event Object Parameters

promptType - String. Type of dialog
message - String; Prompt message

Description

Event; broadcast to all registered listeners when fCMS dialog appears

Example

The following code handles the dialog event:

myListener = n

 


CMSMaster.request

Availability

Flash Player 7

Usage

listenerObject = new Object();  
listenerObject.request = function( eventObject ){  
// insert your code here   
	trace(eventObject.action);   } 
myCMSMaster.addEventListener("request", listenerObject )

Event Object Parameters

action - String. Can be "load", "save" and "login"
data - XML. XML Object sent to the backend

Description

Event; broadcast to all registered listeners when request is send to the backend from fCMS

Example

The following code handles the request event:

myListener = new Object();   
myListener.request = function( eo:Object ){    
if ( eo.action == "load" ) 
trace( "loading of content started..." );  
}   
myCMSMaster.addEventListener("request", myListener);


CMSMaster.response

Availability

Flash Player 7

Usage

listenerObject = new Object();  
listenerObject.response = function( eventObject ){  	//
 insert your code here
   	trace(eventObject.action); 
}  
myCMSMaster.addEventListener("response", listenerObject )

Event Object Parameters

action - String. Can be "load", "save" and "login"
data - XML. XML Object recieved from the backend

Description

Event; broadcast to all registered listeners when response is recieved from the backend

Example

The following code handles the response event:

myListener = new Object();   
myListener.response = function( eo:Object ){    
if ( eo.action == "load" ) trace( "loading of content is finished" );  
}   
myCMSMaster.addEventListener("response", myListener);

 

CMSMaster.loadHandler

Availability

Flash Player 7

Usage

myCMSMaster.loadHandler = function(eo) {
//insert your code here
trace("Content Loaded");
}

Description

Event; called when content of the editable elements is loaded.

Example

The following code handles the load event:

if (myCMSMaster.sequential)
play ();
else {
myCMSMaster.loadHandler = function(eo) {
trace("Content Loaded");
play ();
}
stop();
}

 

CMSMaster.password

Availability

Flash Player 7

Usage

listenerObject = new Object();
listenerObject.password = function( eventObject ){
	// insert your code here 
	trace(eventObject.value); 
}
myCMSMaster.addEventListener("password", listenerObject )

Description

Event; broadcast to all registered listeners when login name / password is proccessed.

Example

The following code handles the password event:

myLoadListener = new Object(); 
myLoadListener.password = function( eo:Object ){ 
 if (eo.value) trace("Login successful!"); 
 else trace("Login failed!");
} 
myCMSMaster.addEventListener("password", myLoadListener);

 

 

CMSMaster.start

Availability

Flash Player 7

Usage

myCMSMaster.start()

Parameters

None.

Returns

Nothing.

Description

Method; displays password prompt, same action is executed as when typing the key sequence.

Example

The following code will show the password prompt:

myCMSMaster.start();

 

 

CMSMaster.translation

Availability

Flash Player 7

Usage

myCMSMaster.translation:Object

Description

Gives developer posibility to translate text that appears in fCMS. Default values are:

def = { initial: "<B>fCMS</B> v1.1.0",
whileSaving: "Saving Content...",
whileLoading: "Loading...",
loadingModule: "Loading Module",
buttonUpdate: "Update",
labelTextfield: "textfield:",
saveSucces: "Content was saved successfully!",
saveNothing: "Nothing to save!",
saveError: "Error while saving content",
loadError: "Error while loading content",
labelPage: "page:",
save_btn: "Save Changes",
close_btn: "Close fCMS",
minimize_btn: "Toggle Visible",
fbrowse_btn: "File Browser",
buttonBrowse: "Browse",
buttonAutoSize: "AutoSize",
buttonAutoFit: "AutoFit",
radioImage: "Image",
radioCaption: "Caption",
loading: "Loading...",
pluginIs7: "fCMS Admin requires Flash Player 8" };

Example

The following code will make ToolTip text for close button of the shell "Hello"

myCMSMaster.translation = {

	close_btn:"Hello"
}