ActionScript 3.0 :: Fading Sound Doesn't Work

Jan 9, 2012

I have this problem when I try to fade in sound with the function below. It just doesn't work and I can't figure out where the problem is. I would like to fade in a looping sound but nothing happens.

this is used to play a sound via events

Code:
dispatchEvent(new CustomEventSound(CustomEventSound.PLAY_SOUND, Main.SOUND_AMBIENT, false, true, false, 999999, 0, 0, setSoundVolume));

this is the function to play a sound. the stop-function is almost identical to this one.

Code:

public function playSound(soundName:String, isSoundTrack:Boolean = false, fadeIn:Boolean = false, fadeOut:Boolean = false,
loops:int = 1, offset:Number = 0, volume:Number = 1):void {

[Code].....

View 7 Replies


Similar Posts:


ActionScript 2.0 :: Fading Grid Tutorial Doesn't Work

Mar 16, 2005

I tried the fading grid tutorial but it doesn't work.Url...

View 1 Replies

ActionScript 3.0 :: Flash Fading Sound Does Not Work

Jan 9, 2012

When I try to fade in sound with the function below. It just doesn't work and I can't figure out where the problem is. I would like to fade in a looping sound but nothing happens. This is used to play a sound via events
Code:
dispatchEvent(new CustomEventSound(CustomEventSound.PLAY_SOUND, Main.SOUND_AMBIENT, false, true, false, 999999, 0, 0, setSoundVolume));

This is the function to play a sound. the stop-function is almost identical to this one.
Code:
public function playSound(soundName:String, isSoundTrack:Boolean = false, fadeIn:Boolean = false, fadeOut:Boolean = false,
loops:int = 1, offset:Number = 0, volume:Number = 1):void {
if (fadeIn) {
tempSoundTransform.volume = 0;
[Code] .....

View 5 Replies

ActionScript 1/2 :: Sound Control Adding Text Into The Linkage Field But Still Sound Doesn't Work

Jan 21, 2010

How to import sound with AS? Cuz i have tried it and my sound just wount play. Can you explain me where my sound should be and what is the as code for importing cuz i use

mysound = new Sound();
mysound.attachSound("SoundOn");
mysound.start();

and this SoundON from where i get it, i try to add linkage to the sound file but in CS4 i cant find the option;. I do it from the library, adding text into the linkage field but still my sound doesn't want to play?

View 15 Replies

ActionScript 3.0 :: Sound Channel - Sound Doesn't Work?

Dec 5, 2010

The code seems OK but I can't hear the sound. I have it in the fla/swf and exported etc... I suppose something in this code is wrong. Haven't coded for ages - bit rusty I'm afraid.

[Code].....

View 3 Replies

ActionScript 1/2 :: Fading In An MC Works, Fading Out Doesn't?

Apr 7, 2009

I can't work out why - but when I try to fade out some text (by calling fadeoutSecondText), the text fades out, and then immediately fades back in. Fading in and out struggle against each other, resulting in rapidly flashing text!

[Code]...

View 7 Replies

Actionscript 3 :: Flash Sound Doesn't Work In Most Browsers

Mar 1, 2011

I'm trying to play sound from url.

var s : Sound = new Sound();
s.load(new URLRequest("http://85.21.236.228:8000"));
s.play();

It's OK in Opera browser. But in IE, Chrome, Firefox there's no any sound.

View 2 Replies

ActionScript 3.0 :: Fade In A Looping Sound Doesn't Work

Jan 9, 2012

I would like to fade in a looping sound but nothing happens. this is used to play a sound via events.Code:dispatchEvent(new CustomEventSound(CustomEventSound.PLAY_SOUND, Main.SOUND_AMBIENT, false, true, false, 999999, 0, 0, setSoundVolume));this is the function to play a sound. the stop-function is almost identical to this one.[code]

View 2 Replies

ActionScript 3.0 :: Fading Sound In And Out

Sep 2, 2008

I am putting a flash website together. It is a picture of a group of people standing outside and at random intervals a storm will fade in and out giving dynamic rain/wind/thunder sounds and lightning. The only problem I have is fading the sound out. The sound fades in fine with the movie clip but when the movie clip disappears the sound continue.Here is the code for that part of the flash. The "randomness" of the storm is set to very high probability on purpose for debugging reasons.

View 1 Replies

ActionScript 3.0 :: Fading Sound With GTween?

Sep 9, 2009

I'm having an issue with fading sounds with GTween, can anyone let me know what I'm doing wrong here? Thanks in advance.

Code:

public function playBackgroundSound ( s : Sound ) : void
{
bgst = new SoundTransform( __volume );

[code]....

View 1 Replies

ActionScript 2.0 :: Fading Sound When Button Pressed

Jul 27, 2005

I am looking for a way to play music when the movie loads, but when a button is pressed, the sound will fade to 0, then when the button is clicked again, it will fade to 100. Here is a link to the file I've been working on...

View 3 Replies

ActionScript 2.0 :: Fading Out A Sound Object After 2 Loops

Dec 10, 2006

I'm trying to figure out how I can fade out a sound object after it has looped twice. Right now the sound fades 5 seconds before the end of the first loop (since the fade code is based on the duration of the sound clip).Seems like there needs to be a way to count when the duration has been reached two times and then the fade code is executed. Note: the linkage identifier of the sound clip is "mainPageLoop".[code]...

View 1 Replies

ActionScript 2.0 :: Sound Fading In Function With Prototype And SetInterval

Aug 4, 2005

I'm trying to create a function that will help me fade in sounds with the help of setInterval. I'm almost there! Here is the code so far:

// Begin
melodyhalf1 = new Sound("melodyhalf1_mc");
melodyhalf1.attachSound("melodyhalf1");
melodyhalf1.start(0, 99);

[Code]....

I placed a comment in the Sound.prototype.fadeIn to test if it was being called, as well as to see if the melodyhalf1 variable (object?) was being passed.

The results are that the fadeIn function *is* being called, but the trace(this) comes back with 'undefined'.

View 4 Replies

ActionScript 1/2 :: Fading Background Music - Video Sound Also Turned Off

Sep 20, 2010

I have a flash file with a background music sound object, and I have a video player at a particular section on the timeline. When the playback head goes to the section with the video player, I would like the background music to fade, but of course, I need the volume to be up for the video. The code I have works find to fade the audio, but the problem is that the video's sound also turns off.

This is the code at the beginning of the timeline:
_global.volumeVar = 40; //Stores the current volume.
bgSound = new Sound(this); //This block works finebgSound.attachSound("music");bgSound.start(0,99);
bgSound.setVolume(0);
[Code] .....

Further down the time line, in the video player section, there this code, which works to fade the sound, but seems to turn off the video, too:
nInterval = setInterval(fadeOutSound, _global.volumeVar);

View 5 Replies

ActionScript 2.0 :: Dynamic Masks - Trail Doesn't Resize And The Mask Still Doesn't Work

Oct 16, 2009

I decided to try to use setInterval for myanimation, which is just a mouse trail.However, I'm trying to get teh mouse trail to be a dynamic mask.In my previous swf this was achieved by using a holder mc with the animation inside and then using this as the mask. But this time I just canpt seem to hit on the right way to get it to work. The code I am using for the mouse trail is:

Code:
var i:Number = 0;
var myInt:Number;
var t:MovieClip;[code].....

in the function, but now the trail doesn't resize and the mask still doesn't work.

View 1 Replies

ActionScript 3.0 :: Width Doesn't Work - How To Make It Work

Apr 21, 2010

I have a button object that I need to scale to align with the variable width of an array of images.However, when I set the width in code, the button does not actually become that width. Tracing out the width gives me the correct value, but on screen.. it's off.

I've proved it to myself by scaling the same button object manually in the properties pane and visually comparing. Both of the buttons below have a width of 410.

Code:
navigatorDown_btn.width = 410;
navigatorDown_btn.x = (stage.stageWidth/2)-(navigatorDown_btn.width/2);
trace(navigatorDown_btn.width); // output: 410

View 4 Replies

ActionScript 3.0 :: Fading Out And Fading In 2 Flash Movie File

Mar 30, 2012

I'm trying to play 2 external flash movies. its already running ok but i need the scene to be somewhat to gradually become transparent so that the timebased scene2 will comeout to of the screen.

Here is the script of it:

var myLoader:Loader = new Loader();
var url:URLRequest = new URLRequest("scene2.swf");
myLoader.load(url);
addChild(myLoader);

[Code]....

View 2 Replies

ActionScript 2.0 :: [f5]fading Grid Not Fading?

Oct 11, 2003

when i test the movie all i see is a large grey box (border color) with a medium white box (box color) in the bottom right.when i edit the border and lose the grey box but leave its line borders then i get the image with the white box in the bottom right. i've got an image: instance named 'image', a box: instance named 'box' and a border: instance named 'border' and pasted in the actionscript in

View 5 Replies

ActionScript 2.0 :: Fading Grid Not Fading

Oct 11, 2003

i've done the Fading Grid tutorial that Voetsjoeba wrote but i seem to be de-railing somewhere when i test the movie all i see is a large grey box (border color) with a medium white box (box color) in the bottom right.when i edit the border and lose the grey box but leave its line borders then i get the image with the white box in the bottom right. i've got an image: instance named 'image', a box: instance named 'box' and a border: instance named 'border' and pasted in the actionscript in place but it still hangs.

View 5 Replies

Flash Sound Doesn't Play

Dec 16, 2009

I have sound playing in my flash file. My index file is a html file which calls the flash file, and when i run the html file, the sound doesn't play. Does anyone know how I can rectify this?

View 5 Replies

ActionScript 2.0 :: Adding Sound - Doesn't Come Out

Jan 12, 2010

I am doing a game such that when the score++, there is a certain sound. And when the score--, there is another sound. Cause I'm not really sure if this is the correct way. So I have two sound files, linkage "hit" and "miss" The actionscript goes like this on my movie clip:

[Code].....

View 2 Replies

ActionScript 3.0 :: FLV Sound Doesn't Stop?

Dec 22, 2008

I have a swf with 4 scenes, in each scene there's a FLVvideo. I have buttons going to prevScene and nextScene and when goback and forward I hear the sound of another FLV,?the code for the buttons (for example) is

button1.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {

[code].....

View 3 Replies

Sound Playback Doesn't Stop?

Oct 14, 2009

I'm experiencing difficulty when playing sound files. When I start the playback of the timelime using the enter/return button everything plays as it should. When I press it again to stop, the visuals stop but the sound file in the timeline just keeps playing until it reaches the end of the track- even if I have cut some out of the timeline. I used to use mx 2004 and never had the problem. Note: I am using this in college not on a personal computer.

View 1 Replies

IDE :: Mediacontroller Sound Doesn't Unload?

Nov 11, 2006

i am working on a slide presentation, with audio commentary. There are several swf's each with a separate mp3, which i am playing with media controller. I am loading each swf file on a base swf. Problem is the sound of a particular swf doesn't stop even when it's swf is unloaded. So when the next file is loaded, two simultaneous audio tracks can be heard.

i tried putting stopallsounds on the button which loads the next swf, but it doesn't work either.

View 1 Replies

ActionScript 3.0 :: Sound Doesn't Stop SOMETIMES?

Jul 14, 2010

I have movie clip buttons with a dynamic sound withing a slide show. Slide show consists of 3 movie clips connecting on frames 1, 300 and 900. The movie clip buttons with sound over are within the connecting movie clips. My problem is that although the sound and buttons work fine most of the time, sometimes, particularly if I mouse over the button wile it's transitioning on one of the connecting frames (300, 900), the sound doesn't stop... I'm sure I'm missing something in the Action Script?? Here's the script I'm using for the buttons:

stop();
import flash.display.MovieClip;
import flash.events.MouseEvent;

[code].....

View 3 Replies

Swf Into Fla Doesn't Work?

Jul 23, 2009

I have a swf that is pretty complicated, you can interact with the page and go to different keyframes and it stops and/or starts depending on buttons, but I want to put it in a fla or something so I can put other swfs next to it and build it up and put several of them together as one.

I don't care about making it too complicated, I just want one interactive swf to go to the next compiled swf when that movie ends, but when I try importing it or loading it it just runs straight through without stopping or paying any attention to the scripting.

View 16 Replies

Sound Doesn't Sync Properly In 24fps

Dec 12, 2009

im having a problem with sound in the animation. I noticed that sound doesnt sync properly in 24 fps.The sound actually does sync properly when the sound is an event, but when the sound is set to stream, it actually doesnt play properly, and i need my animation to have streaming sound especially for the internet. So for example, if i added a sound effect to start on frame 30, when i play the animation in swf, the sound effect actually starts playing at the wrong frame, in this case, the sound plays before frame 30. So in this case, the sound plays too early, and therefore the sound effect doesnt match with the animation itself. I wanted my animation to be at 24 fps, so i assume theres something that i have to do to get sound to sync properly with the animation at 24 fps.

View 2 Replies

Flash 9 :: Sound Sometimes Doesn't Compress To Mp3 Properly

Aug 7, 2008

The keyword is "sometimes".

I recompiled a Flash 8 project in Flash CS3 recently and noticed that some of the sound effects sounded like a painful chippy mess. It sounded like the mp3 bitrate was at the lowest Flash outputs (16kbps). I compiled again, and all the problems went away. Then I compiled again and different sounds went chippy!

Fine, whatever. Maybe it's a glitch between project versions.

This week I built a project from the ground up in Flash CS3 with AS 3.0 . The chippy compression is still there and happens most of the time. Both my global and local compression settings for sound clips are mp3, 160kbps, Stereo.

View 8 Replies

ActionScript 3.0 :: Sound Doesn't Play Correctly?

Oct 23, 2011

I have a button that when clicked, it's supposed to play a sound. Now, the sound does play when it's clicked, but it seems to be offset (meaning, it starts a few seconds later in the sound). As a result, only half of the sound plays.I have two buttons that do this, and I'm not sure what caused them to do so.I've never had this problem before, so I'm clueless where to go to fix it. I tried verifying the integrity of the sound, and it's normal. When I check it's proporties from the library, and "Test" the sound, it plays just fine, with no offset or anything.Here is the code I have for the button that causes this behavior:

Code:
var soundEffect_Button = new SND_EFFECT();
soundEffect_Button_instance_manual.addEventListener(MouseEvent.MOUSE_DOWN,SndEffectDown);
//Make the callback[code].........

View 4 Replies

ActionScript 3.0 :: Sound Tutorial Doesn't Appear To Be Preloading

Jun 17, 2010

I just tried this code from this url and it didn't preload my sound: [URL] is there more to it that I need to know? here is the link to the project. You can see that the sound takes several seconds, but the animation already plays: [URL]

View 9 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved