Help -Stuck In Sound Fade Out Actionscripting
Hi there!
I need some help with sound actionscripting.I'm loading a swf file with a sound and function into the main movie.I call the function from the main movie when the sound.swf is loaded.
The problem is that when using function to attach the sound i don't know how to fade out the sound when looped 10 times.
My function is:
function mysound () {
mysoundobj = new Sound(this);
mysoundobj.attachSound("idname");
mysoundobj.start(0, 9);
}
Then in the main movie i call the function from a movie clip and preload the sound.swf:
onClipEvent (load) {
loadMovieNum ("sound.swf", 1);
}
onClipEvent (enterFrame) {
percentloaded = Math.floor(_level1.getBytesLoaded()/_level1.getBytesTotal()*100);
_root.percentdisplay = percentloaded + "% loaded";
if (percentloaded == 100 && !initialized) {
_level1.mysound();
_root.gotoAndPlay(10);
initialized = true;
_visible = false;
}
}
I need to fade out the sound after the 10-th loop!
That's all.Help me.I'll really appreciate that!
Thanks in advance!!!
FlashKit > Flash Help > Flash ActionScript
Posted on: 09-21-2001, 04:28 PM
View Complete Forum Thread with Replies
Sponsored Links:
Help With Sound Actionscripting
Hello, I'm using a Flashkit tutorial here
http://www.flashkit.com/tutorials/Au...49/index.shtml
to play and pause a sound file in my .swf. The problem with this tutorial is:
1. The sound file plays automatically when the page loads without the user having to click on a play button.
2. It doesn't deal with multiple files.
I have three sound effects I want to play in my .swf, each controlled by their own individual play and pause buttons. I want to know how to actionscript my .swf to tell it to load sound clip No. 1 when I click on button No. 1 and pause when I click on button No. 2, and so forth for the other two sound clips.
Thanks for any help you guys can give me.
View Replies !
View Related
Sound Through Actionscripting
I am having difficulty getting my sound file to play.
I want it to play when the user presses the up key. I cannot seem to find the code for playing a sound. My sound is called tie-3-shot and I have imported it to the library. I have also adjusted the linkage so that it exports it for actionscripting. My code is as follows:
Code:
onClipEvent (enterFrame) {
if(Key.isDown(Key.SPACE)){
tie-3-shot.start();
}
}
This is not working. I've never played sounds through actionscripting before. Perhaps this is not how it's done?
Any advice would be greatly appreciated.
Thanks
View Replies !
View Related
Actionscripting For Sound--Help
I'm a newbie with sound and I am creating a Flash CD-Rom business card/presentation and I have two sound clips--a voice over and some background music. I have NEVER had to use sound and have to control when it stops, volume, etc...but that's basically what I need to know. I need to stop and start the voice over at certain frames and I need to lower the volume of the background music when the voice over begins. Tried putting the sounds in movie clips and that didn't seem to work. I'm pretty familiar with actionscripting and the program itself--just never used sound really--any help is GREATLY appreciated, thanks a lot!!!
View Replies !
View Related
Actionscripting Sound Question
Hey all! Question...Can I attach a variable to a sound to control just THAT sound. I have several sounds playing at once and I need ONE sound to stop when the users tells it so. The sound needs to fade too, I tried the setVolume function but ofcourse it turns ALL sounds down...not good...any suggestions? To recap:
One sound out of many need to be turned down via user interference
Sound needs to fade independently of any others...
Any ideas???
Thanks all!
- Sigma
View Replies !
View Related
Please Explain Sound With Actionscripting To Me
Why is it when I put this on the first frame of my movie:
_level0.myTyping = new Sound();
_level0.myTyping.attachSound("typing");
_level0.myLaughing = new Sound();
_level0.myLaughing.attachSound("laughing");
and then I do this on frame 50:
_level0.myTyping.start(0,1);
_level0.myLaughing.start(0,1);
and then I do this on frame 60:
_level0.myTyping.stop();
it stops both sounds, not just myTyping.
I've also noticed that it stops a sound loop I had playing in a movie clip that I had not linked up to actionscripting at all!
It's doint the same thing as the function, stopAllSounds(); !!
Same thing occurs if I try and change the volume of one of the sounds such as
_myTyping.setVolume(50);
It affects both sounds! (As well as my movie clip with the sound loop in it!)
I thought by assinging a new sound to a variable, you could control the playback and volume settings for that one variable... I'm wrong obviously, but what is the correct theorey with using actionscripting with sounds???
Thanks much!
[Edited by bread_man on 05-14-2002 at 04:34 PM]
View Replies !
View Related
Playing Sound Actionscripting
Hello, I'm trying to have a button play a short mp3 on my .swf after I click on it. I want it to work like the flashtrak console on the soundloops section of Flash Kit. Can anyone tell me how to actionscript the button? Thanks for the help!
View Replies !
View Related
Important Actionscripting For Sound
I'm a newbie with sound and I am creating a Flash CD-Rom business card/presentation and I have two sound clips--a voice over and some background music. I have NEVER had to use sound and have to control when it stops, volume, etc...but that's basically what I need to know. I need to stop and start the voice over at certain frames and I need to lower the volume of the background music when the voice over begins. Tried putting the sounds in movie clips and that didn't seem to work. I'm pretty familiar with actionscripting and the program itself--just never used sound really--any help is GREATLY appreciated, thanks a lot!!!
View Replies !
View Related
Actionscripting For Sound//please_Help
OK so I've been dealing with actionscript for a while but I've just recently began to deal with sound so I'm a newbie with it. I'm doing a presentation with some background music and a voice over and I need the BG music to lower in volume when I bring in the voice over--this is the script I have:
bgmusic = new Sound();
bgmusic.attachSound("Ambience");
bgmusic.start();
and then at the frame where the voice over comes in (on a seperate layer) i put the following code:
vox = new Sound();
vox.attachSound("VoiceOver");
vox.start();
_root.bgmusic.setVolume(30);
but the volume does not change for the bgmusic--can someone help me out?
View Replies !
View Related
Help With Controlling Sound With Actionscripting
Hi, I've created a Mute button to stop and play the background sound ,
the problem is
when the sound starts again , it starts from the beginning of the song,
how can I actionscript it so that the song starts from where it was stopped ?
here is the actionscripting I used on the first frame;
stop();
var s1:Sound = new Sound();
s1.attachSound("bg-music");
s1.start();
============================================
and I used this code on the On and Off buttons;
on_mc.onPress = function() {
with (_root) {
s1.stop();
}
};
on_mc.onRelease = function() {
gotoAndStop("off");
};
off_btn.onPress = function() {
with (_root) {
s1.();
}
};
off_btn.onRelease = function() {
gotoAndStop("on");
};
any help would be appreciated ...
View Replies !
View Related
[MX] Sound Control Actionscripting
Just a really simple problem people; wondering how to have a button that plays a music loop but will NOT play it if it is already playing...did that make sense? I know how to do it without actionscript but just wanting a quicker more efficient way. CHeers!
View Replies !
View Related
Sound Fade In/fade Out - Fine, But Not First Time
I followed Kenny Bellows tutorial on fade in/fade out: http://www.kennybellew.com/
Everything seems to work fine, except it won't fade out the first time i click. After the first time, it fades fine.
Anyone had this problem?
Code:
this.onEnterFrame = function () {
//fade out and in
if (daveFadeOut == 1){
daveSoundVolume = daveSoundVolume - 1;
daveSound.setVolume(daveSoundVolume);
}
if (daveSoundVolume < 1){
daveSoundVolume = 0;
daveFadeOut=0;
}
if (daveFadeIn == 1){
daveSoundVolume = daveSoundVolume + 1;
daveSound.setVolume(daveSoundVolume);
}
if (daveSoundVolume > 29){
daveSoundVolume = 30;
daveFadeIn=0;
}
//finish fade out and in
}
Cheers,
Dave
View Replies !
View Related
Sound Related Actionscripting Questions
Hello there.
i would like to create a presentation swf for a new site we opened and i have a really cool idea. What if i was able somehow to get input from a sound clip, in a way so i could know the bass levels?
I want to create a movie which will contain some movie clips that will react to the bass levels of the sound clip playing. Is this possible to do with just actionscripting? i saw a tutorial about creating a spectrum analyzer and this is certainly a way to do it, but i wanted to know if there is another, code only way to do it.
thanks!
View Replies !
View Related
Actionscripting Sound Functions For Buttons
I've recently been putting together a flash site for my band. I have a basic online store setup on the front page, where our fans can click a link to buy our whole album or just individual mp3s. I want to give the listener the ability to press a play button for each song, and then jump to another song and press play for that song to preview the music before they buy it.
I've been able to successfully create buttons that play a sound and stop a sound. But I still need to be able to have someone click the play button on a second song and have that play button stop the song that's already playing. That way the listener can jump between the 12 play buttons and not hear 12 songs playing at once or have to go back and hit the stop button each time.
Any help or direction would be greatly appreciated!
View Replies !
View Related
[FMX04] Actionscripting - Help With Pulling In Sound File Along With .swf
Hey All, Another AS novice here. I have a FLA built that pulls in external .swf files via XML files. On a button click inside the FLA I load the SWF into a small window in the FLA. I can get it to play, stop and pause... but the sound still plays because it's embedded in the SWF file. Sooo, I wanted to try to load the MP3 files along with loading the SWF files. But I can't seem to get it working. I'm sure there's some big mistake with pulling the sound file in and getting it to play - I just don't know enough about AS to see them. Any help would be GRRRREATLY appreciated! Thx!
Here is the code that's pulling in the files:
Code:
//Create the XML Object
myXML = new XML()
myXML.ignoreWhite = true
//Load XML file
myXML.load("seminars.xml?cachebuster=" + new Date().getTime());
//Make a reference to current timeline
myXML.ref = this
// Parse XML and fetch
myXML.onLoad = function(success){
if(success){
var root = this.firstChild
nodes = root.childNodes
for(var i=0; i<nodes.length; i++) {
this.ref["Title_txt"+i].text = nodes[i].attributes.name
subnodes = nodes[i].childNodes
this.ref["Comments_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i] = subnodes[1].firstChild.toString()
this.ref["holder_mc"+i].loadMovie(subnodes[2].firstChild.toString())
this.ref["holder_mc"+i].my_sound.loadSound(subnodes[3].firstChild.toString(), true);
}
} else trace("Error loading XML document")
}
And here is the code for the button:
Code:
on (release) {
var lo = new Object();
var mcl = new MovieClipLoader();
var my_sound:Sound = new Sound();
mcl.addListener(lo);
lo.onLoadInit = function() {
};
mcl.loadClip(Link_txt0, "_root.mainMovie");
my_sound.start(Sound_mc0, 99);
button_mc.onRelease = function() {
};
}
And here's the XML:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data[
<!ELEMENT title (comments, link, image, sound)>
<!ATTLIST title name CDATA #REQUIRED>
<!ELEMENT comments (#PCDATA)>
<!ELEMENT link (#PCDATA)>
<!ELEMENT image (#PCDATA)>
<!ELEMENT sound (#PCDATA)>
]>
<data>
<title name="name">
<comments>text here</comments>
<link>file.swf</link>
<image>images/imageName_sm.jpg</image>
<sound>soundfile.mp3</sound>
</title>
<title name="name">
<comments>text here</comments>
<link>file.swf</link>
<image>images/imageName_sm.jpg</image>
<sound>soundfile.mp3</sound>
</title>
<title name="name">
<comments>text here</comments>
<link>file.swf</link>
<image>images/imageName_sm.jpg</image>
<sound>soundfile.mp3</sound>
</title>
<title name="name">
<comments>text here</comments>
<link>file.swf</link>
<image>images/imageName_sm.jpg</image>
<sound>soundfile.mp3</sound>
</title>
<title name="name">
<comments>text here</comments>
<link>file.swf</link>
<image>images/imageName_sm.jpg</image>
<sound>soundfile.mp3</sound>
</title>
</data>
View Replies !
View Related
Please Help Me I Am Stuck In Sound....
I have inserted a sound in my movie and I have volume controlls for it.
this volumme controll works when it loads first. but when the movie plays furthere and comes back to beginig the sounds stats playing again and the volume controll doen not work than...
can anybody help me...
I am not in very advance level of scripting...
please help me...
thank you very much
View Replies !
View Related
STUCK ON SOUND FADING
How's it going yall?
I'm in a rut and need some help. I have a project I'm working on where I need some background music named "people" to fade in on frame 3, then I need it to fade out on a button click. I've found lots of source code on line ,, but they don't work. Any help would be greatly appreciated. THANKS IN ADVANCE!!! :D
Kambiz
View Replies !
View Related
Sound Fade In-loop-fade Out
i have a music loop in my animation that needs to fade in then loop untell a button is pressed. i've got it to fade in and loop but i don't know how too make it fade out.
on the frame the music starts i have the sounds proportys set to
Effect:fade in
sync:start|loop
is there a whay to do this non dynamicly? if no then:
How do i make my sound have an instance name so i can use the setVolume() thing?
View Replies !
View Related
Fade In And Fade Out Sound Without A Button
I need to do something that has to be easy stupid, but I can't find a thread or tutorial on it with my specific needs.
I want to fade in a sound, then later on fade it out on a specific frame WITHOUT using buttons. It needs to happen automatically on the timeline. I have added sound to buttons with actionscript many times before, but there is no button in this case, when the playhead passes frame 10 I need the sound to start fading in and then loop (at volume=100) until the playhead reaches frame 580 where I need for the sound to start fading its volume back to zero.
Can anyone help me. I even spent HOURS in Barnes and Noble reading the flash mx bible and Moock's book with nothing that attached what I need to a frame event rather than a button press or release event...
Thank you in advance to whomever can help... I know this should have been easy for me to get, but I just don't get it.....
Eric Ling
View Replies !
View Related
MULTIPLE SOUND (fade-in/fade-out)
Hi guys,
I have this problem. I would like to have background track playing on a flash-site. And when you click to load in en external page I would like another track to fade-in to "join" or "add" to the previously existing track with, lets say a little guitar flicks. And of course, fade-out when you change page...
How would I go about to do this?? Anyone??
/Dexner
View Replies !
View Related
MULTIPLE SOUND (fade-in/fade-out)
Hi guys,
I have this problem. I would like to have background track playing on a flash-site. And when you click to load in en external page I would like another track to fade-in to "join" or "add" to the previously existing track with, lets say a little guitar flicks. And of course, fade-out when you change page...
How would I go about to do this?? Anyone??
/Dexner
View Replies !
View Related
Very Stuck On Sound Loop Timing Issues
Hi
Iv made this http://www.bigorangeplanet.com/syntel.swf
when the logo rotates is the start / end of the movie. Were it loops.
My problem is with sound.
i need it to loop in time with the animation. Were as at the moment if you watch this animation for a few minutes the sound will eventualy cut out, there will be a gap with silence, and then it will start again. In the MIDDLE of the Movie. !?
My movie is 720 frames long at 24 frames a second. the sound is on the bottom layer, set to loop twice. On frame 720 in the music layer i have put a blank key frame and "go to and play" frame one. Weather i put this action in a blank key frame on that layer or any other makes no difference.
The sound is running faster or slower than the main animation. What can i do about this ?
This animation with sound will eventualy become an mpeg. When i get the sound sorted that is.....
cheers for any help
wexman
View Replies !
View Related
Load Jpegs In MC Stuck Stuck Stuck
ok i'm sure this is in another thread if someone wants to point me in the right direction i'd appreciate it.
question is.
i have a button that will load a jpeg into a mc. did that.
how do i get the jpeg to center and resize to my mc? mc is 300 x 480......
the site is for an art porfolio and this button/action will be repeated throughout the site
new to FLASH MX & actionscripting and it's driving me over the edge..................
[EDIT/CyanBlue]
Moved to the Flash MX ActionScript forum
Please state what your working environment is and
please post in the right forum
[/EDIT]
View Replies !
View Related
Sound Fade On An Attach.Sound
I have created a music file using the attach sound method on the root level within an MC and have launched it from another frame (_root.movieclip.gotoandplay(2)) and now I want to know how to fade it eventually.
Anyone know??
View Replies !
View Related
Fade In Fade Out Bg Sound
i ,
im trying to get a animation done where i have a bg music being played continously at 100%..the animation has few links
i want the bg music to fade out a bit when a link is clicked so that the event sound which i have inserted in the link animation be audible..
also as the link animation gets animated completely i want the bg music to come back at 100% again
....due to the bg music being played continously the events sound of link animaiton is not audible
help me get it right
any help would be appreciated a example would do a world of good for me to get the concept right
this site has what im actually looking out for
http://www.primecut.net
thanks a lot
babun
View Replies !
View Related
SOUND: Fade In & Fade Out
Hi every one
this my first post
the code below load external sound file "bg.mp3"
the sound will play automatically.
i have a a buuton that load FLV
i want to FADE OUT the sound "bg.mp3" if i loaded the flv.
and fade in if i close the FLV
ActionScript Code:
var musicURL:URLRequest = new URLRequest("bg.mp3");var sndMusic:Sound = new Sound(musicURL);var channel1:SoundChannel;channel1 = sndMusic.play();
Thanks for your help
View Replies !
View Related
Fade In Fade Out Bg Sound
i ,
im trying to get a animation done where i have a bg music being played continously at 100%..the animation has few links
i want the bg music to fade out a bit when a link is clicked so that the event sound which i have inserted in the link animation be audible..
also as the link animation gets animated completely i want the bg music to come back at 100% again
....due to the bg music being played continously the events sound of link animaiton is not audible
help me get it right
any help would be appreciated a example would do a world of good for me to get the concept right
this site has what im actually looking out for
http://www.primecut.net
thanks a lot
babun
View Replies !
View Related
Sound Fade?
In keyframe 1 I have a sound looped 100 times.
In keyframe 2 I have a sound that lasts 10 seconds.
Both are the same volume.
Is there any way to get the sound playing from keyframe 1 to fade all the way down for the 10 seconds that the sound in keyframe 2 is playing??
Thanks for you time!
View Replies !
View Related
Sound Fade
No matter what I try or how I try it I cannot get .mp3 sounds to fade out. They just clip off with no fade at all. Does anyone have a suggestion ?
Thanks
Bern
View Replies !
View Related
Sound Won't Fade Out....please Help
I have an MC that contains the music. I pasted the following code to it
// fade out loop
onClipEvent(enterFrame){
if(startFadeOut){
if(containsMusic.getVolume() >= 0) {
containsMusic.setVolume(containsMusic.getVolume() - 5);
} else {
startFadeOut = false; //stop loop
}
}
}
Does this code go on a different MC just for the fadeout, or it's fine on the "containsMusic" MC?
I have the on/off buttons on another MC and to the "off" button I added the following code
on (release) {
_root.startFadeOut = true;
gotoAndPlay("soundOff");//this is where the "backON" btn is
}
does anybody see why this may not be working?
thanks in advance
View Replies !
View Related
Sound Won't Fade Out....please Help
I have an MC that contains the music. I pasted the following code to it
// fade out loop
onClipEvent(enterFrame){
if(startFadeOut){
if(containsMusic.getVolume() >= 0) {
containsMusic.setVolume(containsMusic.getVolume() - 5);
} else {
startFadeOut = false; //stop loop
}
}
}
Does this code go on a different MC just for the fadeout, or it's fine on the "containsMusic" MC?
I have the on/off buttons on another MC and to the "off" button I added the following code
on (release) {
_root.startFadeOut = true;
gotoAndPlay("soundOff");//this is where the "backON" btn is
}
does anybody see why this may not be working?
thanks in advance
View Replies !
View Related
Fade Down A Sound
Using Flash MX:
My main.swf file contains a BG music track, and I'm loading popups containing audio material into level 1. I want the BG ambience to fade down whenever a movie is loaded into level 1, and fade back up whenever level 1 is empty.
Ideally I want to control this from my main.swf (because I don't want to have to go back and edit the 50+ swfs that load into level 1)
Any ideas?
View Replies !
View Related
Sound Fade?
Does anyone know how to make a sound fade in when a user presses a play button and fade out when they press a stop button? I'm not very good at using the soundObject and am having some trouble figuring this out. Thanks for any help in advance.
View Replies !
View Related
Sound Fade In
i have a code for the fade in and fade out effect, but i dont know how to start the fade in effect?
I have the button code to start it , which is
on (press) {
fadeIn01 = 1;
sound1.start(0, 999);
}
But I want to start the fade in effect when my movie plays and it passes over a frame.
bottom line: How can I get the fade in effect to start when I come to the frame?
View Replies !
View Related
Sound Off With Fade
but with a twist ....
I have a a pile of flv movies that may or may not be playing. When the user releases a specific button I want to fade out the sound of whatever flv happens to be playing. So, I am looking for a universal sound on off button.
Thanks,
sumsum
View Replies !
View Related
Fade In Sound > Fade Out Sound > Go To
Two parts...
Firstly, can someone clarify exactly how to fade in a sound? Bit dumb but that's exactly what I am in Flash. The only code I have so far is...
firstSound = new Sound();
firstSound.attachSound("Airport.mp3");
Secondly, is it possible to fade out sound on releasing a button, then, when the sound has completely faded out, go to where you've linked? I've seen this done in a Shockwave presentation but not just using Flash.
Thx
View Replies !
View Related
Fade Out Sound
I am new to Flash. I put together a project with several scenes. In the first scene there is a soundtrack mp3 file loading. It runs while all scenes play.
The problem is, I want it to fade out at the end of the last scene right before I need a sound effect play. Is this possible? If so, what is the absolute easiest way to do so?
Thanks for your replies.
Craig
View Replies !
View Related
Sound Fade Out
Im trying to make a button which fades sound in and out. Its in a mc and I managed to make it fade in using this AS:
Code:
music = new Sound();
vol = 0;
fade = setInterval(fadeIn, 100);
function fadeIn() {
vol += 3;
music.setVolume(vol);
if (vol>=100) {
clearInterval(fade);
}
}
But when I try on a different frame to fade the sound out I can't work out how to. I'm sure I need to reverse some of the numbers, but I can't work it out. Can someone help? Or tell me if im doing it completley wrong.
Thanks. Tim
View Replies !
View Related
Fade Sound In And Out Using AS3?
Hi,
I have made an animation of a garden and i want the garden sound to play until the user clicks a certain tomato which starts a sequence to the next scene - then i want to sound to fade out to mute.
sooo... i want to fade in a sound when the animation starts then fade out when the user click a button.
i attach a .fla of my rough set up... the isnt a sound on there as my garden sound made the .fla to big to upload.
i also found this code on here but don't really know how to apply it or if it is the right thing:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var myTransform=SoundMixer.soundTransform;
var myTween:Tween;
myButton.addEventListener(MouseEvent.CLICK, toggleMute);
function toggleMute(evt) {
if (SoundMixer.soundTransform.volume==1) {
myTween=new Tween(myTransform, "volume", None.easeNone, 1, 0, 3, true);
myTween.addEventListener(TweenEvent.MOTION_CHANGE, changeVolume);
} else {
myTween.stop();
myTransform.volume=1;
SoundMixer.soundTransform=myTransform;
}
}
function changeVolume(evt) {
SoundMixer.soundTransform=myTransform;
}
thank you very much for any help!
Kira
View Replies !
View Related
Sound Fade Out?
Can anyone tell me how I would fade out a sound that was playing using actionscript? I have a short mp3 background sound that I need to loop throughout the movie, and at a certain point, fade out. Anyone? I am not familiar with actionscript sound, I embedded the mp3 in the FLA since it was so little.
View Replies !
View Related
Sound Fade
hi, i have an swf file loaded externally (a gallery) and was wondering if its possible to get the sound to fade on that file when the user wants to leave it to go to a different section and if the music could loop up until this point would be a nice touch also
any help would be great
View Replies !
View Related
Sound Fade Out - How About This One?
Hello
I am completing a small project and have used a soundtrack in the piece.
I am aware that I can fade a sound out and have tried this and it works fine.
However, I wondered if as the timeline plays out and reaches a certain frame say for arguments sake Frame 200 it then fades the background sound out and by Frame 250 it has stopped playing.
I then hoped to have a Button allowing the User to play the piece again from the beginning and thus the soundtrack again.
Is this possible and if so how?
Many thanks in advance for any words of wisdom.
PixelPilot
View Replies !
View Related
|