473,748 Members | 2,441 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Background music starts another one when movie clip replays.

1 New Member
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 3358
bnashenas1984
258 Contributor
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
thesmithman
37 New Member
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
1946
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 on 'play' with 0 seconds remaining. Manually pressing play works fine. Have tried to get around this using setTimeout, but having NO experience in JScript means getting this ready in time has been a pain in the rump. Have been trying to get it to...
1
2112
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 duplicated movie clips. Pleease help me. for (var i = 1; i<=15; i++) { _root.duplicateMovieClip("thump_mc"+i, i+32); _root._x = i*75; _root.myLoader.loadMovie("5.jpg"); }
2
3025
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, what I need to do is to set another variable the value of _root.test in the movie clip. I try to do this code : testMV = _root.test; and
0
1986
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 possible? mc1.cacheAsBitmap = true; mc2.cacheAsBitmap = true; mc1.setMask("mc2");
5
1185
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 tracks appear, but won't import.
5
3179
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 both behavior and frame gotoandplay script, stop etc. current button behavior setting: on (press, release, dragOut) {
1
2087
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 so problm with level i've tried _level10 & 11 Also i've tried with _root & parent but no success any body know's where is the problem ?
1
5457
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
1977
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 the thumbnails' movie clip contents i m uploading the fla...plz see and help ...plz point out the line of code i need to change i think its the scrolling function. thanx
0
8994
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9555
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9329
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9250
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8247
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4878
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.