PDA

View Full Version : Getting and audio to play just once


Robybob
03-16-2002, 05:30 PM
Hi,

I have a Flash site, and when you navigate to one page within the Flash site, a disclaimer audio plays. But I only want it to play once, just the first time the user goes to that page. When the user goes to that page again, I don't want it to play.

Here is my code:
-----------
Frame 1
-----------

if (_root.discPlayed == false) {
_root.discPlayed == false;
gotoAndPlay (3);
} else {
stop ();
}

-----------
Frame 3
-----------

audio is played

-----------
Frame 15
-----------

audio stops

-----------
Frame 16
-----------

_root.discPlayed == true;
stop();

--------------------------------------

Now that _root.discPlayed == true, the audio should not play again while the user remains on the site.

It's not working, what do I need to do?

Robybob
03-16-2002, 05:32 PM
sorry, accidently put it in wrong area

Tink
03-19-2002, 06:48 PM
if (_root.discPlayed == true) {
stop ();
} else {
gotoAndPlay (3);
}

does that work? if discplayed == true (ie. it has played once the movie stops (doesn't play sound).
if it doesn't equal true then play the sound.

i think u will need to set _root.discplayed to false somewhere in your movie. u don't want it here on frame 1 as it will keep setting it back to false and play the sound again. u could maybe put it on frame 1 of your main timeline (if ur movie never playes frame 1 more than once). does that make sense?

cheers

BLEEDA

farafiro
03-20-2002, 07:00 AM
Originally posted by Robybob
sorry, accidently put it in wrong area

Hey Bleeda
didn't u see that post, he put it is the AS forums and got the answers from about year ago :p
:D