Forms.callFunction() This page was last modified over 30 day(s) ago and has 0 comment(s)

Back to Forms Class Summary

Windows, Mac OSX, Linux

mdm.Forms.formName.callFunction(functionName:String, parametersString:String, delimiter:String):void

functionName:String - Function to be executed
parametersString:String - Parameters delimited with character passed in "delimiter" argument
delimiter:String - Delimiter used for the parameters


Executes the specified function in the specified Form.

That is required that methods are to be called are registered in application. This is done using ExternalInterface programming api. Please see below sample code.

in AS1/AS2 authoring tool that is required to force ExternalInterface inclusion into output by either:
using fully qualified class name:

flash.external.ExternalInterface.addCallback("myFunction", this, myFunction);

using explicit import:

import flash.external.ExternalInterface;
// then
ExternalInterface.addCallback("myFunction", this, myFunction);

To pass complex objects between forms you could serialize them into JSON-like strings and then deserialize back to object.
More information on how to use this command can be found in the 'Manipulating Forms' page in the 'Using Forms' chapter in the 'Using Zinc 4.0' chapter in the 'General Help File'.

Example Code
import flash.external.ExternalInterface;
// in initialization routine in your form:
ExternalInterface.addCallback( "myFunction", myFunction );
// methods of objects
ExternalInterface.addCallback( "testMethod", someObject.testMethod);

// later in code
var form:Object = mdm.Forms.getFormByName("MyForm");
form.callFunction("myFunction", "param1@param2", "@");

mdm.Forms Class Example Downloads
No Example Downloads Available

Registered Users must be logged in to 'MyAccount' to add a Comment - Log In Here
  After Logging In, Click Here to Refresh This Page