[mtasc] Simple Sound Playing Help

Burton Samograd kruhft at gmail.com
Tue Oct 17 06:04:47 CEST 2006


I'm trying to write a sound player for my site and I've run into a
roadblock from the start. I can't seem to get this code to work at
all:

test.as:

class Test {
   function Test() {
       var snd:Sound = new Sound();
       snd.loadSound("test.mp3", true);
       snd.. function(success:Boolean) {
           snd.start();
       };
   }

   static function main()
   {
       var tmp = new Test();
   }
}

compiled with:

./mtasc -cp ./std -header 1:1:25 -swf Test.swf  -main test.as

embeded in the following page:

<html>
<body>
<embed src="Test.swf" width="300" height="300"></embed>
</body>
</html>

I've also tried a simpler version without the onload part, where the
start call just follows the load.  I can see that the swf and mp3
files are getting loaded by the browser but nothing is happening.
This is my first attempt at ActionScript and using mtasc, so I was
wondering I was doing anything fundamentally wrong that might be
causing this frustrating problem.

TIA

-- 
burton samograd                                                kruhft at gmail.com
kruhft.boldlygoingnowhere.org              www.myspace.com/kruhft



More information about the mtasc mailing list