Advertisement

05.10.2008 at 11:51AM PDT, ID: 23391938 | Points: 500
[x]
Attachment Details

Flash ExternalInterface,  swfObject 2.0 and Firefox

Asked by MarleneAyers in Firefox Web Browser, Web Graphics Software, Macromedia Flash

I am embedding a simple Flash.swf file in an html page using swfObject 2.0. I have an addCallback function in my flash file. My html code is attached below. This code works in Safari on the Mac but not Firefox 2.0 on the Mac. Any ideas? I have also attached the simple actionscript 2.0 code below.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>Test</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<script type="text/javascript" src="swfobject.js"></script>
		<script type="text/javascript">
			var flashvars = {};
			var params = {};
			params.allowscriptaccess = "always";
			var attributes = {};
			swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "8.0.0", false, flashvars, params, attributes);
		</script>
 
<script>
	function test () {
		myContent.myFunction();
}
 
    </script>
 
  </head>
  <body>
    <div id="myContent">
      <p>Alternative content</p>
    </div>
    <p> <a href="#" onclick="test()"> click me </a></p>
  </body>
</html>
 
 
FROM FLASH
import flash.external.*;
function myFunction() {
	myText.text="first name";
}
 
ExternalInterface.addCallback("myFunction", this, myFunction);
[+][-]05.26.2008 at 05:50PM PDT, ID: 21648817

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628