ExternalInterface problem in IE
I cannot get ExternalInterface to work in either IE 6 or 7
– either from Flash to the HTML page or vice versa.
I have DIVs containing various SWFs that can be opened and
closed by the user. Many of them need to be reset when a user
closes them, an some need to be told to play when they're opened.
This works absolutely fine in Firefox (Mac or PC), but always fires
an error in IE: "Object doesn't support this property or method".
I've searched high and low for a solution to this, but all I
find are suggestions regarding the SWF being inside a form (not
applicable), or just saying "it works for me". It doesn't work, and
I've tried it on various platform configurations.
I've tried it using Adobe's AC_FL_RunContent and SWFObject
with the same, unsatisfactory result. Surely there must be a
solution to this? Has nobody else come across the problem?
I have used the information provided in the following link and it has worked for me using AS3 in IE7 and FF.
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15683
Similar Messages
-
My project uses the ExternalInterface which worked fine under
Beta 3 but Flex 2 release doesn't seem to allow this? The allowed
keeps returning false even when the domains are allowed as
"always". What has changed between Beta 3 and the Release in this
area and what do I need to do to get things working again?
ThanksIronically, I just noticed the problems that I posted.
They've been fixed, and it now works properly in that respect.
Thanks for catching that, though. I'll have to watch naming
conventions in the future.
What other problems did you notice? I try to improve when I
have the opportunity.
Thanks,
Bob Robertson
EDIT: Sorry, should've been more specific. I noticed the
problems with addCallback, and fixed them. I also noticed the
mis-called function, and fixed that as well. -
C# Externalinterface Problem with MS Word
I'm working on an Microsoft Word Plugin based Microsoft
Visual Studio 2005 Tools for Office Second Edition and the
ExternalInterface for C#.
The idea of the project is to get informations from Word app
and send the informations to an Adobe Flex app, which is running in
a dialog window of Word.
My problem is that the SWF is running in the sandbox typ
"localeWithNetwork" instead of"Localetrusted".
Have anybody an idea, how I can solve this?This is an issue with the 1.0 version of the update. Apple pushed out a newer release this morning called 1.1:
http://support.apple.com/kb/DL1489 -
Problem with ExternalInterface.call and Internet Explorer
Hi, I´m developing a site, (
www.gen-studio.com/avelart2
), and I´m using a swf to display a set of thumbs that when
clicked show an item and its description on the browser, those
items might be images or video, everything works fine with the
images.
And actually it works fine with the videos too, when using
Firefox, but when I test the page on Internet explorer it just
doesn’t work!
On principle let me describe how it´s supposed to work,
a thumbnail when clicked sends an id number to javaScript using
ExternalInterface.call(“myFunction”,myId); -I´m
using AS3 for the swf´s-
the javaScript file has already loaded (ever since$(
document).ready) a XML file which uses to match the id with a file
and the description, if the item to show it´s a video, then it
creates a variable which holds a string with the proper html to
embed a swf (a swf movie player that resides just next to the HTML
file), when loaded, the swf movie player uses
ExternalInterface.call() to ask for the source of the video that
has to play, and that function is as follows:
setVideo: function(){
alert("hola");
return comun.miVideo;
(The alert(“hola”); is just to test that the
function is being called), which it is, but it returns null as a
value instead of the proper string, and this happens only on
internet Explorer, but works correctly on Firefox.
I´ve been reading all day about the subject and found a
few interesting things, which though have made me narrow my
problem, they haven´t just provided me with a solution, what I
found so far:
-I must have in account flash security issues: Checked (my
actionScript follows:)
import fl.video.*;
import flash.external.ExternalInterface;
flash.system.Security.allowDomain("*");
var vid:FLVPlayback = this.miPlayer;
vid.source =
flash.external.ExternalInterface.call("comun.setVideo");
-ExternalInterface and Internet explorer don´t work
properly when tested locally: Checked (I have a server on my PC and
I´m testing the site as well in the above direction).
-The object tag holding the swf must have a proper id
attribute: Checked.
-It´s super important the way the object tag is formed:
Checked, and I also tested the tag separately (I put it directly in
the HTML instead of adding it via javaScript) and it worked as
expected in both Firefox and Internet Explorer, which leads me to
believe:
-I read somewhere that if you add the object tag by using
innerHTML or appendChild, returning values from javaScript to swf
won´t work, but I couldn´t find an explanation nor a
solution.
Well, as I said now I´ve been looking all day for an
answer, so I really hope you can help me or give me some advice on
the subject, thank you so much for your time!Hi! it solved itself !! (nahh, I wish), but it indeed had a
solution, it was something quite simple, and I don´t really
understand why it was not working in the first place, but here is
the thing:
I´m learning jquery and this is the first proyect
I´m officially using it, so I was using
$('#myDIV').append("string"); to embed the swf, (and it was working
perfectly on Firefox), so since I had narrowed my problem to those
lines, I decided to try some good-old-fashioned-javaScript and
changed it for: var myDiv =
document.getElementById('thatParticularDiv'); myDiv.innerHTML =
('string'); and it worked both in Firefox and IE !!!!!! :)
I´m quite happy about it, and if someone knows
what´s the issue with my jquery approach I would love to hear
it. THANKS !! -
ExternalInterface.call problem with object-orientation
Hi
I am using an swf inside a PDF. In a PDF-context the ExternalInterface-class works much the same as it does within a website. So far calling a function in the document-script works.
The thing now is, that I really try to use an object-oriented approach as often as I can. In this case I have a function I could call using
var jsCaller:Object = ExternalInterface.call("myFunction",parameters);
This works as expected.
However, I have now made that function a method in an object, so I can access it within JS using dot-notation: myCoolObject.myFunction(); This works as well, so the problem is not the function itself. However, the call
var jsCaller:Object = ExternalInterface.call("myCoolObject.myFunction",parameters);
does not work.
This means there's either something I'm missing, or it's a limitation of ExternalInterface, or it's a limitation of externalInterface in a pdf-context.
Anyone to enlighten me?If EI calls eval it should be able to resolve the object-path. However, this doesn't seem to be the case. Also note that my parameter is an array, so this probably wouldn't work, even if the syntax did.
Anyway, I tested your syntax in my PDF, and it showed the same behaviour as before (i.e. the function in which the EI-call was placed could not be executed, and acrobat claimed there was no such function). It didn't work with my normal function, and not even with a simple console.println-statement that way. So in PDFs it definitely doesn't work like that.
But thanks for the suggestion! -
Problems with ExternalInterface
I am trying to have a Flex2 TitleWindow communicate with
Javascript and then have that Javascript communicate back with the
ActionScript in the TitleWindow.
Calling Javascript from ActionScript is working perfectly,
however, I have not yet been able to successfully call an
ActionScript method from Javascript.
My setup is fairly involved, but here are the basic
components. I would be happy to provide any additional information
that could help.
I have a creationComplete event in my TitleWindow which calls
an initialization function that registered callbacks and then a
callback function defined in the same TitleWindow.
public function init():void {
if (ExternalInterface.available){
ExternalInterface.addCallback("testCallback", testCallback);
Alert.show("Callbacks are registered");
else{
Alert.show("ExternalInterface was not available");
public function testCallback():void {
Alert.show("Received callback from Javascript");
Then when the user clicks a button on the TitleWindow, I do
the following:
ExternalInterface.call("jsFunction", "foo", "bar");
In my Javascript, I have the following:
var jsFunction = function(string1, string2){
alert("Received: " + string1 + ", " + string2);
flexObject.testCallback();
In my Html, I have the following to imbed flex
<object id='flexObject' codebase='
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0'
height='100%' width='100%'>
<param name='src' value='flexapp.swf'/>
<param name="allowScriptAccess" value="always"/>
<embed name='flexObject' src='flexapp.swf'
allowScriptAccess='always' pluginspage='
http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'
height='100%' width='100%'/>
</object>
Now, I can load the html page just fine and everything look
great and is functional. When I go to the TitleWindow in question
and click the button that calls the Javascript, it works perfectly
and I see the Javascript alert box displaying "Receiving: foo,
bar". However, I never get any response from the ActionScript
callback that should be called at that point by the Javascript.
Looking at it more closely, I have been able to determine
that flexObject.testCallback is undefined at the point I try to
call it in my Javascript. Javascript is unable to see that this
method exists. If I try to use Firebug to trace the Javascript side
of things, it crashes at the flexObject.testCallback line.
I have tried doing:
flexObject.testCallback();
document.getElementById("flexObject").testCallback();
testCallback();
None of them work. Has anyone had luck with this? I have
tried it with FireFox 2 and IE 6 with the same result.Never mind, it was some crazy-*** unrelated problem where JavaScript working in IE didn't work in FF.
-
Problem with AS3 "ExternalInterface.call" in InternetExplorer
Hi,
Explaining how the page is setup:
I have a HTML page with 2 different AS3 Flash movies.
The first flash movie is the main animation and sits in the
middle of the screen with a large background image set into the
body of the HTML.
The second flash movie stretches 100% width/height of the
screen dimensions and acts as a fade from black>to invisible.
What I'm trying to do:
Once the second Flash animation has faded from black to
invisible it calls a JavaScript function in the HTML page to hide
the div element the second flash movie is embed into (this is
because the first flash movie will display a set of input boxes
which the user needs to be able to type into - which they wont be
able to click on if there is another flash movie overlaying the
entire first movie).
My intial solution:
In the second Flash movie is the following code:
stop();
// this will load the API necessary to communicate with
external entities
import flash.external.ExternalInterface;
// call the JavaScript function
ExternalInterface.call('myJavaScriptFunction');
...and this works fine in Mozilla Firefox/Safari. The
actionscript successfully calls the JavaScript function in the HTML
page and that JavaScript function simply (at this stage displays an
alert() message to show that it has been successfully called).
Problem with IE:
But, the moment I try this in Internet Explorer I don't get a
alert() message but a JavaScript error message that says:
Code: Select all
Line: 1
Char: 106
Error: 'null' is null or not an object
Code: 0
As you can expect I'm totally confused as to what the problem
could be.
This is really urgent as it's a live project that needs to
get completed immediately, so any help you may have would be
greatly appreciated!
Kind regards,
Mark.My guess is that its to do with your embedding code. Check a)
you have an id attribute assigned to the resulting object tag from
whatever embedding method you use and b) for good measure make sure
its unique in your html page.
Javascript needs to have a valid reference to return the
value from the javascript function back to flash. In my experience
IE is more sensitive to issues here.
If you get stuck post a test page somewhere.
Tools to use to help with javascript debugging and view the
html embed results (e.g. from swfobject or activecontent.js):
In firefox : Firebug
In IE: IE Developer Toolbar , Companion JS, and DebugBar are
all helpful and , combined, get close to Firebug. -
ExternalInterface.call() problem
Hi,
My first problem was the random activation of the pop up
blocker in Fierfox when I use navigateToURL("url", "_blank").
I found a solution
there,
but unfortunaly this solution didn't work for me.
The solution is to use ExternalInterface.call for opening a
new window without the popup blocker, but I cannot use the solution
if I don't put in my HTML page <param name="allowScriptAccess"
value="always" />. If I don't put this parametre I cannot use
ExternalInterface.call.
You'll say, why you don't put this parametre? It's because a
lot of person use this application, and they are able to integrate
it into there web site, unfortunaly I cannot control if they put
the parametre allowScriptAccess.
So I'd like to know if it's possible to use
ExternalInterface.call without the parametre.
Thanks
Matthieuquote:
Originally posted by:
mattL_75_13
Nobody has an axe of search ??
I will trade you for a Sword of Reply -
Hello,
when I use externalInterface to call a function, where
javascript closes
a table td, firefox brings up an error window, that the
plugin does an
unallowed action.
How can I solve this?
jospset param swLiveConnect to true
in html dociment -
ExternalInterface/Javascript problems
I've compared this code to an example of External Interface, and I'm trying to initiate a swf change/load function using A HREF tags in html and it's not making sense why it's not working. Mainly the Swf file works like it should, except for maybe the ExternalInterface.callBack, I know this isn't a JS forum but if you have any insight why the links aren't initiating the function, please share.
HTML
<div id="HeadButtons">
<ul id="nav">
<li id="nav_home"><a href="index.html" id="homeLink" onclick="document.getElementById('willow').home(); return false;">Home</a></li>
<li id="nav_about"><a href="Pages/about.html" id="aboutLink" onclick="document.getElementById('willow').about(); return false;">About</a></li>
<li id="nav_services"><a href="Pages/services.html" id="servicesLink" onclick="document.getElementById('willow').services(); return false;">Services</a></li>
<li id="nav_blog"><a href="blog.html" id="blogLink">Blog</a></li>
</ul>
</div>
<script type="text/javascript">
var so = new SWFObject("SWF/Preload Home.swf", "willow", "600", "625", "10", "FFFFFF");
so.addParam("allowScriptAccess", "always");
so.write("flashcontent");
</script>
ACTIONSCRIPT
loadHome();
ExternalInterface.addCallback("home",Home);
ExternalInterface.addCallback("about",About);
ExternalInterface.addCallback("services",Services);
function Home():void {
if (setLoad.loaderSWF != null) {
removeChild(setLoad.loaderSWF); // get/set function in a class file
loadHome();
function About():void {
if (setLoad.loaderSWF != null) {
removeChild(setLoad.loaderSWF);
loadAbout();
function Services():void {
if (setLoad.loaderSWF != null) {
removeChild(setLoad.loaderSWF);
loadServices();
function loadHome():void {
var loader:Loader = new Loader();
loader.load(new URLRequest("Home.swf"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,finishLoad,false,0,true);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,loading,false,0,true);
preload_mc.visible=true;
loadText.visible=true;
loadText.text="Loading: ";
(function loadAbout & Services same as home)
function loading(e:ProgressEvent):void {
var loaded:Number=e.bytesLoaded;
var total:Number=e.bytesTotal;
var pct:Number=loaded/total;
preload_mc.visible=true;
loadText.visible=true;
preload_mc.loader_mc.scaleX=pct;
loadText.text = "Loading: " + (Math.round(pct*100)) + "%";
function finishLoad(e:Event):void {
var loadSwf:Loader=e.target.loader;
addChild(loadSwf);
setLoad.loaderSWF=loadSwf;//get/set function in a class file
preload_mc.visible = false;
loadText.visible = false;I just ended up publishing the movie as an html and just re added the other site features. Now it works fine but when I don't know what the SWF's id is so I can reference it through the onclicks
if you have any idea, here's the body portion of the javascript from publishing it
<script language="JavaScript" type="text/javascript">
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
'width', '600',
'height', '625',
'src', 'Preload Home',
'quality', 'high',
'pluginspage', 'http://www.adobe.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'willow',
'bgcolor', '#ac8b77',
'name', 'willow',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'Preload Home',
'salign', ''
); //end AC code
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" name="willow" width="600" height="625" align="middle" id="willow">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="Preload Home.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ac8b77" /> <embed src="Preload Home.swf" quality="high" bgcolor="#ac8b77" width="600" height="625" name="willow" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
</noscript> -
ExternalInterface.call problem calling Javascript
I can't get work my SWF calling a javascript function in my
web page (ASPX)
this is the code that i use to show the SWF :
function RunClip(idMap)
var Larghezza = 1024;
var Altezza = 768;
var clip = "supervisore.swf?idMap="+idMap;
var allowScriptAccess = "always";
var allowNetworking = "all";
document.write("<DIV id=\"flash\"
style=\"z-index:2\">");
document.write("<object name=\"flashObject\"
classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" "+
" codebase=\"
http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\"
"+
" width=\""+Larghezza+"\" height=\""+Altezza+"\"
align=\"middle\">");
document.write("<param name=\"allowScriptAccess\"
value=\""+allowScriptAccess+"\" />");
document.write("<param name=\"allowNetworking\"
value=\""+allowNetworking+"\" />");
document.write("<param name=\"movie\"
value=\""+clip+"\"/>");
document.write("<param name=\"quality\"
value=\"high\"/>");
document.write("<param name=\"wmode\"
value=\"opaque\"/>");
document.write("<embed src=\""+clip+"\" quality=\"high\"
width=\""+Larghezza+"\" height=\""+Altezza+"\" "+
" align=\"middle\" play=\"true\" loop=\"false\" "+
" type=\"application/x-shockwave-flash\" quality=\"high\" "+
" allowNetworking=\""+allowNetworking+"\" "+
" allowScriptAccess=\""+allowScriptAccess+"\" "+
" pluginspage=\"
http://www.macromedia.com/go/getflashplayer\"
/>");
document.write("</object></DIV>");
THIS IS ACTIONSCRIPT (title is always 'null')
var title:String =
ExternalInterface.call("JsFunction","test");
THIS IS THE JAVASCRIPT function
<head runat="server">
<title>Test</title>
<script language=javascript>
function JsFunction(variable) {
return variable;
</script>.....
<body onload="hide();" onclick="hidemenu();">
<form id="form1" runat="server">
<DIV id="outer" style="z-index:1">
<script
type="text/javascript">RunClip(1);</script>
</DIV>......If EI calls eval it should be able to resolve the object-path. However, this doesn't seem to be the case. Also note that my parameter is an array, so this probably wouldn't work, even if the syntax did.
Anyway, I tested your syntax in my PDF, and it showed the same behaviour as before (i.e. the function in which the EI-call was placed could not be executed, and acrobat claimed there was no such function). It didn't work with my normal function, and not even with a simple console.println-statement that way. So in PDFs it definitely doesn't work like that.
But thanks for the suggestion! -
Problem with IE and pubblishedIntoWall
Hi to all,
i have a problem with InternetExplorer and CallBack
In my flex code i have :
flash.external.ExternalInterface.addCallback("pubblishedIntoWall", pubblishedIntoWall);
The javascript code:
function pubblishedIntoWallCarrello() {
document.getElementById("composer").pubblishedIntoWall(1)
In both Firefox and Chrome the javascript works in the right way.
In internet explorer the function pubblishedIntoWall is not called.
Have some one got an idea of this problem?
Thanks for your timeFirst of all, thank for your reply
This is the code that i use in the HTML, i use allowScriptAccess = sameDomain
----------- CODE -------------------
<div id="divContainercomposer" style="position:absolute;left:50%;top:0px;width:930;height:100%;margin-left:-465px">
<script language="JavaScript" type="text/javascript">
<!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);
// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if ( hasProductInstall && !hasRequestedVersion ) {
// DO NOT MODIFY THE FOLLOWING FOUR LINES
// Location visited after installation is complete if installation is required
var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
var MMredirectURL = window.location;
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
var MMdoctitle = document.title;
AC_FL_RunContent(
"src", "playerProductInstall",
"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"" ,
"width", "930",
"height", "100%",
"align", "middle",
"id", "composer",
"quality", "high",
"bgcolor", "#ffffff",
"name", "flashContent",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
} else if (hasRequestedVersion) {
// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
"src", "composer",
"width", "930",
"height", "100%",
"align", "middle",
"id", "composer",
"quality", "high",
"bgcolor", "#ffffff",
"name", "composer",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be placed here. '
+ 'This content requires the Adobe Flash Player. '
+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
document.write(alternateContent); // insert non-flash content
// -->
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="flashContent" width="930" height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="composer.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="composer.swf" quality="high" bgcolor="#ffffff" id="composer"
width="930" height="100%" name="composer" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</noscript>
</div> -
Strange IE ExternalInterface Bug: "Object does not support this property or method"
We have an application on a relatively slow server (I mention
the speed because it may be relevant).
The app is flash 8 and uses ExternalInterface to call a
javascript function in its parent page. It also used the
ExternalInterface to receive a call from another function. These
calls happens separately (the outbound one calls up a list view of
items, clicking on an item calls up the details in the flash
movie). In between the calls, the flash movie is hidden by moving
it off screen using absolute positioning.
On my local development box (Windows XPSP2) this works fine
in both directions.
On our production server (LAMP) this works fine in both
directions in Firefox 1.5 and 2.0
BUT while the outbound call from Flash to the page works fine
in Internet Explorer 6 or 7, the call back from the page to the
flash movie fails with the error messgage "Object does not support
this method or property"
We've tried not hiding the flash so it is always present on
the page and still the browser > flash communication breaks in
ie.
We've tried using both the Adobe active content script and
swfobject to embed the flash in the page with no difference in the
resultset. In truth we've given up and gone to a two-page solution,
reloading the flash from the start each time but I wondered if
anyone had encountered a similar issue? Can't see why it would work
perfectly in FF but not in IE.Not sure if this is your problem, but you do reference the
Flash object
differently, depending on the browser. In a video player we
made, that uses
JS to communicate back to Flash, I use a function like this
to modify the
variable depending on the browser:
function changeVideo(xname){
//ff
if(window.vplayer){
window.document["vplayer"].SetVariable("theXML", xname);
window.document["vplayer"].GotoFrame(2);
window.document["vplayer"].Play();
//ie
if(document.vplayer){
document.vplayer.SetVariable("theXML", xname);
document.vplayer.GotoFrame(2);
document.vplayer.Play();
The Flash is in a <div> named 'vplayer'
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ -
Can't Use Dreamweaver Flash Embedding with ExternalInterface
I've been trying to use ExtermalInterface to call ActionScript 3 functions from JavaScript and have been having a problem when embedding SWF files using Dreamweaver. When I use the sample code at the bottom of the ExternalInterface docs page (http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/external/ExternalInterface.html) the JavaScript/ActionScript function calls work fine. But when I insert a SWF with Dreamweaver CS4 they don't. They do actually work in Internet Explorer 8 but not in Firefox 3.5, Safari 4, or Chrome 3.
The problem has to do with the the way the SWF embedding is done. On the ExternalInterface page mentioned above a different form of the <object/embed> tags is used than in DW. Here's the sample code from the docs page:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="ExternalInterfaceExample" width="500" height="375"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
<param name="movie" value="ExternalInterfaceExample.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="ExternalInterfaceExample.swf" quality="high" bgcolor="#869ca7"
width="500" height="375" name="ExternalInterfaceExample" align="middle"
play="true" loop="false" quality="high" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>
</object>
In DW, instead of an <embed> tag a second object tag is inserted. I did find that by manually giving the second <object> tag its own ID (a different ID from the one given the first tag by DW I could make the function call work in FF. But you would then have to choose the ID based on the browser. And, worse, that technique doesn't work in Chrome or Safari.
So, the workaround seems to be to use the style of embedding used on the ExternalInterface page. But, I don't like that approach for several reasons. First, the page won't tell the user they need to upgrade their FlashPlayer if that's a problem. Second, you have to manually copy/past the embedding code instead of using DW's nice menu option. And I suspect there may be other benefits to the DW approach,
So, is there a way to make the DW embedding style work with ExternalInterface in all the major browsers??
David SalahiVery interesting, thanks for your insight. Dreamweaver does seem to be a black sheep in this regard. Curiously, one of the reasons I wanted to stick with DW is because it highlights the <embed> tag in yellow—which normally means an HTML error. Not being entirely up on the ins and outs of the embed tag I thought maybe it's deprecated or something so wanted to avoid it. But now, I've found that it's apparently the right way to do things.
I did a little testing; here are my results...
My SWF was originally generated in FlexBuilder (as an ActionScript project) so I copied over the Flex-generated HTML page and modified it for use with ExternalInterface. That works fine in all four of the browsers I mentioned in my original post.
Next, I grabbed an HTML page generated by Flash's Publish menu option and made the same modifications. Again, everything was copacetic.
Each of the three tools (Flash, Flex & Dreamweaver) generate different HTML code for embedding a SWF file and only two of them work with ExternalInterface. I guess I'll steer clear of Dreamweaver's Insert-> Media -> SWF menu option in the future. This cost me an entire day of hair-pulling.
But thanks for your tip!
David Salahi -
ExternalInterface.call Acrobat 9
I am having trouble with this script. I can not get it to
pick up text from the pdf. Not sure if the problem is on the Java
side or the AS side but I think the AS2.0.
Acrobat 9
/* JavaScript */
var GuestNamez = this.getField("TestText");
// Get hold of the first Flash object on the second page
var annot = getAnnotsRichMedia(0)[1];
if ( annot )
// if exists, call the function called "GuestNam"
// and pass an item ID as an argument
annot.callAS( "GuestNam", GuestNamez.value);
Flash
/* ActionScript 2.0*/
import flash.external.*;
var realFunction:Function = setState;
ExternalInterface.addCallback("GuestNam", null,
realFunction);
function setState(stateData:String):Void {
GuestsNames.text = stateData;
Any help would be great thanks.You might want to look in or ask in the Acrobat SDK forum.
Maybe you are looking for
-
The reason photos need to be able to go back to the iPhone in original size
I have been looking around to try and find a way to get photos that have been pulled from the iPhone then resynced up to the iPhone to retain their original size, but it appears that there's no workaround for this. That is a very big problem for me.
-
Transforming XML File to abap structure
Hello, I am working in a new project for making an input interface. The problem to resolv is : 1>Reading an XML file on a unix Server 2>Transforming this file in abap structure with the instruction call transformation. Format of the input file : <LIS
-
Are there plans to add the option of replacing the bullets in a bulleted list with images, as you can do in Word? Our current workaround is to insert the image as a background image through the CSS with appropriate spacing, but this isn't very accura
-
Black spot on the center screen
Hi I have baught blackberry curve 9300 from Bahrain Airport last week.. now my berry shows a black spot on the center in 1.5 Cm lenght its visible when screen is dark but the white screen doesnt shows clearely. I am afraid whether any daamage happend
-
Unable to start SOA & OIM Managed Servers
I am getting the following error when I am starting the SOA $ OIM servers - once the Admin server is RUNNING. For the error pasted below , I took the following approach: 1. Added boot.properties file and provided the username and password for all th