Я пытаюсь создать простой аудио-флеш-плеер, который при нажатии вызывает функцию js, он отлично работает во всех браузерах, кроме IE.я не могу понять, в чем проблема!
здесь html:
<!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" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>player</title>
</head>
<body >
<![if !IE]>
<object type="application/x-shockwave-flash" classid="bla" width="18" height="30" id="myFlashMovie">
<param name="wmode" value="opaque" />
<param name="FlashVars" value="mp3.mp3" />
<embed type="application/x-shockwave-flash" width="18" height="30" src="player%2Eswf" id="flashObj" FlashVars="audioTrackPath=mp3%2Emp3" />
</object>
<![endif]>
<!--[if IE]>
<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf- 96b8-444553540000" width="18" height="30" id="movie" allowScriptAccess="sameDomain" >
<PARAM NAME="movie" id="movie" value="player%2Eswf?audioTrackPath=mp3%2Emp3"/>
<PARAM NAME="FlashVars" value="mp3%2Emp3" />
<PARAM NAME="allowScriptAccess" value="always" />
<![endif]-->
<script type="text/javascript">
alert("Hello World");
</script>
<noscript>Sorry, your browser does not support JavaScript!</noscript>
<script type="text/javascript">
function countdown() {
alert("countdown");
}
</script>
</body>
</html>
и вот как:
import flash.media.Sound;
import flash.media.SoundLoaderContext;
import flash.net.URLRequest;
flash.system.Security.allowDomain("http://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("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();
}
}
Я был в Google в течение 3дней, но я не могу найти ответ ...