Solved

Do not want the sound to loop.

Posted on 2003-11-09
8
231 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
 
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 Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
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 live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

827 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