Background Sound Won't Play
Hi all --Looking to attach a background sound and play it using ActionScript. However, it's not working. I'm trying to link it up to a button called "soundButton" that toggles the audio. I have the wav file in my library, have exported it for ActionScript, and given it a linkage ID of "music." Also, if I trace after a button click, my "soundPlaying" value is always "false." Any ideas?See attached code below...any help is greatly appreciated!Attach Codevar soundPlaying:Boolean = true;var my_sound:Sound = new Sound();bg_sound.attachSound("music");bg_sound.start();soundButton.onRelease = function() { if(soundPlaying=false){trace(soundPlaying);var numSecondsOffset:Number = (bg_sound.position/1000); bg_sound.start(numSecondsOffset);soundButton.gotoAndPlay("on");soundPlaying=true; }else{trace(soundPlaying);stopAllSounds();soundButton.gotoAndPlay("off");soundPlaying=false; }}Edited: 11/15/2007 at 11:01:00 AM by ndisdabest
Adobe > ActionScript 1 and 2
Posted on: 11/15/2007 11:00:00 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Making One Button Play One Sound And Another Play A Different Sound
i'm very much a novice when it comes to flash.
i've created three separate buttons in three separate layers. i've also added three music files in three more layers. how can i get it so one button plays one music file and another button plays a different music file? i've tried putting "goto and play" for each button in actionscript but it doesn't seem to help.
any ideas?
i would be very grateful
Attach Sound, Play Sound & Stop Sound.
Hey there,
I was wondering if any of you could help me please.
I want to play a song which I have named "rundmc" The file extension is ".mp3"
I want a button to play this mp3 which I read you need to attach that sound, then play it and I want to a button to stop that sound, or preferably the play button to change into a stop button.
I've read the help files, but none of it works and I've changed the linkage for the mp3 to export for action script, but nothing works!!!
Please help,
NK.
Movie Sound And Background Sound Problem
I’m facing one problem. In my flash file have one background music and have one external movie ( flv ). I want when I click movie button then movie will load and background sound will stop and when I click close in movie then background sound will play again. *** remember movie file is external SWF file and I’ll put one button in that movie swf file call close.
And another one.. when movie running then if I click any other button then content come but movie sound play… this is not right .. caz when we click other button should be movie sound stop and background sound will playing
help me pls...
How To Play A Sound For 6 Times With Set Play Interval?
Hi,
I know how to play a sound effect:
Quote:
var mySoundReq:URLRequest = new URLRequest("laser.mp3");
var mySound:Sound = new Sound();
mySound.load(mySoundReq);
mySound.addEventListener(Event.COMPLETE, playSong);
function playSong(event:Event):void {
mySound.play();
}
The above sound effect play only one time. Actually I wish to play the sound effect for 6 times and at a set play interval (e.g. play the sound effect, wait 2 seconds, play again, wait another 2 seconds......). How can I do that?
I am thinking to use a Timer object. However I have no idea how to link with the playSong function.
Thanks and best regards
Alex
On Press Play Sound On Release Stop Sound
I have a button that is inside a movie clip 'forward'.
When you press the button it plays another movie clip 'time' forwards
on (press) {
forward = "1";
}
on (release, rollOut, dragOut) {
forward = "0";
}
on the button and:
if (forward eq "1") {
tellTarget ("/time") {
nextFrame();
}
}
on the first frame of the 'forward' movie
I would like sound to happen when you press the button and stop when you realease the button
but I not sure how any help would be gratefully excepted
Background Play Issue
Hi Gang,
Well I've been flashing about for a few years now and recently I've come across a project that I need to prevent from playing whenever there isn't user focus on it.
More specifically Here's what I've got:
1. A MAIN Swf encased in an HTML Page
2. This swf loads many many other swfs (we'll call them SUBSWFS)
3. The subswfs launch portfolio pieces (some of which are complex separate swf projects)
What I need to happen is when the portfolio pieces launch -- for the MAIN SWF to COMPLETELY HALT ALL OPERATIONS until the user refocuses on that browser window by clicking on it.
I know Director has something built into it "stop from playing in background"
Where if a user ISN'T on the window w/the project, It halts itself, else it starts itself.
But I can't find ANY documentation on how to achieve this in flash
In regards to attempting to solve this:
My thought was that at launch time, the swf would issue a stop call to itself, AND THEN the HTML page would do the focus detect and reinitialize playback on the swf (But is this even possible with a ton of multi loading swfs???)
I guess I'm just not certain if I'm headed in the right direction!!!
At any rate I hope someone out there can help me out!
Thanks All Y'Alll!
japanigirl
Sound Overlap When 2 Swf Play Sound At The Same Time P R O B L E M
Figure this:
I sen to my clients via mail an regular html with a swf embebed. They recibe the html and the flash starts playing the loop sound. Therere are, also the loop, severals sound trigered in different parts of the swf file.
the problem starts when my clients double click in the outlook inbox and the html pops up and there we have 2 html with 2 swf playing sound at the same time.
I tried stop all sounds at the begining of the movie. but it only stops the loop sound but not the trigered sounds of the rest of the time line.
is there a way to stop the sound of the first swf when the second pop up?
anyone?
Dont Play Sound Until Another Sound Finished
Hi guys
How do i wait until a sound has stopped playing before playing another sound. Ideally something along the lines of :
if (sound1.hasCompletedPlaying()) {
sound2.start();
}
im not sure what the boolean check is for if a sound is still playing or not though.
thanks in advance.
Play Sound/stop Sound Button
i want to make a single button to play a sound, and if pressed again, stop the sound. and if pressed again, play the sound, and so on...
i know it has to be made with a boolean variable, true/false, but i just can't figure out how.
any help?
thank you very much.
How To Play Continues Background Music
I'm having problems on how to play a background sound that doesn't stop when you click on a new link. when i attach the music to one movie when i load the next the sound stops. if i attach music to the other movies, they start at the beginning.. again. help please
Load Mc On The Background And Make It Play
i´m using Flash pro 2004 and would like to make a mc to download on the background while the movie is playing, and when the movie gets to frame 200 to play thge loaded mc.
How to make it work?
Thanks
Proper Way To Play A Background Song...
ok i want to play a song in the background of my site.
can someone tell me how to put a song in my site, but make it only load after everything else (so the load time of the rest of the site doesn't increase).
thanks
mike
Getting Background Animation To Play Continuously...
Hey again everyone,
I have another idea i want to do but im also not sure how to create it, as you already know im still new to flash.
What im trying to do is to have an animated background that continuously plays. Then i want know to know how do i get my links and text on top of that as the background images plays? (such as bubbles moving continuously across in the background) do you get me? I hope i explained it cear enough..
Any suggestions??
Thanks heaps guys,
Jakatta..
Load Mc On The Background And Make It Play
i´m using Flash pro 2004 and would like to make a mc to download on the background while the movie is playing, and when the movie gets to frame 200 to play thge loaded mc.
How to make it work?
Thanks
Proper Way To Play A Background Song...
ok i want to play a song in the background of my site.
can someone tell me how to put a song in my site, but make it only load after everything else (so the load time of the rest of the site doesn't increase).
thanks
mike
Play Movie In Background With Mouseover On A Button...
Hello everyone...
Do anyone know how to play a movie by moving your mouse over a button? (I have a scoccer ball jumping - a movieclip) And i´d like to make the ball jump, but only when you put your mouse over a button. And still use the button as a link to a webpage.
Hope someone can help me.... Thanks
Btw: Sorry 4 my poor english ;o) Hope yu can read it ;o)
Mute Background Music To Play The VIDEO
hey guys,
I have Googled my issue and came up with this POST to the exact same problem I am currently having but unfortunately, I am not enough of a flash expert to understand how to change this on my 'flash template' and how to successfully mute the background music as my VIDEO starts to play.
If anyone could help me out, that would be much much appreciated!!
I have uploaded my FLA file so that you can see what the problem is:
http://www.affairthemovie.com/main1.fla
The background music is set as per TEMPLATE that I got. I would like to add a quicktime movie to the website, under the page titled "TRAILER" - and have tried to do so myself by adding the QUICKTIME to the project through another SWF that I got elsewhere (a different 'template' so to speak).
The original quicktime file that I wish to add is available here:
http://www.affairthemovie.com/qt/trailer.mov
and as a flv
http://www.affairthemovie.com/trailer1.flv
(to which it is linked to currently in the FLA above).
I'd like to be able to stop the background music when the viewer visits the TRAILER page of the site, as that is when the trailer starts to play. The music can stop abruptly, that is fine.
I'd like for the music to continue to play (either from the start, or where it was stopped) when any other pages are visited after watching of the trailer.
Thank you very much in advance!
This is my first real deal at trying to do anything in flash so I appreciate any help I can get
Indifilmz
PLAY Sound And STOP Sound
I have no clue how to play and stop sound. I tried everything but I guess I am doing it wrong!
basically...... the name of the clip i want to play is
sound1
i have a little play button and a little stop button
i need the code so that it will play sound1 when clicked on
and the stop button i just put stop all sounds so i guess that should take care of it..but if that is wrong then please let me know, lol
thanks
xox marqi
Play Sound#2 On Complete Of Sound#1?
I'm a total newbie when it comes to action scripting and I'm hoping someone can help me out.
I need a script that plays sound#1 and when sound#1 is over plays sound#2. Seems simple but I've been trying to figure it out without any luck.
The sound files are background music that play over a multi scene project so keyframing is not really an option.
Thanks
Andy Hunter
Sound Switch (on/off) To Play A Sound.
Hi there!
I am a begginer, and I would like to solve this:
There are 2 switches,(each one has "on" and "off" position)
But, only play the sound when the switch#1 is "on" and the switch#2 is also "on".For example if the Switch#1 is "off" and switch#2 is "on"
nothing happens, that is it!
Thanks!
Ricardo
Background Sound
Hello everyone
I am having a problem with a background sound. I should start by telling you that I am using MX.
I have a Flash presentation that will be distributed on CD as a projector exe. In side the presentation you can launch programs created in Director 8.5 which contain panoramas, my problem is when you launch one of these Director files it takes about 10 seconds for the program to open, during this span of time the background sound in the flash projector gets broken up and skips. I am assuming this is because it is taxing the processor, I am running a
933mhz Pentium 3 and I think it should be able to handle both tasks. It should also be known that my panoramas are using an asset for panoramas created in Realviz Stitcher. Stitcher formats the panoramas in a shockwave file. I’m not sure if this has any bearing on the problem.
Any ideas would be greatly appreciated. I would open to any ideas, maybe something along the lines of script attached to the button that opens the panoramas to temporally pause the sound for 15 seconds or so.
Thanks Rex
Background Sound
hi,
i have a flash file in which it is all based on frame based navigation. what i wanted was to playa looping sound in the background throughout the movie continuously and a button to play/stop. how can this be done?
Background Sound Help
Hi,
When I have my background sound play along with flash music play at the same time, when I mute the background sound it also mute the flash music player.
How can I mute only background sound without muting my external flash player?
Thanks
Help With Background Sound :((
Hi!
I have been working at a website and I have to use a background sound. The problem is that if I go to some other frames, the sound keeps starting again and again and it's very annoying..
Is there a way to prevent the sound from starting if it is already playing?
I mean there definetly is a way, but it is very strange because I'm not calling that sound to play again in any other frame.
Background Sound
Hi all:
I have background music playing on my movie. I also have two seperate tracks that a user would have to press a play button to hear. What I'm looking for is for the background music to stop when they press the play button for the track and to resume once the track ends.
I've tried the stopallsounds code and a couple of others, that I've researched but have had no success. Any help would be greatly appreciated.
Background Sound
ive a background sound thats called to play when my application starts and it plays along nicely ect ect... the problem i have is when i click on a button to say another scene and the link back from that child reverts to the start of the parent, the background sound plays again resulting in multiple background samples playing at the same time?? is there any code trickery that will alow the sound to play only once no matter how many times that initial frame is visited??
John
Background Sound?
Hey everyone,
I have a really complex animation setup with like 6 scenes and in each scene the frame action is in sections (for example, there will be a scene..then nothing..then a scene..then nothing) ...the individual sections run into 'gotoandplay' commands or others which lead to other sections here and there.
Anyways, that's not the point. The thing is, I tried putting sound behind all these sections in all these scenes but it's ridiculous because some of the sections repeat themselves or you're jumping to new sections all the time so you're constantly hearing the sound get 'cut-off' and 'repeated' and it sounds horrible.
My question is, is there a way i can just somehow put a background sound in that plays THRU everything? no matter who clicks on what or what goes where? so in essence, i would have a sound that was ONE clip..playing through it's entirety and repeating but not being effected by all the actionscripting going on with the user...
See what i'm saying?
how do i do this if this is possible?
Background Sound
Hello everyone,
Im just trying too add some background sound FX to my movie. I also want it too loop. Im using the following script but it seems too not work.
backSound = new Sound ();
backSound.attachSound (audio.mp3);
backSound.Start(0,99);
Anyhelp would be greatly appreciated.
Background Sound
Hello,
I have a background sound bite that I would only like it to play the first time the page loads, not each time. How do I set that feature.
Also, is it possible to also have the flash animate the first load also? After that, each page the consumer loads will from that point be a solid image?
Thanks Dom
Background Sound...
Is there anyway that I can import a mp3 file and preview the sounds it makes without having to "Preview" it. I want to be able to mix the music a little bit. Thanks.
Background Sound...
Is there anyway that I can import a mp3 file and preview the sounds it makes without having to "Preview" it. I want to be able to mix the music a little bit. Thanks.
Sound In Background?
Hi everyone!!
All i want to know is simple, but might be complicated i dont know!
How do i get a sound to play throughout the entire flash site in the background?
Go to www.cruciallimit.com and you will see what i mean.
Its a great site by the way!
In this "crucial limit" site, he has tunes playing in the background, and they keep playing despite how deep you navigate throught the site, no matter what button you press, the song continues to play without stopping.
Thats what i want to achieve.
Can anyone help me????
http://www.cruciallimit.com/
Sound In Background
Hi everyone!!
All i want to know is simple, but might be complicated i dont know!
How do i get a sound to play throughout the entire flash site in the background?
Go to www.cruciallimit.com and you will see what i mean.
Its a great site by the way!
In this "crucial limit" site, he has tunes playing in the background, and they keep playing despite how deep you navigate throught the site, no matter what button you press, the song continues to play without stopping.
Thats what i want to achieve.
Can anyone help me????
http://www.cruciallimit.com/
Background Sound Help
Hello all.. this task is really confusing !!
i have a sound clip that occupies 50 frames.
i need to run it endlessly after its completion without break.
in flash 8 i tried the option , sync event loop.. so that its playon contiguously..
it is playing continously.. but
when the sound clip ends it leaves a 2 second gap and then begins to play..
I want to remove the 2 second gap , but i was unable to do that !
i tried all means , but not helping..
Background Sound
I suppose this is an easy one:
I have a layer (layer1) with an animation that loops (frame 10 -> frame5), and another layer (layer2) that has a keyframe on 5 where a sound file starts to play. Now, the sound file loops together with the animation, but I want it to continue playing without looping. How can I do that? I want to add more layers that aren't looping...
Thanks!
Pieter
Background Sound In One Frame Alone?
I have a three-frame game, and I wan't music in the
second frame alone. How do I do this? Everything I
try it keeps playing through to the third, and
if the user "plays again" the background music
plays twice over itself.
stopAllSound worked in the third frame, but it killed
my "game over" sound.
THNX
Streaming Background Sound
i feel very dumb - actually i forgot how to make tiny movieclip with a long streaming sound inside - i tried around but it always loads completly before playing - how can i make such a movieclip so it plays in the background? (flash 5 compatibility would be great as well)
any help?
Different Background Sound Options
Hello Flashers,
I was wondering if it was possible to give the end user an option to choose from 4 different background sounds?
I believe I want to have 4 buttons for this, but all in one movie if that is the best way to do it? I am not yet familiar with sounds yet using actionscript as I am still new to all this.
I want to have the 4 separate buttons (one for each sound .wav and have each one loop continuously) and an "on" and "off" button in the same main movie if that makes sense? I can pull the on and off buttons from the flash mx library and I will make up 4 buttons for the sounds, I just need the code if possible to put all this together if anyone can help me?
I thank you all very much
Thorrax
Control The Background Sound
I have an swf movie (Like a talking head). I am loading this movie on my main timeline. But I have a background music on this main timeline. I would like to make my main movie's music to fadeout while this talking head movie is on the main timeline. The moment the talking head movie comes to an end, I want the main music to play normally. Is this possible? I hope I am clear.
Thank you very much!
How To Make Background Sound ?
Hi, I'm new on Flash.
Please anyone, how to make background sound in Flash ?
I mean a whole song (like when we're listening to MP3) not 2' or 3' loops. Something like jukebox perhaps....
Thanks anyone who helps me
Continuous Sound In Background
I'm looking to have an audio clip play over and over, even after the motion in the rest of my movie is done.
I was thinking of creating a separate swf and importing into the libary and some how calling it to keep looping.
Any suggestions?
How Fade The Background Sound?
Hello everyone, this is my first message here.
I am starting a project, and I have been having a bit of trouble. I am fairly new to flash.
I have made a list of scenes, added a background sound in the first scene. And it loops in the background, which is what I want.
But when a user clicks on a button in another scene, I want this sound to fade away. I Actually want it to quietly play int he background, while a new sound plays in the foreground. Then when the user clicks out of the current button, I want the background to fade back up.
Also, While the foreground sound is playing, i am trying to make a pause, play, stop button(i know those), but i want to have a timeline slider that the user can click and drag in order to rewind the sound.
Anyone know how I can do this?
Thank you
Background Sound Loops
Hi,
my sites use a swf that contains 1 mp3. Lets call it bgsound1.swf.
The viewer can skip songs by clicking a button, the button will load a new swf. Lets call that bgsound2.swf
But I want the bgsound1.swf to automatically go to bgsound2.swf as soon as the mp3 has finished (now it just continuesly keeps looping if the mp3 is finished). How do I tell my movie that he must load the second movie. How does the swf knows when the mp3 is finished? I havent got a clue.
who can help me there?
Worrisome Background Sound..PLEASE HELP
HEllo everyone...Well am a newbie to this forum...and am in need of some desperate help....let me lay it out for you.....i have made a flash MX 2004 presentation (swf) with a lot of scenes and a voice over in each scene. It also opens full screen. It was all good till my client asked me to put a background song. Now heres my problem....As i have the voice over in each scene....at the end of each scene i have put "stop all sounds" .if i remove this the voice over continues on to the next scene.....so now i need to put this BG sound without changing anything else....I have read a previous thread and have come across sumthin like this
"A2: attach a movie clip to the stage in scene 1 using attachMovie and it will not be affected by scene changes. Include the sound in the mc or associate a sound object with this mc."
This could be the slution but i have to idea what it means....can some one elaborate...
Also to find a solution i tried using director MX...i imported the whole swfinto my stage and put the sound clip ....it works fine but while making a standalone out of it.....my stage goes full screen but the imported flash swf remains 800 x 600...is there anyway i can make that stretch to full screen too...If I have the answer to this then i can make it happen in director ....
Well here I am desperately awaiting some solution....Thnks in advance everyone......have a good one till then.....Ciao.
Background Sound With On/Off Buttons
i want to create a background sound in my project,
and it includes On and Off buttons..
when the flash file is open, the bg sound will play
if the user wants to stop or pause the sound,
the button Off will be press and i used this code
ActionScript Code:
this.sound.ffo.onRelease = function()
{
stopAllSounds();
}
is that right?
but when the user click the "On" button, the sound will play where the sound stop and continue playing. did you get it? i can't explain clearly sorry for that..
how can i make that?
Load Sound In Background
Hi,
I have this Flash web template with 1 main swf and 5 external swf's, and there is a sound loop in the main swf. How can I load the sound loop in the background, while being able to navigate (load) the 5 pages? A good tutorial maybe? Or some source file to start from?
Hopefully my question won't stay unanswered as the one from link below did.
http://www.actionscript.org/forums/s...d.php3?t=54751
Thanks.
|