# Flash not calling js in iE

**URL:** <https://forum.kirupa.com/t/flash-not-calling-js-in-ie/326466>\
**Category:** flash\
**Created:** [December 16, 2011, 11:45am UTC](https://forum.kirupa.com/t/flash-not-calling-js-in-ie/326466 "2011-12-16T11:45:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ignus\_deus](https://avatars.discourse-cdn.com/v4/letter/i/a3d4f5/32.png) [@ignus\_deus](https://forum.kirupa.com/u/ignus_deus)\
**Post date:** [December 16, 2011, 11:45am UTC](https://forum.kirupa.com/t/flash-not-calling-js-in-ie/326466/1 "2011-12-16T11:45:08Z")

</div>

I am trying to create a simple audio flash player, that calls a js function on click, it works perfectly in all browsers, except IE. i cant figure out what seems to be the problem!  
here is html:

[COLOR=#800080]\<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”  
“[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)”\>[/COLOR]  
[COLOR=#800000]\<html[/COLOR] [COLOR=#FF0000]xmlns[/COLOR]=[COLOR=#0000FF]“[http://www.w3.org/1999/xhtml](http://www.w3.org/1999/xhtml)”[/COLOR] [COLOR=#800000]\>[/COLOR]  
[COLOR=#800000]\<head\>[/COLOR]  
[COLOR=#800000]\<meta[/COLOR] [COLOR=#FF0000]http-equiv[/COLOR]=[COLOR=#0000FF]“Content-Type”[/COLOR] [COLOR=#FF0000]content[/COLOR]=[COLOR=#0000FF]“text/html; charset=ISO-8859-1”[/COLOR] [COLOR=#800000]/\>[/COLOR]  
[COLOR=#800000]\<title\>[/COLOR]player[COLOR=#800000]\</title\>[/COLOR]  
[COLOR=#800000]\</head\>[/COLOR]  
[COLOR=#800000]\<body[/COLOR] [COLOR=#800000]\>[/COLOR]

```
&lt;![if !IE]&gt;
[COLOR=#800000]&lt;object[/COLOR] [COLOR=#FF0000]type[/COLOR]=[COLOR=#0000FF]"application/x-shockwave-flash"[/COLOR] [COLOR=#FF0000]classid[/COLOR]=[COLOR=#0000FF]"bla"[/COLOR] [COLOR=#FF0000]width[/COLOR]=[COLOR=#0000FF]"18"[/COLOR] [COLOR=#FF0000]height[/COLOR]=[COLOR=#0000FF]"30"[/COLOR] [COLOR=#FF0000]id[/COLOR]=[COLOR=#0000FF]"myFlashMovie"[/COLOR][COLOR=#800000]&gt;[/COLOR] 

```

[COLOR=#800000]\<param[/COLOR] [COLOR=#FF0000]name[/COLOR]=[COLOR=#0000FF]“wmode”[/COLOR] [COLOR=#FF0000]value[/COLOR]=[COLOR=#0000FF]“opaque”[/COLOR] [COLOR=#800000]/\>[/COLOR]  
[COLOR=#800000]\<param[/COLOR] [COLOR=#FF0000]name[/COLOR]=[COLOR=#0000FF]“FlashVars”[/COLOR] [COLOR=#FF0000]value[/COLOR]=[COLOR=#0000FF]“mp3.mp3”[/COLOR] [COLOR=#800000]/\>[/COLOR]  
[COLOR=#800000]\<embed[/COLOR] [COLOR=#FF0000]type[/COLOR]=[COLOR=#0000FF]“application/x-shockwave-flash”[/COLOR] [COLOR=#FF0000]width[/COLOR]=[COLOR=#0000FF]“18”[/COLOR] [COLOR=#FF0000]height[/COLOR]=[COLOR=#0000FF]“30”[/COLOR] [COLOR=#FF0000]src[/COLOR]=[COLOR=#0000FF]“player%2Eswf”[/COLOR] [COLOR=#FF0000]id[/COLOR]=[COLOR=#0000FF]“flashObj”[/COLOR] [COLOR=#FF0000]FlashVars[/COLOR]=[COLOR=#0000FF]“audioTrackPath=mp3%2Emp3”[/COLOR] [COLOR=#800000]/\>[/COLOR]  
[COLOR=#800000]\</object\>[/COLOR]  
\<![endif]\>

```
[COLOR=gray]&lt;!--[if IE]&gt;
&lt;object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf- 96b8-444553540000" width="18" height="30" id="movie" allowScriptAccess="sameDomain" &gt;
&lt;PARAM NAME="movie" id="movie" value="player%2Eswf?audioTrackPath=mp3%2Emp3"/&gt;

```

\<PARAM NAME=“FlashVars” value=“mp3%2Emp3” /\>  
\<PARAM NAME=“allowScriptAccess” value=“always” /\>  
\<![endif]–\>[/COLOR]

```
[COLOR=#800000]&lt;script[/COLOR] [COLOR=#FF0000]type[/COLOR]=[COLOR=#0000FF]"text/javascript"[/COLOR][COLOR=#800000]&gt;[/COLOR]
alert([COLOR=#800000]"Hello World"[/COLOR]);
[COLOR=#800000]&lt;/script&gt;[/COLOR]
[COLOR=#800000]&lt;noscript&gt;[/COLOR]Sorry, your browser does not support JavaScript![COLOR=#800000]&lt;/noscript&gt;[/COLOR]

[COLOR=#800000]&lt;script[/COLOR] [COLOR=#FF0000]type[/COLOR]=[COLOR=#0000FF]"text/javascript"[/COLOR][COLOR=#800000]&gt;[/COLOR]
[COLOR=#00008B]function[/COLOR] countdown() {
        alert([COLOR=#800000]"countdown"[/COLOR]);
            }
[COLOR=#800000]&lt;/script&gt;[/COLOR]   
[COLOR=#800000]&lt;/body&gt;[/COLOR]
[COLOR=#800000]&lt;/html&gt;[/COLOR]

```

and here is as:

import flash.media.Sound;  
import flash.media.SoundLoaderContext;  
import flash.net.URLRequest; flash.system.Security.allowDomain(“localhost”);

var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;  
var audioTrackPath:String = String(paramObj[‘audioTrackPath’]);  
stop();

play\_btn.addEventListener(MouseEvent.CLICK, playSound);  
function playSound (e:MouseEvent):void{  
try { ExternalInterface.call(“countdown”); } catch(e:Error) { trace(e) }

[//ExternalInterface.call](https://ExternalInterface.call)(“countdown”);  
gotoAndStop(2);

var soundClip:Sound;  
var soundChannel:SoundChannel = new SoundChannel();

function init() { soundClip = new Sound(); soundClip.addEventListener(ProgressEvent.PROGRESS, soundLoading); soundClip.addEventListener(Event.COMPLETE, soundLoaded);

var req:URLRequest = new URLRequest(audioTrackPath);  
var context:SoundLoaderContext = new SoundLoaderContext(1000, true); soundClip.load(req,context);  
//soundChannel = soundClip.play();  
}  
init();

function soundLoaded(e:Event) { soundChannel = soundClip.play();  
}

function soundLoading(e:ProgressEvent) {// preloader information goes here trace(String(int(100\*e.bytesLoaded / e.bytesTotal))+"%");

}  
stop\_btn.addEventListener(MouseEvent.CLICK, stopSound);  
function stopSound (e:MouseEvent):void{ gotoAndStop(1); soundChannel.stop()

;} }  
i tried all i could find on google, but i cant seem to figure out the error, please do help 🙂
