Its from the example, Ch 13...(I do have the kaching.mp3)
class CashSoundEffect extends
mx.effects.Effect
{
var soundEffect:Sound;
{
var soundEffect:Sound;
public function CashSoundEffect()
{
soundEffect = new Sound();
soundEffect.loadSound("kaching.mp3", true);
}
public function PlayEffect():Void
{
soundEffect.start();
}
public function endEffect():Void
{
soundEffect.stop();
}
}
Then in the main program, I would like to play the
effect on a change event;
At
top:
<mx:Application...../>
<CashSoundEffect id="cse" duration="5"
/>
.
.
.
<mx:Script>
<![CDATA[
function PlayCashSoundEffect()
{
var soundEffect = new CashSoundEffect();
var priceRegister = new mx.effects.Parallel;
priceRegister.addChild( soundEffect );
priceRegister.PlayEffect();
//soundEffect.PlayEffect();
//cse.PlayEffect;
}
]]>
</mx:Script>
<![CDATA[
function PlayCashSoundEffect()
{
var soundEffect = new CashSoundEffect();
var priceRegister = new mx.effects.Parallel;
priceRegister.addChild( soundEffect );
priceRegister.PlayEffect();
//soundEffect.PlayEffect();
//cse.PlayEffect;
}
]]>
</mx:Script>
.
.
<mx:ComboBox id="CBApplication"
dataProvider="{APPLICATION}" change="PlayCashSoundEffect();"/>
I am
very new to Flex. Not sure how the kaching.mp3 is supposed to be
played. I noticed that "Sound" was not one of the available
class types shown in my code editor when I typed in the CashSoundEffect
class file (var soundEffect:Sound).
Thanks
for taking a look!
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of JesterXL
Sent: Monday, October 03, 2005 9:50 PM
To: [email protected]
Subject: Re: [flexcoders] Is an add-on required for Sound Effects?
Nope. Flash Player can play sounds since... well... a long
time ago.Sent: Monday, October 03, 2005 9:50 PM
To: [email protected]
Subject: Re: [flexcoders] Is an add-on required for Sound Effects?
Got some code not working? Post it.
----- Original Message -----
From: "symbltechies" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, October 03, 2005 9:25 PM
Subject: [flexcoders] Is an add-on required for Sound Effects?
Would anyone happen to know if there is an add-on that is required in
order to play sound effects with Flex 1.5?
Thanks.
Francine
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
________________________________________________________________________
This email has been scanned for computer viruses.
________________________________________________________________________
This email has been scanned for computer viruses.
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
| Web site design development | Computer software development | Software design and development |
| Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

