Link to home
Start Free TrialLog in
Avatar of Phud3
Phud3Flag for United Arab Emirates

asked on

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.
Avatar of negatyve
negatyve

How have you added your sound?
Avatar of Phud3

ASKER

my sound?... meaning here my own sound through mic?
I added a sound clip which is in .mp3 format.
Have you put it in your timeline, or are you loading it through actionscript?
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.
}
Avatar of Phud3

ASKER

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.
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.
Avatar of Phud3

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of blue-genie
blue-genie
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial