Do not want the sound to loop.

Hello,
I made a flash movie and added sound in the movie which start in middle and goes till the end. But the problem is that when the movie is over, and the sound also stops automatically but starts again but the movie does'nt loop. I mean to say when the movie stops, the sound loops but the movie does'nt. I want the sound not to loop, it should be played once only.
LVL 1
Phud3Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

negatyveCommented:
How have you added your sound?
0
Phud3Author Commented:
my sound?... meaning here my own sound through mic?
I added a sound clip which is in .mp3 format.
0
RounehCommented:
Have you put it in your timeline, or are you loading it through actionscript?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

blue-genieCommented:
you need to attach your sound using a sound object ie.

function playSound() {
      s = new Sound();
      s.attachSound("test"); //where test is linkage ID in library
      s.start(0, 1); // this line tells it to play only once.
}
0
Phud3Author Commented:
Rouneh, yes, I have added the sound directly onto the timeline on a new layer.

Blue-genie, the code you gave where exactly should i paste it?

Thanks,
Later.
0
blue-genieCommented:
Phud3 - I'm assuming you're using MX or later - first thing you want to do is take it out of the timeline.
then locate it in the library, right click and select linkage. give it a linkage name, and make sure the first and last box is checked.

Then paste the playSound function in the timeline where you want the audio to play. If you have a keyframe that extends through the length of the movie, you can paste it in the first keyframe, then in the keyframe where you want the audio to start, call the function ie.
playSound();

that should do the trick.
0
Phud3Author Commented:
bah, I am confused. Blue-genie you asked me to make a linkage of the sound file in the library. I did it. Then i removed the sound from the sound timeline, meaning I cleared all the frames in the sound timeline and inserted a new keyframe at frame1 in the sound timeline. Then, i pasted the whole code which you stated above in the actions of that blank keyframe. Then, using the mouse pointer i dragged that 1st frame to the frame number where i wanted the sound to start playing. I changed the linkageID name to the name i gave to the soundclip while making a linkage but still when i previewed the movie it did'nt play the sound when it had to. And the  the function you gave in the last post ie playSound(); how do put this fuction in place of playSound() {. I am not able to edit.
Please help me out.
One more thign, when you publish the movie, I set the settings of the Flash allignment to be centre and centre. But in the webpage it comes on the top left corner. I want it to be in the centre of x axis and centre of y axis. How do you do this?

Thankyou so much,
Phud3.
0
blue-genieCommented:
no Phud.

the function can sit in the first key frame. What you want to do is call the function at the frame where you want it to play, so let's say on Frame 30, the audio must play, so on frame 30 insert the function call ie. playSound();


that's all, the only thing  you need to change in the function is the id which you've done.

so again.
in Frame 1.

function playSound() {
     s = new Sound();
     s.attachSound("test");
     s.start(0, 1);
}

in frame to start playing i.e. frame 30
playSound();


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.