MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 552

Actionscript 2.0 language reference
Table of Contents

Advertisement

Returns
- If the call succeeded, returns
Boolean
available, a security restriction was encountered, there was no such function object, a
recursion occurred, or something similar, returns
A return value of
false
sandbox to which the calling code does not have access. You can work around this problem by
setting an appropriate value for the
HTML of the containing environment.
Example
The following example registers the
container with the name
import flash.external.*;
var methodName:String = "goHome";
var instance:Object = null;
var method:Function = goToMacromedia;
var wasSuccessful:Boolean = ExternalInterface.addCallback(methodName,
instance, method);
var txtField:TextField = this.createTextField("txtField",
this.getNextHighestDepth(), 0, 0, 200, 50);
txtField.border = true;
txtField.text = wasSuccessful.toString();
function goToMacromedia() {
txtField.text = "http://www.macromedia.com";
getURL("http://www.macromedia.com", "_self");
}
For the previous example to work properly, you should copy and paste the following code into
the containing HTML page. This code relies on the
attribute of the
name
returns the appropriate syntax depending on the browser, since Internet Explorer
thisMovie
and Netscape refer to the movie object differently. Unless the HTML page is hosted on a
server, your browser may alert you with a security warning.
Avoid using other methods of accessing the plug-in object, such as
document.getElementByID
other methods do not work consistantly across all browsers.
<form>
<input type="button" onclick="callExternalInterface()" value="Call
ExternalInterface" />
552
ActionScript classes
true
may also mean that the containing environment belongs to a security
allowScriptAccessOBJECT
goToMacromedia()
.
goHome
tag to have the value
EMBED
("pluginName") or
. If it failed because the instance was not
.
false
tag or
function as callable from the
attribute of the
id
externalInterfaceExample
document.all.pluginName
tag in the
EMBED
tag and the
OBJECT
. The function
, because these

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF