Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Pause An Event Sound


Does anyone know of a way to pause and restart an event sound or preload a stream sound to improve it's quality for flash 5? I'm working on an exe on CD, and my problem is that the quality of a stream sound sucks. The event sounds much better and would like to use it, but can't get it to work with my pause button. The sound file started as an MP3(300kb)and I tried both letting Flash recompressing it and not letting it, neither improved. I end up with a lot of static. Any help would really be appreciated!




FlashKit > Flash Help > Flash ActionScript
Posted on: 04-05-2002, 01:17 PM


View Complete Forum Thread with Replies

Sponsored Links:

Pause An Event Sound?
Does anyone know of a way to pause and restart an event sound or preload a stream sound to improve it's quality for flash 5? I'm working on an exe on CD, and my problem is that the quality of a stream sound sucks. The event sounds much better and would like to use it, but can't get it to work with my pause button. The sound file started as an MP3(300kb)and I tried both letting Flash recompressing it and not letting it, neither improved. I end up with a lot of static. Any help would really be appreciated!

View Replies !    View Related
Mute Sound/Pause Sound Button HELP
I made a button (Flash CS3, AS2 file) and want it to mute a sound called 'GuitarLoop' which I've imported and have on 'Layer 3. My button's on 'Layer 3' and I need it to mute 'GuitarLoop' when pressed.

I searched on google but didn't really find anything, soooo.... Do you know how I could fill in the blanks?

on (release) {
not_set_yet.stop()
}

I'm guessing here but...

on (release) {
GuitarLoop.stop();
}

or


on (release) {
'GuitarLoop'.stop("Scene 3", "Layer 3", 1)
}

is it something like that?


also this is a looped sound.

View Replies !    View Related
Pause Sound
How can I pause a sound or play a sound not from the start but from anywhere else?
I've seen that before, but couldn't figure how it was done.

Looking forward for any answers.

View Replies !    View Related
Sound Pause
Hi,
am loading a MP3 sound on a fly in mx & wanna give a play/pause functionality to it, am using the following code where soundObj is the sound object. This is not working somehow. Can somebody tell me the solution.

if (soundPlaying != true) {
pausedPos = soundObj.position
soundPlaying = true
soundObj.stop()
} else if(soundPlaying){
soundObj.start(1440,1)
soundPlaying = false;
}


thanks in adv

View Replies !    View Related
Sound Pause On Pop-up
I wanted to know can someone show me how to pause music in a window when a pop-up is opened from it and then have the music come back on when the pop-up is closed.

View Replies !    View Related
Pause Sound Help
Hello - I have 5 different buttons that call for 5 different music swf's to load and play when selected. I want to put a pause and play button so the viewer can pause the selected song then start it again where it left off. How would I go about putting a pause and play that represents the selected song that is playing. I guess I am asking how to target the selected song when it could be 1 of 5 different songs playing?

View Replies !    View Related
Hot To Pause A Sound?
i've got scrolling text with accompanying voiceover. i want to pause the text and the voiceover and then unpause it.

it works fine the first time i pause it, but after that when i press pause the voiceover seems to just go silent and carry on playing til i unpause and then its a few lines ahead of the scrolling text.

the voiceover is initiated like this:

1 s = new Sound();
2 s.attachSound("voiceover");
3 i=1;
4 function timeme (){
5 now = new Date();
6 var hours = now.getHours();
7 var minutes = now.getMinutes();
8 var seconds = now.getSeconds();
9 _root["nowtime"+i] = (Number(hours)*3600)+(Number(minutes)*60)+seconds;
10 _root.newstarttime = _root["nowtime"+i] - _root.nowtime1;
11 i++;
12 }
13 s.start();
14 timeme();

the pause button:

1 on(press){
2 s.stop();
3 timeme();
4 tellTarget ("voiceover01") {
5 stop();
6 }
7 }

("voiceover01" is the scrolling text symbol)

and the unpause button:

1 on(press){
2 s.stop();
3 s.start(_root.newstarttime);
4 tellTarget ("voiceover01") {
5 play();
6 }
7 }

please help! the client is getting restless!

lars

View Replies !    View Related
Pause Sound
Hello

i made a layer that consists of two sounds, for example from frame 1-100 sound 1 and from 101 - 200 sound 2, and i have a Pause button that pauses the animation, i'd like to make this Pause button pauses the sounds as well when pressed, and when the user presses play the sound continues from the position it was paused at.

please help

thanks

View Replies !    View Related
How To Pause A Sound?
i've got scrolling text with accompanying voiceover. i want to pause the text and the voiceover and then unpause it.

it works fine the first time i pause it, but after that when i press pause the voiceover seems to just go silent and carry on playing til i unpause and then its a few lines ahead of the scrolling text.

the voiceover is initiated like this:

1 s = new Sound();
2 s.attachSound("voiceover");
3 i=1;
4 function timeme (){
5 now = new Date();
6 var hours = now.getHours();
7 var minutes = now.getMinutes();
8 var seconds = now.getSeconds();
9 _root["nowtime"+i] = (Number(hours)*3600)+(Number(minutes)*60)+seconds;
10 _root.newstarttime = _root["nowtime"+i] - _root.nowtime1;
11 i++;
12 }
13 s.start();
14 timeme();

the pause button:

1 on(press){
2 s.stop();
3 timeme();
4 tellTarget ("voiceover01") {
5 stop();
6 }
7 }

("voiceover01" is the scrolling text symbol)

and the unpause button:

1 on(press){
2 s.stop();
3 s.start(_root.newstarttime);
4 tellTarget ("voiceover01") {
5 play();
6 }
7 }

please help! the client is getting restless!

lars

View Replies !    View Related
Sound Pause?
Hello all. I found the last advice you guys gave me helpful so here I am again.

I have music in my timeline on its own layer. I'm wondering if it is possibe to pause that music, then play it again from where it left off using Actionscript.

If anybody knows please tell me.


Thank-you to whoever helps me.

-Ty





























Edited: 12/02/2006 at 10:29:31 PM by Ty_1000

View Replies !    View Related
How To Pause Sound...
I figured out how to stop and stop it with a button, but pausing is another thing

View Replies !    View Related
Pause A Sound
Funny thing the last questions on the forum is about sounds.
I have a sound issue as well.
Importing the sound - cool.
Start/stop the sound - cool.
but how can I pause the sound so when I press play it will continue from where it stoped!!!
I've been looking books,web-tutorials and flash help and I couldn't find it anywhere.
Anybody knows???
I would appreciate your helpl
Thank you

View Replies !    View Related
How To Pause Sound
i have tried to pause a sound so that once you click play it starts from where you paused it. i just cant seem to do it please can some one tell me how this is done i would be really greatful.

View Replies !    View Related
Pause Sound?
i am looking for help on creating a pause button for my swf shell that references external mp3 files...........the player works good it has previous,next,play and stop button. it's from a tutorial i got but it didn't have a pause button.... this is part of the structure.....if anyone could explain it to me i would appreciate it
teddy

actions layer:

stop();
stopAllSounds();
track1 = new Sound();
track1.loadSound("Autoharp.mp3", true);
track1.onSoundComplete = function() {
gotoAndStop(10);
};

play button:

on (release) {
stopAllSounds();
track1 = new Sound();
track1.loadSound("Autoharp.mp3", true);
}

View Replies !    View Related
Pause Sound
Hi,
am loading a MP3 sound on a fly in mx & wanna give a play/pause functionality to it, am using the following code where soundObj is the sound object. This is not working somehow. Can somebody tell me the solution.

if (soundPlaying != true) {
pausedPos = soundObj.position
soundPlaying = true
soundObj.stop()
} else if(soundPlaying){
soundObj.start(1440,1)
soundPlaying = false;
}


thanks in adv

View Replies !    View Related
Pause Sound In Flash 4?
Is there a way in flash 4 to pause audio playing back from a movie clip?

I tried stopping the clip and then sending it to the frame it was last on but the sound does not start up again. The clip continues to play, but no sound.

Any thoughts on how to pause sound so it starts up again where it left off?

View Replies !    View Related
Sound Control [pause] ?
Howdy. I am controlling sound via AS - I can stop, play, etc. I want to pause though. being as though the sound does not process on the actual timelineor such - I cannot find a way to pause the sound and resume on the same time point when pressing play again. Any ideas? Thanks!

