[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swftools-common] Accessing swfc sound objects (patch)
From: |
Laurent Lalanne |
Subject: |
Re: [Swftools-common] Accessing swfc sound objects (patch) |
Date: |
Thu, 13 Apr 2006 16:39:31 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.8.0.1) Gecko/20060130 SeaMonkey/1.0 |
Hi,
I made a patch to add Exportname to a sound inserted with :
.sound nameofsound soundfile.wav
With this it can called via actionscript, only need to add in a main
actionscript :
monSon = new Sound();
monSon.attachSound("nameofsound");
and
monSon.Start(); in button for example.
See example here :
http://technoargia.free.fr/swftools/examples/sound/embed_sound.html
Clic on speaker and it should work...
Laurent
Ps for Matthias :
I'm not sure if my patch is very clean, can you verify ?
*******************************************************
--- swfc.c 2006-04-13 16:13:22.000000000 +0200
+++ swfc_new.c 2006-04-13 16:19:42.000000000 +0200
@@ -1270,6 +1270,14 @@
sound = (sound_t*)malloc(sizeof(sound_t)); /* mem leak */
sound->tag = tag;
sound->id = id;
+ tag = swf_InsertTag(tag, ST_NAMECHARACTER);
+ swf_SetU16(tag, id);
+ swf_SetString(tag, name);
+ tag = swf_InsertTag(tag, ST_EXPORTASSETS);
+ swf_SetU16(tag, 1);
+ swf_SetU16(tag, id);
+ swf_SetString(tag, name);
+
if(dictionary_lookup(&sounds, name))
syntaxerror("sound %s defined twice", name);