[swfmill] Loading an mp3 embedded as sound

Don-Duong Quach geekrelief at gmail.com
Tue Jan 27 13:09:47 PST 2009


I was able to get the Sound to play from the swf, but it's a bit of a hack
at this point.  I don't know if it's possible with swfmill by itself because
I didn't see any output for the DoABCDefine tag.

So I ran a swf, generated by cs4, with an embedded Sound through swfmill's
swf2xml and noticed the output had a lot more tags.  I removed the data from
that, turning the xml into a template.  Took swfmill's mp3 data output and
pasted it into the template to generate the swf.

Now I'm able to dynamically load the swf.  I create a haxe/neko utility that
interacts with swfmill to take in an mp3 and generate the swf.  I have a
repo of my code up here:
http://github.com/geekrelief/mp3swfembedder/tree/master

I might circle back sometime later and add the capability into swfmill, but
this works well enough for now.

-Don Q.

On Mon, Jan 26, 2009 at 1:30 PM, Don-Duong Quach <geekrelief at gmail.com>wrote:

> That's not supported in Actionscript 3, but also because I want to stream
> the swf over a socket connection instead of http.  The idea is to pack an
> mp3 into a swf, send it over the socket, load it in with Loader.loadBytes,
> cast to Sound and then play.
>
> I'm targetting Flash 10.
>
> Don Q.
>
>
> On Mon, Jan 26, 2009 at 1:16 PM, Alex H <swfmill at avbrand.com> wrote:
>
>>  Why not just use the Sound.loadSound() method, which can load an mp3
>> directly?
>>
>> -alex
>>
>> Don-Duong Quach wrote:
>>
>> I tried replacing the sound tag with clip, per a post by Robin Palotai, I
>> found on the haxe list.  But as I suspected there's no class definition in
>> the swf.  At least SWFExplorer doesn't show anything,
>> http://www.bytearray.org/?p=175
>>
>> So I'm stumped as to how to access the mp3 in the loaded swf.
>>
>>
>> On Mon, Jan 26, 2009 at 11:51 AM, Don-Duong Quach <geekrelief at gmail.com>wrote:
>>
>>> Hi,
>>>
>>> I'm looking for advice on how I can get access to an mp3 I've embedded
>>> into a swf with swfmill.
>>>
>>> Here's my sound.xml file:
>>>
>>>   1 <?xml version="1.0" ?>
>>>   2 <movie framerate="10" height="300" width="400">
>>>   3     <library>
>>>   4         <sound id="Step" import="music/Tech_Step_Break.mp3"/>
>>>   5     </library>
>>>   6     <frame>
>>>   7         <place id="Step"/>
>>>   8     </frame>
>>>   9 </movie>
>>>
>>> I used this command to generate the swf: swfmill simple sound.xml
>>> step.swf
>>>
>>> And I'm trying to load step.swf into my app dynamically with Loader.
>>> When the swf completes loading, I want to be able to access the Sound
>>> instance in Actionscript 3 (flash 10) so I try to call:
>>>
>>> e.target.applicationDomain.getDefinition("Step") as Class;
>>>
>>> But I get an error that Variable Sound is not defined.  I don't know how
>>> to get access to the sound / mp3.
>>>
>>> I'm using mental's repo which has mp3/wav support.
>>> http://github.com/mental/swfmill/tree/master
>>>
>>> Thanks,
>>> Don Q.
>>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> swfmill mailing listswfmill at osflash.orghttp://osflash.org/mailman/listinfo/swfmill_osflash.org
>>
>>
>> _______________________________________________
>> swfmill mailing list
>> swfmill at osflash.org
>> http://osflash.org/mailman/listinfo/swfmill_osflash.org
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/swfmill_osflash.org/attachments/20090127/5dc34913/attachment.html>


More information about the swfmill mailing list