View Replies !    View Related
How Do I Pause, Or Stop A Sound.
I made the 2 buttons, but I just can't seem to find out the right action script to Start/stop the song I wish to play on my website. I know how to add the sound, and make it play.

If you know how to stop a song, or pause it, and make it play again after you pause it, please tell me!

Thankyou

---------------------------
A Dragon's Ball.

View Replies !    View Related
Sound = Motion Pause
I have a basketball bounce off the floor and then go through a hoop. The motion is very smooth. Then I added a sound when it hits the floor, and now the motion pauses right before, or sometimes after, the ball hits the floor. I got the sound from the 'common library', I think it was called 'brick drops'. Is it normal for a sound to cause motion pauses? Is there any way to prevent this?

View Replies !    View Related
Pause Sound Button
Is there anyway i can pause a sound im MX? I can get the sound to stop but once play is clicked it restarts the loop.
Cheerz 2all dat help

View Replies !    View Related
Pause/start Sound
Hi,

If I want to make a movie pause/start at the click of a button, i use this.start(); and this.stop(); and it works fine. However, the movie has a narration, so if the movie pauses, I want the sound to pause also. When the movie unpauses, I want the sound to pick up from where it left off. Is there a way to to this?

Thanks,
Tim

View Replies !    View Related
Pause/start Sound
Hi,

If I want to make a movie pause/start at the click of a button, i use this.start(); and this.stop(); and it works fine. However, the movie has a narration, so if the movie pauses, I want the sound to pause also. When the movie unpauses, I want the sound to pick up from where it left off. Is there a way to to this?

Thanks,
Tim

View Replies !    View Related
How To Pause A Sound Then Resume?
Hi all

Does anyone know a good method of 'pausing' a timeline, then resuming, without keyframes? What I basically need to do is to pause a sound, then continue on a given command. I can't use keyframes because if you interrupt sound with a keyframe, any sounds thereafter start from their beginning. How would I stop mid-sound, then continue where it paused, if this is possible at all?

Perhaps there's an AS way to do this- linking sound for actionscript is something I'm not too well up on at the mo.

Cheers in advance.

View Replies !    View Related
Help Sound Volume And Pause
does somebody know how to set de volume to a sound and also to put pause to a sound?

i will thank you a lot

View Replies !    View Related
Help Sound Volume And Pause
help! sound volume and pause
does somebody know how to set de volume to a sound and also to put pause to a sound?

i will thank you a lot

View Replies !    View Related
Sound Animation Pause
Hey everyone,
has anyone noticed how if you add sound to animation, the animation itself can sometimes pause or stutter. Anyone know how to get around this?
Thank you

View Replies !    View Related
Sound Pause Wanted-how?
Hi
I want to string together some single letter sounds to pronounce a word but the sounds are all coming in at once. How can I introduce a pausing factor?
I tried using mp3's instead of wav's- didnt work,
I tried having one sound when using 'on(press)' and the rest in 'on(release)-didnt work,
I tried lengthening the wave files to contain a silent portion at the start and end of the files, -didnt work
(I think onsoundcomplete ignores silences and only works on actual noise not the file length)
which blows my next idea of creating a blank wav file and inserting that in between,
Anyone have any ideas or functions that can add a pause/delay like in C++?. I dont want to introduce blank movie clips with a number of frames if i can avoid it.
thx people. My code is below.

///----
on(release)
{
firstLetter ();
function firstLetter()
{
audio1= new Sound();
audio1.attachSound("kuh.wav");
audio1.start(0,1);
audio1.onSoundComplete = secondLetter();
}
function secondLetter()
{
trace(" 1st letter completed");
audio2 = new Sound();
audio2.attachSound("a.wav");
audio2.start(0,1);
audio2.onSoundComplete = thirdLetter();
}
function thirdLetter()
{
trace(" 2nd letter completed");
audio3 = new Sound();
audio3.attachSound("nuh.wav");
audio3.start(0,1);
}
}
///---

shaf

View Replies !    View Related
Sound Loop Pause
Hi, I am trying to create a simple banner for my site. It is just an image, and a sound loop.

The problem is that no matter how large, or small the sound loop is, there is always a pause between the start and end of the loop. I must have tried over 30 mp3's and wavs, and no luck.

Please help! Thank you!

View Replies !    View Related
How To Pause And Play A Sound?
I'm running a movie with many small sounds on a main timeline and during that time I whant (using a button) pause the sound.
With the same button play it again, without stop the main movie.
It's possible?
Thank you.

View Replies !    View Related
Brief Pause In Sound Loop
I have inserted a sound loop in several ways in flash, but everytime it hits the end of the track there is a brief delay before it loops again, maybe a quarter of a second, but still enough to be noticeable. How do I fix this?

-Thanks

View Replies !    View Related
[F8] Pause All But Sound Streams?
I have quite a few pauses for visual pauses, so the images would match the sound. Now, as a result, they are pausing the sound too.

Is there a way to get something like this to pause everything BUT the sound streams?

pause_seconds=3;

stop();
thetime=getTimer()+pause_seconds*1000;
while (getTimer() < thetime) { }
play();

View Replies !    View Related
Pause Sound On New Window
hey im using the javascript popup window inside flash. so when i click on my button in flash it pops up a new window in the browser with my content. ive also got a song playing in my main flash site. is there a way to pause the song from the main flash site when the user clicks on the button to open the new window? i dunno if its possible but what about having the song coninue playing when the user closes that popup window? thanks guys

View Replies !    View Related
How Do I Pause And Play Sound?
I've been trying to play and pause a sound file and cannot get it to work properly. Here is the .as file I've been working on.

import flash.display.*;
import flash.media.*;
import flash.net.*;
import flash.events.*;

public class PlayPause extends Sprite{

private var mSound:Sound;
private var mChannel:SoundChannel;
private var playpauseBtn:Sprite;
private var mPlaying:Boolean = false;
private var mPosition:int;

public function PlayPause(){

var mRequest:URLRequest = new URLRequest("Lesson1/Lesson1.mp3");
mSound = new Sound();
mSound.load(mRequest);
mChannel = mSound.play();
mPlaying = true;
playpauseBtn = new Sprite();
addChild(playpauseBtn);
playpauseBtn.graphics.beginFill(0x993300);
playpauseBtn.graphics.drawRoundRect(0,0,30,15,10,1 0);
playpauseBtn.graphics.endFill();
playpauseBtn.addEventListener(MouseEvent.MOUSE_UP, onPlayPause);
}

public function onPlayPause(e:MouseEvent):void{
if(mPlaying){
mPosition = mChannel.position;
mChannel.stop();
}
else{
mChannel = mSound.play(mPosition);
}
mPlaying = !mPlaying;
}


}

For some reason, when movieclip is clicked it stops, but when you click it again, it plays but does not retain the position of where it left off, the button works more like a mute button.

Any suggestions????

View Replies !    View Related
To Pause Playing Sound
hi someone help me in this thing

i have two btns which on click will play two songs
if i press btn1 btn1 song will play and when pause it will pause
and if i press btn2 then btn1 will pause and btn2 will play

thanks

View Replies !    View Related
Play Pause Sound.
How do i play and pause the sound from the same position using Sound.duration and Sound.position methods.
I am attaching a sound and I have two buttons to play and pause the sound. One main thing is that after pausing, the sound should start from the same position.
Plz help.
Thanks in advance.

View Replies !    View Related
Help With Some Sound Play/Pause
I have two buttons one play and one pause...

I cant just type stop or i get an error
or type play...

What do i have to do to make it work...

Thanks Ya all...

I'm kinda new at this...

View Replies !    View Related
Sound Pause And Resume
Built an audio pause/resume button. The idea is that you hit the button once and it will pause sound. Hit it again and the sound will resume right where you left off. Problem is that sometimes the button works while at other times you'll hit it and start up another instance of the same audio track so that you'll be hearing the sound doubled but half a second off. It's variable sometimes it works, sometimes not. Hoping someone can tell me what's going on here.

The specifics: I have 37 slides, each of which is accompanied by a sound bite. The sound was imported into Flash than linked and exported for ActionScript. On each slide, the audio is called by:
stop();
mySound=new Sound(this);
mySound.attachSound("25");
mySound.onSoundcomplete=function()
{
nextFrame();
};
mySound.start(0,1);

The pause button has the following ActionScript attached to it:
on(release){
if(!paused){
soundPosition=mySound.postion/1000
mySound.stop();
paused=true;
}else{
mysound.start(soundPosition,true);
paused=false;
}
}

View Replies !    View Related
Sound Class Pause
Hi i have a flash presentation, which has a pause and play button.

the pause button pauses my movie fine, except i have voice sound as a sound class, the sound starts to play, but i can not get it to pause or stop

any ideas what i need to do?
i have the following code







Attach Code

**movie keyframe**

my_sound = new Sound();
my_sound.attachSound("newWelcome");
my_sound.start(0,1000);
gotoAndStop("stop");

**pause button keyframe**

stop();

var my_sound:Sound = new Sound();
my_sound.attachSound("newWelcome");

btnHalt.onRelease = function() {
my_sound.stop();
}

























Edited: 07/28/2007 at 02:07:51 AM by JohnGree

View Replies !    View Related
Pause Sound Duration
Here it is my duration function, play funtion and pause funcion
the problem is i can't find a way to stop the timer of the duration
the text field is called t1.

Thank you


this.onEnterFrame = function() {
t1 = int(sndObject.duration/1000/60);
t1 = t1+" : "+int((sndObject.duration/1000-(t1*60)));
sndObjectf = int((sndObject.duration-sndObject.position)/1000/60);
elapsed_sec = int((((sndObject.duration-sndObject.position)/1000/60)-sndObjectf)*60);
if (elapsed_sec<10) {
elapsed_sec = "0"+elapsed_sec;
}
if (sndObjectf<10) {
sndObjectf = "0"+sndObjectf;
}
if (_root.stpd) {
elapsed = _root.t1;
} else {
elapsed = sndObjectf+" : "+elapsed_sec;}
//mo=sndObject.position/1000
//elapsed =
vol = sndObject.getVolume()+" %";
dur = sndObject.duration;
pos = sndObject.position;
per = (pos/dur)*100;
m = (pos/dur)*100;
bar._width = (m*xx)/100;
drag._x = _root.bar._width+_root.bar._x;
//drag._y = 136;
if (stpd) {
xx = 0;
} else {
xx = orginal_width;
}}
// function keys

function playSong()
{
if (pausePos == 0)
{
sndObject.setVolume(songVolume);
sndObject.loadSound(file, true);
loadProgressInt = setInterval(loadProgress, 50);
} // end if
sndObject.start(pausePos);
playProgressInt = setInterval(playProgress, 50);
pauseBut._visible = true
playBut._visible = false;
gotoAndPlay("play");
dur = sndObject.duration;
} // End of the function



function pauseSong(p)
{
if (!p)
{
pausePos = sndObject.position / 1000;
}
else
{
pausePos = p;

} // end else if
sndObject.stop();
pauseBut._visible = false;
playBut._visible = true;
clearInterval(playProgressInt);
gotoAndPlay("pause");
} // End of the function

View Replies !    View Related
Sound Pause & Play
<Also posted in Flash forums. My development was completely in AS3>

After many hours of trying to figure out where my bug was when trying to jump into a particular location of an audio file I've discovered the following:

In Flash Version 9,0,124,0

MP3 File Format
*less than 64 bit sample rate(stereo & mono)
*64 bit stereo(stereo)

With those MP3 file formats, calling Sound.play with a position greater than 50% of the reported length of the audio file will not work. The file will not play from that position. Even if you set the position prior to the halfway point, the channel won't report the correct current position nor fire a SOUND_COMPLETE event.

The length value is reporting the correct duration of the MP3 file for these formats.

You cannot give the user the ability to "jump" anywhere into the sound file if you use these formats. These formats work properly but I haven't tested any other format higher than 128 bit.

These work:
64 bit (mono)
128 bit (mono & stereo)

Hope this helps.

Happy coding.

View Replies !    View Related
Pause Attached Sound
How should i go about pause and attached sound with AS

