[haXe] Sound troubles

Sebastian Lucas delsilucas at gmail.com
Sun Oct 1 21:52:10 CEST 2006


Hi,

Same problem here.
Apparently, swfmill doesn't support mp3s or wavs.

I found 3 solutions:
1) Use the flash ide to make your library.
2) Use the wav2swf utility and then put in the xml.
3) Load the sounds at runtime. (it really sucks)

Maybe in the future swfmill will support wavs and mp3s.
But, as far as i know the swf generated by swfmill is version 7, so...
swfmill is dead i think. xD

About the second solution:
wav2swf attachs the sound to the frame 1... if you are using the parameter
"-S" wav2swf will attach the sound to the frame 2 and in the frame 1 a "stop
();".

So, attachSound it's not posible.
If you want to play the sound then make this:

...
public static var click_sound_mc:MovieClip;
...

soundClip.removeMovieClip();
var d : Int = flash.Lib._root.getNextHighestDepth();
soundClip = flash.Lib._root.createEmptyMovieClip("sound"+d,d);
click_sound_mc = soundClip.attachMovie("s","sound__"+d, d+1 );
...

...
public static function PlayClick ()
{
click_sound_mc.gotoAndStop (1);
click_sound_mc.gotoAndStop (2);
}
...

This only works if you're using the "-S".

It really suck too. xD

Good luck. =)

On 9/30/06, Agent Orange <aous124 at hotmail.com> wrote:
>
>  Has anyone had any luck with using sound from a swf created by swfmill?
>
> In swfmill I've attached a sound like this (click.swf was an mp3 converted
> by swftools):
>
> <frame>
>       <library>
>             <clip id="s" import="click.swf"/>
>       </library>
> </frame>
>
>
> Then in haxe I do the following:
>
> soundClip.removeMovieClip();
> var d : Int = flash.Lib._root.getNextHighestDepth();
> soundClip = flash.Lib._root.createEmptyMovieClip("sound"+d,d);
> soundClip.attachMovie("s","sound__"+d, d+1 );
>
> And it works, but it is slow to load up and play the sound, so I thought I
> would use the flash.Sound class like so:
>
> soundByte = new flash.Sound(this);
> soundByte.attachSound("s");
> soundByte.start();
>
> But it does not work, I have tried loading an external mp3 and it does
> work, but I need everything packaged in one swf file.
>
> Any ideas?
>
> AO
>
> --
> haXe - an open source web programming language
> http://haxe.org
>
>


-- 
█║▌│█│║▌║││█║▌│║
Sebastian Javier Lucas
Programmer & Guitar Hero
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/haxe/attachments/20061001/462a584f/attachment-0001.htm


More information about the Haxe mailing list