This class is used to execute SILEX commands. It is a singleton pattern.
| org. | This class is used to execute SILEX commands. |
| Variables | |
| silex_ptr | Reference to silex main Api object (org.silex.core.Api). |
| Functions | |
| Interpreter | Constructor. |
| exec | Call the method corresponding to the desired command. |
| updateSource | Find a movie clip corresponding to a path relatively to a source clip. |
| buildActionArrayFromString | Takes series of commands separated by ‘\n’, i.e a line break. |
| extract | Separates name of function from the params. |
| modify_val | Check if a number has to be incremented or decremented. |
| openUrl | Open a URL. |
| http | Open a URL |
| mailto | Open a programm to write an email to the specified adress. |
| download | Open the browser download dialog box. |
| javascript | Execute a javascript command. |
| set | Set a variable value |
| del | Delete a variable. |
| show | Show a clip or a player. |
| hide | @param targetObjectPath_str path to the object which contains the property to modify @example hide:aaa @example aaa.hide |
| trace | Trace, i.e. |
| alert | Output something in a message box. |
| alertSimple | Output something at the bottom of the screen. |
| send_text | Sends a component’s html text to a script (for printing or send by mail). |
| Open the browser print dialog. | |
| log | Logs a message on the server - use cgi/scripts/log_command.php. |
| openWebsite | close current website and open an other website on the same server |
| open | Open an internal link. |
| close | Close the layout opened by calling mc. |
| tag_config | Configures the tag system to prepare tag command calls. |
| tag | Call the cyberestat tag system (of mediametrie estat). |
| flatten | Convert an array or elements of an array or object to a string. |
| serviceCall | Call a webservice and returns the result The result is placed in <<silex.lastResult>> - either fault object (use lastResult.faultstring) or service call result and the specified success or error event is thrown |
| getLatestSilexVersion | call the service to retrieve silex latest version number the player which is the source of the call will dispatch an onLatestSilexVersion event |
| open | @param extract_array[1]=xml file name without extention, @param extract_array[2]=[optional] “none” or layout url or child layout number, @param extract_array[3]= [optional] Object in which to open the section (self,parent,child), @example ouvrir:test,none,child @example open:test,none,child,fiches_ |
| open_icone | @param extract_array[1]= [optional] icone number (default = 1), @param extract_array[2]= [optional] layout level (default = self), 1st layout is number 1, valid values : [1,100] @example open_icone:1 @example open_icone:1,3 |
| back | @param extract_array[1]= (+/-)number of times to come back @param extract_array[2]= [optional] dbdata (or none)/no_dbdata => do not pass current dbdata_obj to the new page (default=none=pass the dbdata) @example back:-5 @example back:0 |
function exec( command_str: String, initialSource_mc: Object ):Boolean
Call the method corresponding to the desired command.
| command_str | a source, method and parameters like relative.path.to.source.method:param1,param2,... |
| initialSource_mc | movie from which comes the command (source is relative to this parameter) |
true if no error occured
private function updateSource ( source_mc: Object, path_str: String ):Object
Find a movie clip corresponding to a path relatively to a source clip. @private
| param | source_mc source clip |
| param | path_str path relative to the source clip |
movie clip corresponding to a path relatively to a source clip
function buildActionArrayFromString( _str: String ):Array
Takes series of commands separated by ‘\n’, i.e a line break. Returns an array of objects which are a model of the commands. Used by ui.players.Abstract. Used by toolbox.Actions. Here, specifier means “onRelease” in the command “onRelease myCommand:myParam1,myParam2”. @example buildActionArrayFromString(“onRelease alert:test of alert\nonRollOut nameOfPlayer.hide:”) will return [{modifier:”onRelease”, functionName:”alert”, parameters:array(“test of alert”)},{modifier:”onRollOut”, functionName:”hide”, parameters:array(“nameOfPlayer”)}]
| param | _str commands separated by ‘\n’, i.e a line break |
an array of objects which are a model of the commands
function send_text( scriptUrl_str: String, target_str: String, isHtml_str: String, params_str: String, usePostMethod_str: String )
Sends a component’s html text to a script (for printing or send by mail).
| scriptUrl_str | script url |
| target_str | [optional] target window : _blank (default), _self, or a frame id |
| isHtml_str | [optional] boolean: true (default) or false (= raw text only) |
| params_str | [optional] parameters to pass to the script (url style) |
| usePostMethod_str | [optional] method used to send data: true => POST (default) or false => GET |
function PRINT( textField, useHtml, useBgColor )
Open the browser print dialog. !!! Works only with one page long text... For several pages use : onRelease Text1.send_text:cgi/scripts/print.php. Print the content of a text field.
| textField | text field name |
| useHtml | [optional] keep formatting - default = true |
| useBgColor | [optional] print on bg color - default = true |
function flatten( separator: String, subElementName: String ):String
Convert an array or elements of an array or object to a string.
| param | separator what to put between elements. ex: “,” |
| param | subElementName [optional] path to the sub-element in each array element. The function works a like Array.join if this parameter is not given |
function serviceCall( serviceName_str: String, successEvent: String, errorEvent: String )
Call a webservice and returns the result The result is placed in <<silex.lastResult>> - either fault object (use lastResult.faultstring) or service call result and the specified success or error event is thrown
| param | serviceName_str |
| param | successEvent event thrown after a successfull call |
| param | errorEvent event thrown on an error |
| param | other params passed to the webservice |
@param extract_array[1]=xml file name without extention, @param extract_array[2]=[optional] “none” or layout url or child layout number, @param extract_array[3]= [optional] Object in which to open the section (self,parent,child), @example ouvrir:test,none,child @example open:test,none,child,fiches_
Reference to silex main Api object (org.silex.core.Api).
private var silex_ptr: org.silex.core.Api
Constructor.
function Interpreter( api: org.silex.core.Api )
Call the method corresponding to the desired command.
function exec( command_str: String, initialSource_mc: Object ):Boolean
Find a movie clip corresponding to a path relatively to a source clip.
private function updateSource ( source_mc: Object, path_str: String ):Object
Takes series of commands separated by ‘\n’, i.e a line break.
function buildActionArrayFromString( _str: String ):Array
Separates name of function from the params.
function extract( command_str: String ):Array
Check if a number has to be incremented or decremented.
function modify_val( arg_var_num: Number, val_str: String ):Number
Open a URL.
function openUrl( url_str: String, target_str: String )
Open a URL
function http( url_str: String, target_str: String )
Open a programm to write an email to the specified adress.
function mailto( adress_str: String )
Open the browser download dialog box.
function download( initialFileName_str: String, finalFileName_str: String )
Execute a javascript command.
function javascript()
Set a variable value
function set( propertyName_str: String, value_str )
Delete a variable.
function del( propertyName_str: String )
Show a clip or a player.
function show( targetObjectPath_str: String )
@param targetObjectPath_str path to the object which contains the property to modify @example hide:aaa @example aaa.hide
function hide( targetObjectPath_str: String )
Trace, i.e.
function trace()
Output something in a message box.
function alert()
Output something at the bottom of the screen.
function alertSimple()
Sends a component’s html text to a script (for printing or send by mail).
function send_text( scriptUrl_str: String, target_str: String, isHtml_str: String, params_str: String, usePostMethod_str: String )
Open the browser print dialog.
function PRINT( textField, useHtml, useBgColor )
Logs a message on the server - use cgi/scripts/log_command.php.
function log( logFileName_str: String, message_str: String )
close current website and open an other website on the same server
function openWebsite( id_site: String )
Open an internal link.
function open( sectionName_str: String )
Close the layout opened by calling mc.
function close()
Configures the tag system to prepare tag command calls.
function tag_config( serial_str: String, class_str: String )
Call the cyberestat tag system (of mediametrie estat).
function tag( pageName_str: String )
Convert an array or elements of an array or object to a string.
function flatten( separator: String, subElementName: String ):String
Call a webservice and returns the result The result is placed in <<silex.lastResult>> - either fault object (use lastResult.faultstring) or service call result and the specified success or error event is thrown
function serviceCall( serviceName_str: String, successEvent: String, errorEvent: String )
call the service to retrieve silex latest version number the player which is the source of the call will dispatch an onLatestSilexVersion event
public function getLatestSilexVersion()