View Replies !    View Related
Movie And Sound Pause
I can't figure out how to the audio in my flash file to start at the same place I stop it at. I got my movie to start and stop with 2 buttons like this:
>>button 1
on (release) {
stop ();
stopAllSounds ();
}
>>to stop and button 2:
on (release) {
play ();
}
>>to play

these work great for stopping both the audio and the movie BUT you'll notice that there is no line to restart the audio. How can I do this?

View Replies !    View Related
How Do Make Sound Pause With The Movie?
ive seen in flash anis that wen u pause the ani, by right clicking and unchecking play, the sound that is playing stops aswell, wot do you do to make it do that?
thanks in advance

View Replies !    View Related
Pause/Play With Streaming Sound
I am using streaming sound to coordinate with my animation (it is a voice narration explaining what is happening in the animation at that moment).

In testing, I created a pause and play button. One stops the movie. The other tells it to play. But when it starts playing again after I haved stopped it during a streaming sound, it does not pick up where the sound had stopped. Instead, it starts playing the next streaming sound way ahead in the movie. Bizarre. I am using MX of course.

Does anyone know a solution for this?

View Replies !    View Related
Sound And Video Sync Pause
hi guys!

i tried doing the pause sound thingy using the tutorial, sometimes it works, sometimes it sound seems to be playing in mute mode when i hit the "pause" button cos when i hit "unpause" the song starts from elsewhere.. strange.. anybody?

another qns, in a particular frame in flash, how do you get the frame number of the currentframe of the movieclip that is playing from another movieclip?

lastly, when a video and an audio is playing simultaneusly, when i pause the audio the video keeps playing, but when i unpause the audio, the audio resumes @ the same point where the video is currently playing?

thanks guys!

View Replies !    View Related
Pause Sounds And Resume Sound
Hi, me again....the problem it's like this ...I have a movie with a soundtrack ...I have many buttons to interact with the movie..like e-mail forms ..credits ..pause and play...well I know how to stop the sounds when the user hit's the pause buton or credits or whatever...just don't know how to resume the sound ...can you help me?

View Replies !    View Related
Pause And Resume Sound Problem
Hi, me again....the problem it's like this ...I have a movie with a soundtrack ...I have many buttons to interact with the movie..like e-mail forms ..credits ..pause and play...well I know how to stop the sounds when the user hit's the pause buton or credits or whatever...just don't know how to resume the sound ...can you help me?

View Replies !    View Related
Play/pause Movieclip & Sound
Hi all,

I've used Flash for some time as an animation tool, however I'm having a few problems with my first step into the world of scripting. I'm using MX 2004.

I have three movieclips in a scene and I require them to play or pause when clicked on. This I have managed.
However, they also need to mute or unmute a sound as well. The sound cannot be stopped, as there are three sounds which form a piece of music. If stopped they will go out of sync.

Effectively I have three characters on stage playing music and when they are clicked I wish for the music and the movieclip to pause.

I have attached the following script to the movieclips:


Quote:




onClipEvent(load){
myDrums = new Sound();
myDrums.attachSound("sounddrums");
}
on (release){
//if the paused variable is false or non-existant
if (!paused){
//stop the movie
myDrums.setVolume(1);
stop();
//set paused variable to true
paused = true;
} else {
//else if paused variable is true
//play movie
myDrums.setVolume(99);
play();
//set paused variable to false
paused = false;
}
}




This apparently worked with one movieclip, however when added to another movieclip (I remembered to change the sound names to suit the other instrument) both the sound volumes are changed at once.

Can anybody help an inexperienced actionscript beginner out?

View Replies !    View Related
How To Make Sound Pause Temporarily
I need to know how to simply pause the music so I can resume it later. How can I make that possible? Please and Thank you.

View Replies !    View Related
[F8] Pause Timeline As Sound Plays
How would you go about pausing the play head in the timeline only for the duration of a sound file?

Have a series of screens -- using the presentation screen feature -- on each of which there is a sound file that I dragged out for about five frames, though the actual audio goes on for two minutes of so. I want the playhead to stop at the end of the audio sprite, play the duration of the wav file, then advance one frame at which time an CLICK ON NEXT ARROW message pops up. In Director this is easy to do and am looking for the Flash equivalent.

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved