View Full Version : Background music starts another one when movie clip replays.
Mickey Flores
09-19-2008, 12:34 AM
I have just tried to attach a background sound with on/off button to my movie clip at frame 1 of the main Timeline.
Flash Movie: the movie will keep on replaying until a viewer clicks a button.
(frame 1 to 7)
Problem: the background sound plays again on top of the ancient one. And as the movie starts again, one more piece will be played, and so on.
I've tried to use different approach with action script but no luck, Please help.
punstc
09-19-2008, 02:45 AM
are you killing the instance of the music at the end of your swf? Do you want the music to be looping with the swf or keep playing as normal with just the movie looping? What exactly are you trying to get it to do?
Mickey Flores
09-19-2008, 02:59 AM
I just want the music to keep on looping as the movie keep on replaying.
The problem is, when the timeline goes back to frame 1 as the movie re plays
the music plays another fresh one from the start on top of the one that is currently playing from the first time its was loaded.
What I wanted is for the music to just be looping continuosly.
punstc
09-19-2008, 03:39 AM
have you tried putting your movie inside a movie clip and then establishing the music on frame 1 of the main timeline. The movie clip will loop and the music will just continue to play. you could then set a timer that counts down till the length of the song. when the timer finishes run a function that replays the song and restarts the timer.
*edit:
just looked through the live docs for AS3 for the play function there is a loop property that you can set.
play(startTime:Number = 0, loops:int = 0, sndTransform:SoundTransform = null):SoundChannel
Generates a new SoundChannel object to play back the sound.
here's the link to the live docs just look up sound for more info.
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/
Mickey Flores
09-19-2008, 06:02 AM
I just figured out whats causing all the annoying sound repeatitions.
it's not with the action script, it's with the sync! plain and simple solution took me 2 days. It's suppose to be set to "start" and NOT "event" and loop however many you want I set mine to "999".
Well, thanks anyways for your help buddy, if it wouldn't for your response I would've already gave up on this thing.
Thanks again :)
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.