Developer Guide
[ 5 ] - Scripting
< Back Next >Within a Meta extension scripts are able to be executed within:
- A Meta scripting host, with the script declared as part of a script function object. Up to twenty (20) script function objects are able to execute simultaneously. Each script function object executed within its own thread and independent of the state and context of the browser.
- The Internet Explorer script host, with the script coded within a <script> element of a HTML resource.
Futhermore any ActiveScript compatible Scripting language can be used.
Meta provides scripting objects for working with data, view and function objects for both types of script hosts. The names of these scripting objects are "AM_data", "AM_view" and "AM_function". The Scripting reference documentation contains details of the properties and methods of these scripting objects
As an example the AML declaration for the script function object "fid_letter_cnt", used by the Hello World is shown below with the scripting objects "AM_data" and "AM_view" highlighted. The "AM_data" scripting object is used to modify the data object "did_message" with the "AM_view" object used to present a message dialog.

As another example the HTML resource "wnd_hello_wnd.html" is shown below with the scripting objects used within the "lowercase" script function highlighted. The "AM_data" scripting object is again used to work with "did_message" data object changing the value held to lowercase. Next the "Run" method of function scripting object is used to execute the canned function object "_fid_data_set". This forces an update of the <span> element which is bound to the "did_message" data object.

Note that the "lowercase" script function shown above is not called directly from within the HTML resource itself. Instead a "call_script" function object having an identifier of "fid_lowercase" is used. This object is referenced by the "lowercase" menu item of the "vid_menu_format" menu view object. Clicking this menu item causes the "fid_lowercase" call_script function object to execute which in turn calls the "lowercase" script to Run within the HTML resource. The sequence is shown below.
