[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swftools-common] stop long sound
From: |
Chris Pugh |
Subject: |
Re: [Swftools-common] stop long sound |
Date: |
Mon, 23 Nov 2009 23:58:20 +0000 |
>2009/11/23 Matthew Morgan <address@hidden>:
>
>
> Chris Pugh wrote:
>>
>> Because the sounds are triggered in your sprites, and are thus local
>> to your sprites, and not to the main movie?
>> As a result all you are doing is overlayering the same sounds on top
>> of one another, raher than actually stopping
>> them.
>>
>> Try giving this a quick read..
>>
>>
>>
>> http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/media/SoundMixer.html
>>
>> HTH.
>>
>> Regards,
>>
>>
>> Chris.
>>
>
> Thanks Chris. I read the link, but I'm having trouble figuring out how to
> get the actionscript sound functions to work. I've tried just doing stuff
> like:
>
> var mySound = new Sound();
> mySound.load(new URLRequest("mysound.wav"));
> mySound.play();
> But nothing happens. I assumed that meant I needed to import the right
> namespaces, but I can't get that to work either. I saw an example herewf2
Try it this way..: ( 'loadSound' only handles mp3 files ).
------------------------------------------------------------------------------------------------
.flash filename="filename.swf" bbox=200x200 version=8 fps=50 compress
.action:
var mySound = new Sound();
mySound.loadSound("mysound.mp3",false);
// mySound.play();
// mySound.stop();
.end
.end
------------------------------------------------------------------------------------------------
or, try it this way,
------------------------------------------------------------------------------------------------
.flash filename="filename.swf" bbox=200x200 version=8 fps=50 compress
.sound wavfile "mysound.wav"
.action:
var mySnd = new Sound();
mySnd.attachSound("wavfile");
mySnd.start();
.end
.end
------------------------------------------------------------------------------------------------
> showed using the package{ } syntax, but I can't get swfc to compile that.
> Even copying and pasting that code into a file doesn't work. Swfc trips
> out when it hits the "package" token.
AS3 handles things slightly differently. You don't need the package wrapper
when writing in swfc. You do need it if compiiing with as3compile.
I write a whole raft of sound stuff, when I was experimenting - basic stuff,
through to a small, but useful, meda player. If you'd care for a few more
examples then let me know. I'll dig them out and revise them. Could always
post them on the wiki.. ;o)
HTH.
Regards,
Chris.