|
|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
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? |
|
|
|
|
|
#2 |
|
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();
Code:
if(!isPlaying) {
playSndFx();
}
__________________
I Blog About Flash Last edited by finksmart; 02-24-2007 at 01:57 PM. |
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|