Solved

Do not want the sound to loop.

Posted on 2003-11-09
8
227 Views
Last Modified: 2010-04-03
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.
0
Comment
Question by:Phud3
8 Comments
 
LVL 27

Expert Comment

by:negatyve
ID: 9710581
How have you added your sound?
0
 
LVL 1

Author Comment

by:Phud3
ID: 9710792
my sound?... meaning here my own sound through mic?
I added a sound clip which is in .mp3 format.
0
 

Expert Comment

by:Rouneh
ID: 9712096
Have you put it in your timeline, or are you loading it through actionscript?
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 9712846
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Author Comment

by:Phud3
ID: 9714244
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
 
LVL 39

Expert Comment

by:blue-genie
ID: 9714314
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
 
LVL 1

Author Comment

by:Phud3
ID: 9738344
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
 
LVL 39

Accepted Solution

by:
blue-genie earned 20 total points
ID: 9738449
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

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now