ActionScript 2.0 :: Looping MP3s Seamlessly Unless Mute Button Clicked?

Apr 24, 2004

I'm using some modified code from a chapter exercise (from a text book) to play four separate MP3s external to the FLA. Here's an example of what happens when a button is clicked:

Code:
BtnOne.onRelease = function():Void {
stopAllSounds();
song1=new Sound();
song1.loadSound("Music/Puffy.mp3", true);
gotoAndPlay("music1");

On the label 'music1', I have this AS:
Code:
stop();
song1.onSoundComplete = function() {
song1.start();
}

The problem is, there's something of a noticeable stutter when the MP3 reaches the end, just before it starts up again. The first MP3 (contrary to the others), is a seamless ambient sound which ought to sound perfect in the FLA, but doesn't, again, because of the slight stutter in starting it up again. Is there a better way to do this? I thought, perhaps, this would be fixed if I removed the "stop();" line and instead had it play the next frame, which would invariably send it back to the previous one, but this changed nothing. Is there a better method to use? Even with the other three MP3s, which aren't seamless, I want to loop, unless and until the user clicks the 'Mute' button.

View 2 Replies


Similar Posts:


ActionScript 2.0 :: MP3s - Loop Unless And Until The User Clicks The 'Mute' Button

Apr 24, 2004

I'm using some modified code from a chapter exercise (from a text book) to play four separate MP3s external to the FLA. Here's an example of what happens when a button is clicked:

[Code]....

The problem is, there's something of a noticeable stutter when the MP3 reaches the end, just before it starts up again. The first MP3 (contrary to the others), is a seamless ambient sound which ought to sound perfect in the FLA, but doesn't, again, because of the slight stutter in starting it up again. Is there a better way to do this? I thought, perhaps, this would be fixed if I removed the "stop();" line and instead had it play the next frame, which would invariably send it back to the previous one, but this changed nothing.

Is there a better method to use? Even with the other three MP3s, which aren't seamless, I want to loop, unless and until the user clicks the 'Mute' button. My last thread (about setInterval)received no replies, but I'm hoping this will, especially as this final project is due this Wednesday and I'd rather it not have this slight hiccup in it.

View 2 Replies

ActionScript 2.0 :: Flash Can't Really Loop Mp3s Seamlessly

Nov 17, 2004

so Macromedia says Flash can't really loop mp3s seamlessly, and suggests importing WAV files. But if you're using AS to load an external sound at runtime, this is not possible. So I ask you, coding geniuses, is there a work-around to the silence that Flash adds to the beginning (end?) of an mp3 file, thus causing it to loop incorrectly (I've already tried adding a decimal to the secondsOffset and it sounds awful).

View 2 Replies

ActionScript 2.0 :: How To Make Sound Looping Seamlessly

Feb 14, 2005

I got a loop that I'm loading into Flash with the Sound object. The sound loads good and it starts playing but when it loops back to the beginning there's some silence and then it loops again. The sound loops fine in a sound editing program, the only problem is that Flash leaves a gap when its going to start again. How to make a sound loop seamlessly?

This is my code:
loadMusic = function() {
loop = new Sound();
loop.loadSound("lomtrack.mp3", false);
} loadMusic();
playMusic = function() {
loop.start(0, 100);
} playmusic();

View 4 Replies

ActionScript 3.0 :: Looping Mp3s Without Gaps?

Apr 19, 2009

I am building an 8 track Flash audio mixer where the sounds for each track are selected by the user from a list component and then loaded into a Sound variable at runtime.This can be done while the mixer is playing or stopped, and of course, it adds a lot of flexibility for making music.All actionscript is in external .as files and sounds are looped using the SOUND_COMPLETE event.So far, all loading/playing functions work perfect, but I`m having problems with gaps at the beginning/end of my mp3 files.I was told this was an inherent problem with mp3 files, so I tried using MPTrim to clean the silence up.I also tried starting the loop a bit late - sound.play (80, 1) - but the results are usually inaccurate and unpredictable.

When I import a wav file into the library and then export it as an mp3 file embedded in the .swf file, it sitll has a short gap.When I built a previous mixer in Flash MX (actionscript 1) there was no gap and all sounds looped perfectly! Of course, in this later case, all sounds were embedded inside movie clips on the stage and scripting was done on the timeline, so maybe that made a difference.I have spent long nights trying to find a solution to this, but to no avail.I read a blog where the writer went through all the steps I have and just gave up, but I know there is a solution.I have seen this sort of thing done on Flash mixer sites before (even sites with full-on audio sequencers) so I know it can be done.

View 3 Replies

ActionScript 3.0 :: Motion Tween - Stop Looping When Button Clicked?

Mar 1, 2011

I'm trying to create a simple game. Right now I have one button that when clicked moves the character across the screen. My issue is trying to make the player stop looping after I click the button. If I just insert stop for the last frame it will only loop once and stop, but it will not play again after the button is clicked. I've tried using players_turn boolean but couldn't get that to work.

[AS]package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
import flash.events.Event;
[Code] .....

View 5 Replies

ActionScript 2.0 :: Looping Dynamically Loaded Mp3s

Sep 4, 2004

I have brought this up at the end of another thread, but thought it needed it's own.Trying to loop a dynamically loaded mp3 of a cicada.[code] Why does this not work?I understand that the start function isn't needed, as it's a streaming object, but I thought if I added it, it would loop.This syntax is the only way I know to loop a sound object in AS.URL...

View 2 Replies

ActionScript 2.0 :: Looping Menu - Go Back To Frame And Play From There So It Would Loop All Until The Button Is Clicked

Apr 10, 2010

I've got an intro for a movie,and a single button appears around frame 58,and I've tried giving it a function so it will skip to fram 478 and play the whole movie from there on:

PlayCompl_btn.onRelease = function() {
gotoAndPlay(478);
}

but it keeps saying "statement must appear within handler" and I've got the same problem when the movie reaches frame 477 I want it to go back to frame 58 and play from there so it would loop all until the button is clicked:

PlayCompl_btn.onEnterFrame = function() {
gotoAndPlay(58);
};

View 9 Replies

Actionscript 2.0 :: Mp3 Player - Keep The Mute State Unchanged When The Songs Are Playing Until The Mute Button Is Pressed Again

Feb 3, 2009

I've downloaded the the Flash mp3 Player. I did some minor modifications to it and it works well. The only problem I have is that when the mute button is pressed, the current song is mute(s.setVolume(0)), but when the next song comes up, the mute button is not in mute state(Volume not set to 0). I want to keep the mute state unchanged when the songs are playing untill the mute button is pressed again.

View 6 Replies

ActionScript 2.0 :: Mute A Sound That Is Looping And Unmute It Again?

Jan 29, 2009

I have a small loop of a beat. it automatically loops in flash, i need a button to mute this specific sound (so i can put other different sounds) and another button to unmute it... i've seen how to mute a sound (or set volume to zero) but that only works if the song is beiing played on the timeline, but this sound is looping!

View 9 Replies

ActionScript 3.0 :: Mute Button Toggled To "mute" By Default?

Aug 5, 2010

So i have a flv playing on a flash load. I need the mute button toggled to "mute" by default.

Code:
my_FLVPlybk.muteButton = mutebtn;

that is the mute button instance i am using.

View 1 Replies

Flash :: Professional - Videos - Get 4 FLV To Seamlessly Run From One To Another Without The End User Having To Click A Button?

Mar 16, 2010

how to get 4 FLV to seamlessly run from one to another without the end user having to click a button?

View 4 Replies

AS2 Looping Through To See What MC Clicked?

Oct 19, 2009

I have many movieclips on stage, let's say 100.Rather than setting onRelease or OnPress function for each one, is there any way of looping through all the movie clips (maybe if they were called MC1 MC2 MC3 MC4 etc etc), using an array, to see which one was pressed and then say what should happen if so and so MC was pressed.

Depending on which MC is pressed a variable will be a different number... e.g. MC1 pressed means variableA = 1, MC1 pressed means variableA = 2, MC1 pressed means variableA = 3 etc

I just thought there would be a more intelligent solution than writing out this 100's of times: MC[numberOfMC].onPress = function() { do something };

View 5 Replies

ActionScript 2.0 :: Looping Sound To Be Triggered When Each Member Is Clicked

May 31, 2005

I have a movie clip on the main timeline. Within it, are several other movie clipe. I want a looping sound to be triggered when each member is clicked. here is the following code I have, but so far it aint working! I set them all to play initially, so that they are in sync. I imagine this is just a linkage issue of sorts.

[Code]...

View 3 Replies

ActionScript 2.0 :: Active Button - Stay The Rollon Color After It's Clicked And Then The Rolloff Color When Another Button Is Clicked?

Sep 29, 2008

How can I make it stay the rollon color after it's clicked and then the rolloff color when another button is clicked?

[Code]...

View 7 Replies

Create Media Player And Link MP3s To Different Instances Of Same Button

Sep 28, 2009

I am trying to do: [URL]. This is a little webpage I'm building as I learn more and more flash. I am at a point where I need to link .mp3 files to the buttons on the "Dan's Top Songs Playlist". If you like, you can download my flash file here: [URL]. I am working with ActionScript 3.0. The buttons in the Media Player are all instances of the same button. How do I tie each button to a different .mp3 song to play when clicked (and stop when another song is clicked or the pause button is clicked)? Because of the size of song files, I'd like to stream it. Also, is there any way to use the "repeat" symbol to just play all the songs in order and the "shuffle" symbol to play them in random order?
Attachments: fbar.zip (1.8 MB)

View 1 Replies

ActionScript 3.0 :: Detect Wheather The Button Is Clicked Or Not And Disable It If Clicked?

Jun 9, 2010

I have 4 navigation button and like home, about us etc....  And i want to disable home when it is click and cannot clicked it until the user click another button first. means if a visitor is at home page then home navigation is disabled, and all other are active, and when they click at aboutus button then the pages goes to the about us page and the about us button is disabled and other get active. I want this solution in AS3 with oop concept.

View 6 Replies

ActionScript 2.0 :: Buttons To Stay Orange Once Clicked And Only Roll Out Back To Grey When The User Has Clicked On Another Button In The List

Feb 7, 2007

I've got about 6 buttons laid out, one on top of the other in a list format. In their normal state the buttons are grey in colour, when I rollover them, the buttons flash and turn to orange. Now, what I need to happen is this: I want the buttons to stay orange once clicked and only roll out back to grey when the user has clicked on another button in the list. I've been told that the best way to do this is via adding a listener, however I am a little unsure as to how to go about this. I've checked the flash help file and have a basic understanding of how listeners work...but can't really wrap my head around applying it to this situation. Perhaps I will need to have all the buttons as separate broadcasters?

View 2 Replies

Create A Mute Button?

Feb 1, 2002

How to create a mute button in flash so that when its clicked all sounds are muted, however, when clicked again all sounds resume but without starting again from the beginning.

View 4 Replies

Fla That To Add A Mute / Unmute Button

Jan 10, 2011

something probably quite simple. fla that I need to add a mute/unmute button to. It would be even better if mute/unmute occured onmouseover, but no doubt this is a more complex question?

View 2 Replies

Mute Button Not Working?

Aug 9, 2009

This is a simple mute toggle button for an mp3 player.
 
I first var sound: Sound 
Then I have the function 
//mute the current sound
function muteSound ()

[Code]...

View 3 Replies

IDE :: Mp3 Fading Mute Button?

Aug 2, 2009

i have an mp3 that plays as background music to my website with a mute button that fades the music in or out. This works using the code below that i found on another site.My problem is i would like to have this music added to an external swf that i could load into my main site in order to decrease the main site file size. When i load swf however, the music doesnt play. the button appears (which is also in the external swf) so i know that the movie is loading but no sound plays.

some_sound = new Sound();
some_sound.attachSound("Kevin Spacey 16bit.mp3");
some_sound.start();

[code].....

View 1 Replies

ActionScript 3.0 :: Mute Button For Embedded FLV?

Dec 19, 2008

I need to create a mute button for an embedded FLV file.There is no separate sound file for me to control, so I'm unsure

View 3 Replies

ActionScript 3.0 :: Mute And Unmute Button?

Apr 10, 2009

I am wondering how to make a mute and unmute button is actionscript 3.0.  I did it before in actionscript 2.0 but not in 3.0. Here is my actionscript 2.0 code.
  
var sound = 1;
var slashMC = _root.attachMovie("slash","slash01",99);
slash01._visible = false;
slashMC._y = btn._y;
slashMC._x = btn._x;

[Code]...

View 14 Replies

ActionScript 1/2 :: Mute Button Is Not Working?

Oct 9, 2010

I tried using a form of "volume = 0" kind of code but one thing it doesn't mute is the sounds I have in buttons (or symbols). Those seem to continue playing even when the mute is active.So whats a form of code I could use to shut off all volume?If there isn't a solution then what can I do to mute symbol sounds?

View 1 Replies

ActionScript 2.0 :: Mute The Music With A Button?

Mar 9, 2011

I have some songs in the same folder as i have my .fla file. I call the .mp3 file on the first frame and i want to be able to pause it or stop it when i click on a button. I would appreciate the code for that. Or maybe any other suggestion on how i should add music to my .fla file.

View 9 Replies

ActionScript 2.0 :: Mute Button Not Working In Embedded SWF

May 19, 2010

The mute button code I have works perfect when the SWF is played itself, but when it is embedded in a wrapper SWF it no longer works. I know that it is the code that references _loc1. I have the root locked in the first frame of the embedded swf with this:

Code:
this._lockroot = true;

Here is the code in question. I just need to know how to change this code to make it work when this SWF is embedded in another SWF:

Code:
btn.onPress = function () {
var _loc1 = _root.snd.getVolume();
_root.snd.setVolume(Math.abs(_loc1 - 100));

[Code].....

View 1 Replies

ActionScript 3.0 :: Sync Mute Button And Volume Bar?

Oct 1, 2010

I'm creating a movie with an FLVPlayback component. I used the standard Play/Pause, Mute and Volume Bar components supplied with CS5.I have had no problem getting the individual components to work by themselves... the play/pause button plays or pauses, the mute button mutes, and the volume slider controls the volume. But how do I set the volume bar to 0 when the mute button is on, restore the original volume when the mute button is turned off, and turn on/off the mute button if the volume bar is dragged?

View 2 Replies

ActionScript 3.0 :: Create A Mute Button For Video In It?

May 11, 2009

I would like to create my own mute button in as3. I have created a video object which plays my video fine. I'm having trouble finding information on how to create a mute button that mutes the audio but the video continues to play. All documentation that I've read relates to controlling sound from an loaded .mp3 file.

View 8 Replies

ActionScript 3.0 :: Mute Button For Sound In Timeline?

Sep 27, 2008

I want to add a mute / unmute button for sound that must remain synced to my animation. It sounds like a pretty straightforward task and I'm embarased that THIS is where I've gotten stuck while I've gotten through some stuff I thought would be way harder on my own. The reason this is a problem is because in considering 2 approaches I've run into a wall. I'll gladly accept any advice to circumvent the roadblock either way.

Approach 1 is to add the sound to the library, drop it in the timeline as a stream and build my animation to match. That works just fine, but I can't find an instance name for the sound to run a setVolume function against (not even sure if it would be that simple, but without an instance name, I can't move any further forward; I tried labeling the first frame of the sound layer 'narration' and trying refernces like timeline.narration, timeline, narration, and so on, but no joy).

Approach 2 is to import the sound using URLRequest, instantiating the sound and setting the volume against that instance. Works like a charm but the sound drifts out of sync with the animation (that was synced perfectly when it was in the timeline). This is my less appealing option because I'm using nav buttons taking me to various frames and the sound (which used to pick up at the right frame when it was in the timeline) just plays on without regard to the point in the animation. It's not a surprise to me that this happens, but if I were to do this I'd need to write code into my nav buttons to pick up the right spot in the sound instance and I'm not sure how to do that.

View 5 Replies







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