Error in playing a swf file on internet explorer
Posted
by
Rajeev
on Stack Overflow
See other posts from Stack Overflow
or by Rajeev
Published on 2011-01-12T12:50:08Z
Indexed on
2011/01/12
12:53 UTC
Read the original article
Hit count: 299
In the below code i get an error saying Error #2007: Parameter url must be non-null on Ineternet explorer only.What am i doing wrong here
html
<OBJECT
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
WIDTH="50"
HEIGHT="50"
id="myMovieName">
<PARAM NAME="movie" VALUE="/media/players/testsound.swf" />
<PARAM NAME="quality" VALUE="high" />
<PARAM NAME="bgcolor" VALUE="#FFFFFF" />
<EMBED
href="/media/players/testsound.swf"
src="/media/players/testsound.swf"
flashvars="soundUrl=sound.mp3"
quality=high
bgcolor=#FFFFFF
NAME="myMovieName"
ALIGN=""
TYPE="application/x-shockwave-flash">
</EMBED>
</OBJECT>
mxml ; import flash.net.; import mx.controls.Alert; import mx.controls.Button; import flash.events.Event; import flash.media.Sound; import flash.net.URLRequest;
private function clickhandler(event:Event):void
{
var musicfile:String;
var s:Sound = new Sound();
s.addEventListener(Event.COMPLETE, onSoundLoaded);
var req:URLRequest = new URLRequest("/opt/cloodon/site/media/players/sound.mp3");
//musicfile = stage.loaderInfo.parameters["soundUrl"];
//var req:URLRequest = new URLRequest(musicfile);
s.load(req);
}
private function onSoundLoaded(event:Event):void
{
//Alert.show("1");
//var localSound:Sound = event.currentTarget as Sound;
var localSound:Sound = event.target as Sound;
localSound.play();
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<!--<mx:Button id="play" label="PLAY" click="clickhandler(event)" />-->
<mx:Image id="loader1" source="@Embed(source='/opt/cloodon/site/media/img/speaker.gif')" click="clickhandler(event)" />
</s:Application>
© Stack Overflow or respective owner