Link to home
Start Free TrialLog in
Avatar of yarekGmail
yarekGmail

asked on

flash externalinterface :works in IE , not in firefox

Hello experts
I have done a very simple flash swf (as3) that plays an mp3 and have added an extranelInterafce
ExternalInterface.addCallback("playMP3",playMP3);

Works great with IE but does not work with firefox 3.6 !
Gives me:
document.getElementById("mp3").playMP3 is not a function

Any clue ?
regards
<!-- saved from url=(0013)about:internet -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>mp3</title>
</head>
<body bgcolor="#ffffff">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="mp3" width="10" height="10" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="movie" value="mp3.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="mp3.swf" quality="high" bgcolor="#ffffff" width="10" height="10" swLiveConnect="true" id="mp3" name="mp3" align="middle" allowScriptAccess="always" 
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
  <input type="button" name="button" id="button" value="Button"  onclick="document.getElementById('mp3').playMP3()"/>
 
</body>
</html>

Open in new window

Avatar of Ferruccio Accalai
Ferruccio Accalai
Flag of Italy image

I don't know how this could be related to Delphi, anyway about the Firefox issue I know that using the fully-qualified class name for ExternalInterface (flash.external.ExternalInterface) should solve the Firefox problem.

So try changing your
ExternalInterface.addCallback("playMP3",playMP3);
to
flash.external.ExternalInterface.addCallback("playMP3",playMP3);
Avatar of yarekGmail
yarekGmail

ASKER

Delphi : sorry, I think the wbesite kept my last selection !

Still does not wrok with firefox ! Totally crazy !

I have attached the HTML, SWF and teh FLA source code.
Thanks
Flash.zip
ASKER CERTIFIED SOLUTION
Avatar of moagrius
moagrius
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello,
My question is exactly same. But the "Accepted Solution" does work? I copy and tried, it make no difference. What is the magic? I do can access my flash object, but I cannot access its ExternalInterface function.
Another thing I noticed is that if open the HTML from local, then it works fine. But after I put it on web server, then it stop working in FF (I tried both 3.6 and 3.0). But everything is under same domain
It works in IE always.

Thanks!
Jack