To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > General Help > Sounds and Music

Reply
 
Thread Tools Search this Thread Display Modes
Old 02-21-2007, 06:52 PM   #1
Fuente
Senior Member
 
Join Date: Jun 2001
Posts: 218
Flash 8: Get a sound to play if it hasn't already started?

Hi guys,

I have a typewriting effect that exists on 6 frames - on frame one the says what characters to type and which character comes next and on frame six it tells it to go back to the begining.

I also have a typewriting sound effect - Is there any way I can tell the flash to play the typewriting sound if it's not already playing, every time it hits that first frame?
Fuente is offline   Reply With Quote
Old 02-24-2007, 01:55 PM   #2
finksmart
Senior Member
 
Join Date: Oct 2003
Location: NYC
Posts: 107
This might work. I haven't tested it. But it should give you some idea.

On frame one:

Code:
var isPlaying = false;
var sndFx = new Sound(this);
sndFx.attachSound("linkageNameOfYourSound");
sndFx.onSoundComplete = function() {
  isPlaying = false;
}

function playSndFx() {
 sndFx.start();
 isPlaying = true;
}

playSndFx();
On each subsequent frame:

Code:
if(!isPlaying) {
 playSndFx();
}
Or try writing a function that does does the typing and called by setInterval. So everytime the function executes you play the sound.
__________________
I Blog About Flash

Last edited by finksmart; 02-24-2007 at 01:57 PM.
finksmart is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > General Help > Sounds and Music

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:50 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.