Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-07-2003, 11:25 PM   #1
He is Risen!
flashdudette's Avatar
Join Date: Mar 2002
Location: usa
Posts: 432
Default sound problem

I am having lots of problems with sounds in my movie.
My movie consists of several frames each loading a sound file
The whole movie also has music that I load on the first frame as following:
ActionScript Code:
//create variable to check if sound on for music, voice and sound in general                 playSound = true;     playVoice = true;     playMusic = true; ///// initialize variable for sound if ( playMusic = true) {     myMusic = new Sound();     myMusic.attachSound ("music");     myMusic.start(0,999); }  else if ( playMusic = false) {     myMusic.stop(); }

When each following frame loads, it plays a different sound file loaded as follow:

ActionScript Code:
if ( playVoice = true) {     myVoice = new Sound();      myVoice .loadSound("sound/voice1.mp3", true);     myVoice .start(0, 1);    }  else if ( playVoice = false) {     myVoice.stop(); }

I have a button to stop the music with

ActionScript Code:

and the play music button has:
ActionScript Code:

a button to stop voice:

ActionScript Code:

Since the music is a sound object off course if I click the music off button, it also stops the voice.
What I want is the following:
I want to be able to have music and let users decide if they want to play it, to stop it, restart it.
I also want them to decide if they want the voice or not.
How can I manage this? Can I have both music and voice and stop either one or both at will?
Call on the name of the Lord and you will be saved.
flashdudette is offline   Reply With Quote
Old 04-08-2003, 12:38 AM   #2
Banned by AS.org Staff
Join Date: Mar 2002
Posts: 10,533

Would be possibly much easier if you attached your .fla, rather than I (us) having to recreate it to check it out.
oldnewbie is offline   Reply With Quote
Old 04-08-2003, 03:24 PM   #3
Join Date: Apr 2002
Posts: 248

i haven't thoroughly looked at your code but it struck me that you were using "if(playMusic = true)" or something similar... i don't think i've seen it written as this, and am not sure if flash accepts this syntax?

for an if statement you might get away with "if(playMusic == true)", but a much simpler way is "if(playMusic)" which has the same effect. (false is done by "if(!playMusic)").

not sure if this helps at all, just thought i'd point it out.
Grifter is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:39 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.