[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] adding sound with Flash > 6

From: Chris Pugh
Subject: [Swftools-common] adding sound with Flash > 6
Date: Thu, 11 Dec 2008 04:42:30 +0000

>2008/12/10 Pablo Rodríguez <address@hidden>:
>> Chris Pugh wrote:
>> You're not kidding!!    Not only is your script huge, but the
>> resulting SWF is to boot!
> Thanks for your reply and sorry for the delayed answer.
> The presentation is big, since is a real presentation, but it was my fault
> to show this SWF and script, since the issue is much simpler.

Just cause it is 'real',  doesn't make it necessarily have to be big .. ;o)

>> Are you really sure that,
>>  -  using all those 'times[xx]=yyyyy' statements is the right way to go?
> I think that is the best way I have to advance slides at a certain
> miliseconds. Actually I don't know a better way to do it (I'm afraid I'm not
> a programmer). If you had a better way to do it, I would be pleased if you
> can share it with me.

For someone who doesn't consider himself to be a programmer, I'd say
you're not doing too badly with your scripting ( what's a programmer
anyway? ) .

>> -  embedding such a massive .wav file is sensible?
> I embedded the wav file instead of the mp3 file, because swfc compresses wav
> audio with a better compression rate and a smaller output. Otherwise I
> couldn't upload the SWF outputs to my website, since my hosting provider
> only allows files >8000KB and the files with the mp3 embedded were 8.5MB in
> size.

Using loadSound, does not *embed* the mp3 audio file in the swf.  It
simply creates a reference to an external file, streamed or otherwise.

> This doesn't work for me. Using
>        .sound audio file.mp3
>        .action:
>                snd = new Sound();
>                snd.loadSound("audio",true);
>        .end

Try it this way,

               snd = new Sound();
               snd.onLoad = function (){

>> Using '.stop' on it's own kills everything, stone dead.   '.stop
>> audio' simply stops that particular sound object. ( check the
> Flash ActonScript Dictionary or similar refs ).
> I didn't know that the .stop tag (and similar) were referenced in
> ActionScript guides.

Bad choice of phrasing and reference, sorry.  Nonetheless, that is
what .stop on it's own appears to do, i.e. kills everything.  You want
to stop  just the snd object itself, then you have to specifically
state it.

> The loop is what happens using "version=7" and ".sound audio "sound.mp3"

Actually no it doesn't.  See below.

> .stop audio". What happens it that the first half second is played and
> stopped again and again (I thought this was a loop).

It is, but see below.

> Here is a small script that shows the issue.
> .flash bbox=800x600 filename="audio-embed.swf" version=7 fps=1
> .sound audio "my_life_changed.mp3"
> .stop audio
> .action:
>    snd = new Sound();
>    snd.attachSound("audio");
> .end
> .frame 1
>    .action:
>        snd.start(snd.position/1000.0,0);
>    .end
> .frame 2
> .end

> And the bug seems to be that when Flash version is above 6 and sound is
> embedded and stopped as above, when SWF reaches frame 2, it restarts the
> sound or the presentation itself.

No bug there.  You've stated  *1 frame per second* in the header,
right?   The sequence only lasts
two frames, so  after two seconds the sequence simply starts again.

> This happens if a frame is defined after  Sound.start, no matter whether it 
> has contents or not. I
>happens with both  Flash 7 and 10 for Linux,

Actually, no it doesn't.  Here is an example that shows you all works
aok, and with 'version=10'


Hope that helps.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]