Load external sound file with actionscript 2(and not 3!!!)?

[Closed]
Report
Posts
4
Registration date
Monday August 10, 2015
Status
Member
Last seen
September 2, 2015
-
Posts
4
Registration date
Monday August 10, 2015
Status
Member
Last seen
September 2, 2015
-
Hello every body

first question is it really possible to load a external sound file (wav or mp3) with actionscript 2 ?

I hope you 'll be able to help me
I would like to load a external sound file (wav or mp3 ) i assume that the other format doesn't work

//implented actionscript 2

class Main
{

public static function main(swfRoot:MovieClip):Void
{
var v:Main = new Main(swfRoot);
}

public function Main(s:MovieClip)
{
var k:Sound = new Sound(s.rcp);

s.g.onPress= function ()
{

k.onLoad = function(b:Boolean)
{
if (b)
{
k.start(0, 4); s.z.text = "rien entendu " + b; k.start(0, 99);
} // fin de if
else { s.z.text = "merde"; } //fin de else
} // fin de k.onLoad

k.loadSound("da.wav",true);
} // fin de s.g.onload
} //fin de public function Main

}//fin de class main


<code>
// tuto.swf to be impleted

present object on the stage
instancied symbol named :rcp
instancied button named : g
instancied textfield named:z

environnement
the implented swf is in the same folder than "da.wav"
my problem is that the file is loaded but the sound doesn't work on click event
i allready tried start(),start(0,99) but nothing happens!

thanks for your help

2 replies

Posts
4
Registration date
Monday August 10, 2015
Status
Member
Last seen
September 2, 2015

I think I have found the answer myself
I used loadsound with a mp3 file and it worked fine so i believe
this function doesn't work with wav file!

why wasn't it specified clearly anywhere ?

resolved
Posts
4
Registration date
Monday August 10, 2015
Status
Member
Last seen
September 2, 2015

excuse me !

without import to the library

lehumble
Posts
4
Registration date
Monday August 10, 2015
Status
Member
Last seen
September 2, 2015

that's not an answer by the way, I'm just completing my question