Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 520

Programming actionscript 3.0
Table of Contents

Advertisement

As this example shows, the ExternalInterfaceProxy class's
method is very similar to its
Call()
ActionScript counterpart,
. The first parameter is a string, the
ExternalInterface.Call()
name of the function to call. Any additional parameters (not shown here) are passed along to
the ActionScript function. If the ActionScript function returns a value, that value is returned
by the
method (as seen in the previous example).
Call()
Inside the ExternalInterfaceProxy class
Using a proxy wrapper around the ActiveX control may not always be practical, or you may
wish to write your own proxy class (for instance, in a different programming language or
targeting a different platform). Although not all the details of creating a proxy will be
explained here, it is instructive to understand the inner workings of the proxy class in this
example.
You use the Shockwave Flash ActiveX control's
method to call an
CallFunction()
ActionScript function from the ActiveX container using the External API. This is shown in
this extract from the ExternalInterfaceProxy class's
method:
Call()
// Call an ActionScript function on the SWF in "_flashControl",
// which is a Shockwave Flash ActiveX control.
string response = _flashControl.CallFunction(request);
In this code excerpt,
is the Shockwave Flash ActiveX control. ActionScript
_flashControl
function calls are made using the
method. That method takes one
CallFunction()
parameter (
in the example), which is a string containing XML-formatted
request
instructions including the name of the ActionScript function to call and any parameters. Any
value returned from ActionScript is encoded as an XML-formatted string and sent back as the
return value of the
call. In this example, that XML string is stored in the
CallFunction()
variable.
response
520
Using the External API

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents