View comments | RSS feed

ExternalInterface (flash.external.ExternalInterface)


Object
    |
    +-flash.external.ExternalInterface

public class ExternalInterface
extends Object

The ExternalInterface class is the External API, an application programming interface that enables straightforward communication between ActionScript and the Flash Player container; for example, an HTML page with JavaScript, or a desktop application with Flash Player embedded.

ExternalInterface is similar in functionality to the fscommand(), CallFrame() and CallLabel() methods, but is more flexible and more generally applicable. Use of ExternalInterface is recommended for JavaScript-ActionScript communication.

From ActionScript, you can call any JavaScript function on the HTML page, passing any number of arguments of any data type, and receive a return value from the call.

From JavaScript on the HTML page, you can call an ActionScript function in Flash Player. The ActionScript function can return a value, and JavaScript receives it immediately as the return value of the call.

ExternalInterface is supported in the following combinations of browser and operating system:

Browser

Operating System

Internet Explorer 5.0 and higher

 Windows 

 

Netscape 8.0 and higher

 Windows 

 Macintosh 

Mozilla 1.7.5 and higher

 Windows 

 Macintosh 

Firefox 1.0 and higher

 Windows 

 Macintosh 

Safari 1.3 and higher

 

 Macintosh 

ExternalInterface requires the user's web browser to support either ActiveX or the NPRuntime API that is exposed by some browsers for plugin scripting. See http://www.mozilla.org/projects/plugins/npruntime.html.

Availability: ActionScript 1.0; Flash Player 8

Property summary

Modifiers

Property

Description

static

available:Boolean [read-only]

Indicates whether this player is in a container that offers an external interface.

Properties inherited from class Object

constructor, __proto__, prototype, __resolve


Method summary

Modifiers

Signature

Description

static

addCallback(methodName:String, instance:Object, method:Function) : Boolean

Registers an ActionScript method as callable from the container.

static

call(methodName:String, [parameter1:Object]) : Object

Calls a function exposed by the Flash Player container, passing 0 or more arguments.

Methods inherited from class Object

addProperty, hasOwnProperty, isPropertyEnumerable, isPrototypeOf, registerClass, toString, unwatch, valueOf, watch



Version 8

Comments


lithiumlab said on Sep 17, 2005 at 9:49 AM :
i would like to see some examples. it opens a huge range of possibilities for hihgly dinamic websites.
jdehaan said on Sep 18, 2005 at 3:48 PM :
Hi there,

There are examples and tutorials in the Flash documentation. Please search "External API" in the Help panel (with quotes), or go to the following pages:

http://livedocs.macromedia.com/flash/8/main/00001599.html
http://livedocs.macromedia.com/flash/8/main/00001600.html
http://livedocs.macromedia.com/flash/8/main/00001601.html

There is also two example applications for this located in the samples that install with Flash:

C:\Program Files\Macromedia\Flash 8\Samples and Tutorials\Samples\ActionScriptxternalAPI
No screen name said on Sep 20, 2005 at 6:46 AM :
Are there particular Flash player or Internet Explorer settings that disable ExternalInterface.addCallback() ?

When we run our doc from a web page, ExternalInterface.available returns true, but ExternalInterface.addCallback() returns false. They both return true when run in the stand alone player (or ctrl+Enter).
shimi2 said on Sep 20, 2005 at 1:16 PM :
The following info may help you. From the addCallBack() docs: A return value of false may also mean that the containing environment belongs to a security sandbox to which the calling code does not have access. You can work around this problem by setting an appropriate value for the allowScriptAccess OBJECT tag or EMBED tag in the HTML of the containing environment.

Also, from the fscommand() docs:
When allowScriptAccess is set to "never", a SWF file cannot access web page scripts. With Flash Player 7 and later, when allowScriptAccess is set to "always", a SWF file can always access web page scripts. When allowScriptAccess is set to "sameDomain", scripting is allowed only from SWF files that are in the same domain as the web page; scripting is always allowed with previous versions of Flash Player. If allowScriptAccess is not specified in an HTML page, the attribute is set by default to "sameDomain" for SWF files of version 8 and later, and to "always" for SWF files of version 7 and earlier.
CheloXL said on Sep 29, 2005 at 1:09 PM :
ExternalInterface doesn´t work on created flash objects (either using the DOM or innerHTML/outerHTML) in Internet Explorer.
Both ExternalInterface.available and ExternalInterface.addCallback return true, but if you try to make a call you will get an error.
Also, html_Flash_Object.function_name returns "undefined", while on a normal page it returns "function" (html_Flash_Object is the node that flash belongs to, and funcion_name is the name of the registered callback)
labs@cbaconsult said on Oct 6, 2005 at 6:16 AM :
I've found some bugs on the internal serializer:

- If you have a TextInput with the text 99999999999, then put its text in an object (via onChange) and send this object as a parameter, jscript will receive an int of value 1215752191;

- any empty or space-only strings are treated as null

Ex: var myData = [{ok: 'string', turn_to_null:'', this_too: ' ', also_this: ' ', but_this_shows_ok: ' test '}]

Any clues?
shimi2 said on Oct 20, 2005 at 5:17 PM :
Hi -
Please file your bugs at
http://www.macromedia.com/go/wish
and be as specific as possible (your browser, OS, etc.)

Thanks!
Eric E. Dolecki said on Oct 24, 2005 at 8:22 AM :
I'm trying to pass unicode strings into Flash by using flash8.ocx ActiveX control and the ExternalInterface handlers. Thus far I've been observing the XML serialization that comes out of Flash, and I'm trying to mimick that serialization process in the host application (written in Python.)

I see that there is an argument element named "string", but I don't have much more information than that. Additionally, I have to strip the <?xml version="1.0" etc. etc. ?> off of the document I submit to flash8.ocx (otherwise Flash sends back an error), so I'm skeptical about the XML parser that Flash is using.

Is there a way I can inform the Flash deserializer about the encoding I'm using, or some other child element of the element that I should be using to indicate the encoding? Trying to pass some Unicode characters through into Flash for display.
Chuck Deisler said on Nov 1, 2005 at 10:19 PM :
Is it a bug that this doesn't work if you give your embed/object tag an id attribute?
Jankrod said on Dec 28, 2005 at 12:16 PM :
The serialization that is done by flash is great, and quite a time saver
when it comes to parsing the xml but is this all supported by actionscript
in the flash player? or is there a compiled function that the flash player
uses to get the object from the XML it receives?

I ask from an efficiency stand point. Because if the time it takes to parse
though all the tags is the same as if I walked an XML object I would
rather not send large arrays that use <number></number> around every
value. Now if the serializer is a compiled resource that is not interpreted
like actionscript then I would much rather use it for it would return an
array much faster.
No screen name said on Jan 4, 2006 at 8:18 AM :
we are using externalInterface with c#
while we can get messages back and forth, we are having problems when we make a class for the communications
is there a scope issue when you make a class for externalInterface functionality?
it doesnt seem to like to communicate with other objects or raise events
or am i doing something wrong?
Andrei Thomaz said on Jan 7, 2006 at 2:42 PM :
in the Externalnterface API reference, it is written that a javascript function called with ExternalInterface.call(). The function below doesn't use recursion in the scrict sense, but it does use a while loop. The function is aborted after the third execuction (it is trying to find the SCORM API, provided by the Learning Management Systems compatible with SCORM):

function findAPI( win )
{
while ( (win.API_1484_11 == null) && (win.parent != null) && (win.parent != win) )
{
window.alert("attempting to find API. try #" + findAPITries);
findAPITries++;
if ( findAPITries > 500 )
{
alert( "Error finding API -- too deeply nested." );
return null;
}
win = win.parent;
}

if (win.API_1484_11 != null) {
window.alert("API found at try #" + findAPITries);
return win.API_1484_11;
}
else {
window.alert("API not found");
return null;
}
}

The last message I get is "attempting to find API. try #2". The other alerts are not shown. Is this kind of loop aborted by ExternalInterface.call() ?
No screen name said on Jan 20, 2006 at 2:01 AM :
There seems to be a problem when using Externalinterface if the <OBJECT> is in a <FORM>

When i load the page there is a javascript error that says:

Line: 1
Char: 1
'Puff_Type1' is undefined
Code: 0

Is there a workaround?

Regards,
Robert Pohl
DavidHe_TM said on Jan 24, 2006 at 2:24 PM :
The datatype matching is important if you are dealing with different browssers. Explicitly declare/convert them before sending out.
anonym[+] said on Feb 6, 2006 at 11:25 PM :
*Flash object inside Form tag*

Here is a workaround I just figured out (and have posted it on a few other places where this was being discussed). As I've noticed, ExternalInterface (except for its internal part within the flash component) consists of some JavaScript functions which are executed inside the browser imperceptibly by Flash when loaded. Those scripts use flash object ID for their reference and unfortunately there was never considered to be a situation when Flash object is put within a Form tag that causes all the problems. I've tried it on IE 6 with Flash 8.

((Examples))

1. Flash calls JavaScript and submits data.

Inside the flash there are no specific changes for both methods. Make a Button and insert its ActionScript:

-----
import flash.external.*;
ExternalInterface.call ("flashCalls","The value from flash.");
-----

Inside HTML code, we have a flash object with the ID of "flashObject1". Create a client-side script block before the Flash object (inside or outside of Form tag) and put this:

-----
window.flashObject1 = new Object();
function flashCalls(val){alert("flash calls and says: "+val)}
-----

Yes, that dummy object will prevent a critical error inside javaScript machine that would stop the process halfway.

2. JavaScript calls Flash and submits data.

Make a dynamic text and put "_debug" in its Var and on the frame it strands, put this routine action:

--------
import flash.external.*;
function javaCallsFlash(val){
_debug = "JavaScript calls and says: "+ val
};

ExternalInterface.addCallback ("javaCalls", null, javaCallsFlash);
--------

Nothing unofficial yet. But on HTML side we've got to assign manually that javaCalls method to our Flash object (since Flash itself failed to do so). I place it in onload event of window object. You can put it where you're sure that when triggered, Flash Object had loaded completely.
Put this on that client-side script block you've just made (assuming Form tag id is "Form1" ):

---------
window.onload= function (){
Form1.flashObject1.javaCalls = function(val)
{string1 = "<invoke name=\"javaCalls\" returntype=\"javascript\"><arguments><string>"+val+"</string></arguments></invoke>"
Form1.flashObject1.CallFunction(string1) }
}
----------

That's it! From now on you can call JavaScript snippet below to see the result:

Form1.flashObject1.javaCalls("JavaScript salutes you! Unlike that smug Java ... ");

And yes it's still expandable but that was enough for me nonetheless since SetVariable() and GetVariable() methods still are doing their fine jobs.

Notes.
* Watch out for error handling when you're not using ASP.Net (which traditionally silences any JS errors). Keep in mind that Flash still produces two JS error (when you open up the browser and when you close it) which should be taken care of through window.onerror event.
* In Netscape there must be some minor changes that I didn't get any chance to try them out.

Regards.
No screen name said on Feb 14, 2006 at 1:37 PM :
Externalinterface does not work for ASP.NET (aspx) pages because the flash object must be placed inside a form.

When the flash object is placed inside a form a javascript error occurs when the flash object is assigned an ID tag.

The work around using a dummy object (proposed above) does not work!!

Have anybody got this to work inside a form tag?

This bug renders the Externalinterface usless for ASP.NET pages.
No screen name said on Feb 26, 2006 at 5:19 AM :
I was burning mid night oil to let my aspx page talk to Flash Media Server 2. Has anyone tried this using C# code behind. I need to upload a video and play it in the browser. Could anyone help plz....I have tried external api but it talks of HTML page and Java script + external api. Can some one give me pointers???
Note: I need to stream video from FMS2. The application that i am writing is asp.net/C#
jwatkins said on Mar 4, 2006 at 8:37 PM :
"Externalinterface does not work for ASP.NET (aspx) pages because the flash object must be placed inside a form."

It actually does. Instead of making the window.YourFlashName = new Object. Make it:

window.YourFlashName = document.forms[0].YourFlashName;

Then all should be right in the world. If you use VS, just debug the javascript to see what's going on.
jdrake3 said on Mar 6, 2006 at 2:39 PM :
I too am sitll experiencing this problem. The bug only occurs in IE, so I blamed Microsoft for not appropriately representing the DOM, but when using a different movie I got no error, so now I'm looking at Flash as the cause.
jdrake3 said on Mar 6, 2006 at 2:41 PM :
One work around that we have used is to place the movie in a div outside of the form tags, and then use Javascript to place that div at the disired location on the page.

Hope that this helps.
No screen name said on Apr 3, 2006 at 12:46 PM :
Did you try example from
"http://www.codeproject.com/csharp/flashexternalapi.asp?df=100&forumid=226349&select=1434607&msg=1434607"?

I did and no success!
No screen name said on Apr 12, 2006 at 8:53 AM :
i make a simple aspx page with a flsh movie to act as a data grid without postback (when the user select from an html combo box server control it calls a java script method that call a nother method in my flash movie which will display the data a ccording to the user selection ) BUT the form doesn't i think that was because of asp but when i design all my work using html it fails also but when i run my page local it success!! and when i save the aspx form as html and run it local it work also i become crazy of that (Any help please)
mraad23 said on Apr 17, 2006 at 4:40 AM :
Afer window.yourFlashName = new Object(); I had to __flash__addCallback(window.yourFlashName, "myActionScriptFunctionName"); to make it work (at least in 8.5)
briandunnington said on May 9, 2006 at 4:56 PM :
here is my workaround for the "movies inside of FORM tags dont work properly" bug. simply include the following javascript BEFORE the flash movies in the HTML. (this code is based on the work by anonym[+] posted above)

&lt;script type="text/javascript"&gt;
function ExternalInterfaceManager()
{
this.registerMovie = function(movieName) {
if(!window.fakeMovies) window.fakeMovies = new Array();
window.fakeMovies[window.fakeMovies.length] = movieName;
}
this.initialize = function() {
if(document.all)
{
if(window.fakeMovies)
{
for(i=0;i&lt;window.fakeMovies.length;i++)
{
window[window.fakeMovies[i]] = new Object();
}
window.onload = initializeExternalInterface;
}
}

}
}

function initializeExternalInterface()
{
for(i=0;i&lt;window.fakeMovies.length;i++)
{
var movieName = window.fakeMovies[i];
var fakeMovie = window[movieName];
var realMovie = document.getElementById(movieName);

for(var method in fakeMovie)
{
realMovie[method] = function() {flashFunction = "&lt;invoke name=\"" + method.toString() + "\" returntype=\"javascript\"&gt;" + __flash__argumentsToXML(arguments, 0) + "&lt;/invoke&gt;";this.CallFunction(flashFunction);}
}

window[movieName] = realMovie;
}
}

&lt;/script&gt;


&lt;script type="text/javascript"&gt;
var eim = new ExternalInterfaceManager();
eim.registerMovie("ShockwaveFlash1");
eim.registerMovie("ShockwaveFlash2");
eim.initialize();
&lt;/script&gt;
No screen name said on May 24, 2006 at 2:34 AM :
It would be useful to have some kind of reference to the xml that the callFunction-method takes as an argument.
The only info about that that I have managed to find is in various samples.
ex: <invoke name="setData" returntype="xml"><arguments><string>some data</string></arguments></invoke>

I would like to know, for example
1. which types of arguments that are allowed (i've only managed to get <string> and <number> to work)
2. If, and how, it is possible to send arbitrary objects.
3. Which values that are allowed as returntype and what the difference is between them.

-----------------------------
Niklas Andersson
System developer
SVT (Swedish Television)
yaroukh said on Jun 7, 2006 at 1:28 AM :
Leaving page containing flash-object that calls addCallback-method and doesn't have the id-attribute set (or a standalone SWF-file) triggers quite unreadable JS-error in MSIE6.

My botomline: When using ExternalInterface.addCallback, be sure to have defined the id-attribute for your OBJECT element.
TheGuern1960 said on Jun 30, 2006 at 7:34 AM :
Here's a more simple workaround: add a nested form tag somewhere on the asp.net page. It can just be an empty form:

form id ="outerForm" method="post" runat="server"

form method="post"
/form

myFlashObject

/form

Somehow, having that extra form on the page allowed the Flash player to find myFlashObject. I discovered this when I removed an ASP.NET server control (.ascx) from my page and found that my flash movie was broken. Inspecting the html generated by IIS (from the original page with the .ascx), the difference was the added nested form tag.
RasmusFyens said on Aug 29, 2006 at 1:00 AM :
Brian Dunnington: I like your solution, and I understand how it works. But what happens if all methods have not yet been added when the onload event occurs? - does your script require all exported functions to be placed in frame 1, or does ExternalInterface automatically register all methods prior to onload?
Gordan.iz.hr said on Sep 1, 2006 at 7:18 PM :
FIRST ISSUE: ExternalInterface/Firefox(1.5) bug: open Alert, open PopUp, open anything out of the main window...

javascript function should be like

<script>
function javaAlert(sentFromFlash) {
var tajmaut=setTimeout("alert('"+sentFromFlash+"')",1);
return whatever;
}
</script>

wrong:

<script>
function javaAlert(sentFromFlash) {
var tajmaut= alert(sentFromFlash);
return whatever;
}
</script>

so, the bug was (and still is) in 1 stupid millisecond ! (maybe you should put few milliseconds more , just for safety)

////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////

SECOND ISSUE: ExternalInterface/ASPX flash registration

quite simple, it works 100% (checked: IE6, FIREFOX1.5):

(VisualBasic)
............
Sub Page_Load(sender As Object, e As EventArgs)
............
Define_js
............
End Sub

Sub Define_js()

Dim registerFlash As String = " function FlashRegistration() { window.flashObjectID = document.forms[0].flashObjectID;} window.onload = FlashRegistration;"
Dim registerFlashScript As String = "<script language=javascript>" & registerFlash & chr(60) & "/script>"
Page.RegisterStartupScript("myScript",registerFlashScript)

End Sub

////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////

So, after two days of messing around, now I can say: ExternalInterface Rocks!
jelaplan said on Oct 5, 2006 at 6:44 AM :
I've used the JavaScript Integration Kit that (http://weblogs.macromedia.com/flashjavascript/). Is the ExternalInterface API a replacement or a substitute? I recall listening to a podcast from Christian Cantrell and Mike Chambers and they suggested that the integration kit technology would be integrated into Flash 8.
No screen name said on Nov 3, 2006 at 9:23 AM :
The nested form trick does prevent the flash problems but it isn't valid html and causes other problems. With .net you loose the viewstate and ___doPostBack fails. I've had some success using ExternalInterfaceManager and SWFObject together - working great in firebox but in IE there is still an object doesn't support this property or method on this bit of javascript that flash injects.

try { treeviewSideBar.SetReturnValue(__flash__toXML(flashTreeViewEvent("treeReady")) ); } catch (e) { treeviewSideBar.SetReturnValue("<undefined/>"); }
No screen name said on Nov 9, 2006 at 3:04 PM :
Regarding TheGuern1960's hack-fix. I tried placing and extra, empty form inside of my normal form and it did indeed stop the javascript error, but now my Button in my normal form no longer posts-back the form. I click it and nothing happens.
palodau said on Nov 14, 2006 at 6:35 PM :
I am currently developing an online application which makes use of Flash/javaScript communication. When I use ExternalInterface.call to a function that opens a window in Firefox, my Flash application drastically slows down and my components become almost unresponsive. This is enough to kill the application:

//code in flash
import flash.external.*;
var callJSFunction:String = "openTestPage";
ExternalInterface.call(callJSFunction);

//code in containing html page
function openTestPage()
{
window.open("testPage.html", "_blank");
}

This problem does not appear in IE. Currently my only solution for Firefox is to use setInterval to make a delayed call to a second javaScript function that actually handles the processing. Has anyone experienced this problem and/or developed a better work around?
quuux said on Nov 22, 2006 at 8:21 PM :
Workaround for IE <form> bug is to use following line of javascript code after the movie:

window.yourMovieName = document.getElementById('yourMovieName');

This adds a window-level pointer to the movie so that it can be referenced directly using just the name. Of course, you should add the appropriate sniffing code to only execute this line when necessary, which seems to be only IE.

hope this helps.
Joseph Gabriel
kamermans said on Dec 29, 2006 at 11:08 PM :
After many hours of frustration with this ExternalInterface() in a FORM tag in IE problem, I have written a script that fixes this issue before the SWF loads and therefore generates zero javascript errors and allows the ExternalInterface() to function properly.

The script is called SWFFormFix.js and is available from my blog here:
http://www.teratechnologies.net/stevekamerman/index.php?m=12&y=06&entry=entry061230-004100

I made a few pages with some examples of the problems that people run into with ExternalInterface() and forms on IE, and a demonstration of SWFFormFix in action:
http://devel.teratechnologies.net/swfformfix/test4.php

If you have any problems, let me know! My contact info is in the first link.
SilverDev said on Jan 23, 2007 at 1:31 PM :
CheloXL said that the ExternalInterface functionality fails when the content is brought in via innerHTML. This is not true. It does work.

With my site, I have an external XML file that I pull in the innerHTML from, and dynamically create the DIVs and populate them, including ones with Flash Objects.

If you're having problems, doublecheck that you have allowScriptAccess set. Then, create a simpler example of your code testing only these features. Worked for me. Turned out I had an error somewhere else that was causing debug messages that led me to ExternalInterface.

Good luck!
-=-
pedroponting said on Feb 14, 2007 at 8:04 PM :
The workaround for .aspx pages proposed by TheGuern1960 works perfectly and is dead easy. This problem has been driving me crazy so thank you.
TroyWorks said on Feb 24, 2007 at 8:22 PM :
How is it possible to remove the ExternalInterface.callback? e.g. I have multiple swfs that need to use the same callbacks.
pedroponting said on Feb 28, 2007 at 8:10 PM :
There is a problem with the workaround of nesting a form inside the main <form runat="server"> tag. It stops the page working properly! For example, submit button clicks won't fire the server-side onClick event. Pity.
No screen name said on Mar 13, 2007 at 8:58 PM :
after 6 hours wasting my time, I realized two things:

- ExternalInterface class doesn't work with a flash object embed in Mozilla Firefox, with AC_RunActiveContent.js (from Adobe). So you´ll have to use swfobject.js (just type it in google)

- The second thing is that, if you use swfobject, you can't use "getUrl(javascript:function)" on IE Explorer. You have to use ExternalInterface.call() function.

- Summing up, for now, use ExternalInterface in flash, and 'swfobject.js' in HTML

tks
yaroukh said on Apr 10, 2007 at 8:39 AM :
The default variable "arguments" in a JS-function that has called via ExternalInterface.call is not an array, therefore common Array-methods cause errors.
FF 2.0.3
yaroukh said on Apr 10, 2007 at 3:03 PM :
The default variable "arguments" in a JS-function that has been called via ExternalInterface.call is not an array, therefore common Array-methods cause errors. (BTW I consider it being a bug.)
FF 2.0.3
--
I am sorry for the typo in previous message at (http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002200.html); could someone delete it PLZ?
Matrix211v1 said on Apr 12, 2007 at 1:31 PM :
It is returning the information fine in FireFox but for IE, I always get "undefined" or "null". Even forcing it to return "Hello World" results in undefined in IE but fine in FireFox

function determinePageURL()
{
import flash.external.*;
var rtnVal:String = ExternalInterface.call("function (){return 'Hello World';}").toString();
myTrace(">>> rtnVal = " + rtnVal);
return rtnVal;
}
dfreelan said on Apr 16, 2007 at 2:18 PM :
ExternalInterface:
I am using ExternalInterface.call to open a new sized browser window. But I am finding that in Safari version 1.3.2 on a Mac with OS 10.3.9 the pop-up blocker blocks the window from opening. If I use getURL to call the same Javascript function Safari does not block it. Any ideas of a work around as we need to use the capabilities of ExternalInterface.
felixdakatt said on May 2, 2007 at 11:49 AM :
Can you pass command line parameters into a flash projector osx and exe

example
myFlashProjector.exe -textbox1 hello -textbox2 world
so that when another flash projector i have uses an fscommand("exec","myFlashProjector.exe -textbox1 hello -textbox2 world");
the myFlashProjector.exe will read in those 2 parameters and display them in a textbox?
No screen name said on May 2, 2007 at 9:14 PM :
I am having trouble with using externalinterface in IE, this work in firefox.

I am passing an error string to a flash movie using the following sample.
document.getElementById('alertID').asFunc(sMessage);

This works get the first time I call it, however if I change the text to send, it does not send the new text. It seems to be caching to first submission. This does not happen in firefox... same code same page in firefox works...
Any Ideas why IE is caching the first string and how do I fix short of refreshing the page... thanks in advance
Zexavier said on May 21, 2007 at 4:04 AM :
For all with problems in IE 7 or IE 6, please see this example:

http://devel.teratechnologies.net/swfformfix/extinterface-swfformfix2.php

New ExternalInterface() in Form Example with FLA :
http://www.teratechnologies.net/stevekamerman/index.php?m=01&y=07&entry=entry070101-033933

and see my post in Steve Kamerman's Blog in:
http://www.teratechnologies.net/stevekamerman/comments.php?y=06&m=12&entry=entry061230-205245

Steve found the solution!!! My swf is comunicating with javascript (and de oposite) inside an aspx and It works in .Net V2 betwin posts!!
No screen name said on Jun 12, 2007 at 3:04 AM :
ExternalInterface.call does not works at the browser, Oprea. Is anyone knows this problem? How did you resolve this problem? Please let me know if somebody know solution for this problem.

Refer to following URL.
http://www.playonflash.com/externalcall/test.htm

Thanks.
No screen name said on Jul 8, 2007 at 1:35 AM :
Hi,
I have been trying to get javascript menu pop ups that would be called from different buttons inside one single .swf (with javscript menu position according to flash button...) I have tried using external.Interface but I cannot make the connection with the javascript menu function. Here is the function I am using:

window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
for (var i = 1; i<=10; i++) {
if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
}
if (d) {d.style.display='block';}
}


and in Flash, in the actions layer, I know the structure should be like this, but i do not what to assign to the variables...

import flashexternal.*;

this.sketches.onRelease = function () {
var d:
var i:
ExternalInterface.call ("montre","d","i")

};

Any help would be awesome!!! Peace!
atxatx said on Jul 12, 2007 at 7:46 AM :
No screen name: ExternalInterface does work in Opera, in version 9 or newer.
No screen name said on Jul 21, 2007 at 1:37 AM :
I would like to point out the fact that after moving a node in the DOM hierarchy that contains a flash object by using appendChild all calls to externalinterface return an unspecified error in IE.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00002200.html