473,385 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Background music starts another one when movie clip replays.

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.
Sep 19 '08 #1
2 3335
bnashenas1984
258 100+
Hi
You didn't say what version of AS you are using.

If it's AS3 then try to stop all playing sounds before openning a new channel by using this code:

Expand|Select|Wrap|Line Numbers
  1. SoundMixer.stopAll();
  2.  
Add this line before any sound command to stop all playing sounds.

I think the problem with your script is that when it goes to the begining, the other sounds are still running. That means the user needs to stop the sound and then play another one. But if you add this line the script will automaticaly stop all sound before playing the new one
Sep 20 '08 #2
just a suggestion: you may want to consider embedding the .swf that repeats inside the .swf that plays the music, or embedding both files inside a third. This should give you more control over the sound by keeping audio playback independent from video looping.
have fun!
Sep 25 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: JustThisOneQuestion | last post by:
Hi all. With iTunes 7 (Windows XP), if repeat is selected and a music video is next in the same playlist, the current song finishes but does not switch to the next one automatically... it just sits...
1
by: syamlalz | last post by:
HI... I have one movieclip named "thump_mc" which consists a loader component "myLoader".I am trying to duplicate that movie clip and load picture to it.But the images are not loading to the...
2
by: teenIce | last post by:
Hi all, Please help me with this problem. I'm new in flash and actionscript, sorry if my question is too easy. I have a variable name _root.test at Scene 1, and I have a movie clip name Answer,...
0
by: deluxmilkman | last post by:
I have a movie clip with a gradient mask. now I would like to have the bounding box of this movie clip reduced to the visible(masked) area, so that I can get its x and y positions. is it even...
5
by: =?Utf-8?B?V2FsdA==?= | last post by:
Can't import music to movie maker. The tracks show in my music. But when I try to import from my music, under the audio file extension, the folder shows empty. When I click on "all files" the...
5
by: Katt | last post by:
first of all I am new to flash. I just started to use CS3, and I have 2.0 actionscript selected Cannot get my MC button instance to go play a movie clip on another frame, I have tried...
1
Fary4u
by: Fary4u | last post by:
Hi i'm trying to design the picture gallery ever thing works fine but whn i've make test movie or export the swf file it's runs fine but problme i'm using this with in movie clip & i think...
1
by: gusheneshin | last post by:
hi everyone im Using this code to Creat a Movie Clip and load a movie "SWF" into this Flash ------------ stop(); loady._x = 226.4;this.createEmptyMovieClip("loady",5);
0
by: angelicdevil | last post by:
i hvae a movie clip tht loads thumbnails from images folder by reading the location of image from xml file... the problem is i have put up a scroll bar but its not working i.e its not scrolling...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.