Note that there are some explanatory texts on larger screens.

plurals
  1. POFlash and JavaScript communication within IE
    primarykey
    data
    text
    <p>I am having in issue with IE passing a string back into an swf using the EternalInterface class in Flash CS4.</p> <p>I have an swf with the following code:</p> <pre><code>var externalString:String = ExternalInterface.call("IncomingJS") </code></pre> <p>which is inside an event listener attached to an Event.ENTERFRAME and an if statement waiting for ExternalInterface.available. </p> <p>The <code>IncomingJS</code> function looks like:</p> <pre><code>function IncomingJS() { return stringFromHTML; } </code></pre> <p>and sits on the HTML page with the swf.</p> <p>I am able to successfully get the <code>externalString</code> variable and procceed with the rest of the AS3 script in Firefox, Safari and Chrome, but not in IE.</p> <p>If I add in an <code>alert (stringFromHTML)</code> before the return statement in the Javascript, I get the value of the <code>stringFromHTML</code> spammed, which looks like Flash is firing the function at the right rate.</p> <p>The embed code in HTML for the swf is a little simple:</p> <pre><code>&lt;object width="750" height="200" id="controlledScale"&gt;&lt;param name="movie" value="http://www.myURL.com/controlledScale.swf"&gt;&lt;param name="allowScriptAccess" value="sameDomain" /&gt;&lt;embed src="http://www.myURL.com/controlledScale.swf" width="750" height="200" allowScriptAccess="sameDomain"&gt;&lt;/embed&gt;&lt;/object&gt; </code></pre> <p>Any help or advice would be greatly appreciated.</p> <p>Thanks, DavidB</p> <h2>Edit</h2> <p>I realise how poor the SWF embed code is. Unfortunately, the HTML code is actually working within a 3rd party HTML generator, and one of it's limitations is that I can only have a single line (with unlimited length) of html at a time.</p> <p>Are the other options (swfObject etc) able to run either with no line breaks in the code, or would I be asking for trouble with Javascript and the SWF to, instead of embedding the SWF directly, use something like an iFrame and refer to a 'proper' flash delpoyment html file?</p> <p>Kind of at a point on this one where I'm not even sure where the problem is actually located. The swf's are find sending out to Javascript across all browsers, just not getting info back in IE only.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload