ActionScript 3.0 :: SoundChannel Event.sound_complete Not Working?
Mar 4, 2010
For some reasons, my soundchannel event.sound_complete is not working. Basically, my class is to import sound into it and to allow use to change their volumes and the speedness of the sound.
This is the tutorial for the speed [URL]
Right now, what I want to do is to auto loop back the song once the song have finished play but I have having troubled doing it.
[Code]....
View 5 Replies
Similar Posts:
Jan 12, 2009
i have a little flash-player with a playlist and so, it plays normally a vlc-mp3-stream but has an extended prelisten-function (wich plays the mp3's directly via http, secured with a password)i've got an array with 2 Sound()-objects (for preloading purposes), the code looks like this :
Code:
playStream = url=="";
if (playStream) {
SoundObjects[SN].load(new URLRequest("http://" + URL + ":8001/MIRstream.mp3?" + Math.random()), sloader);
} else {
[code]....
this works for the vlc stream (which is not continuos), but not for the mp3s on the http-server in my opinion, this doesn't makes sense..except, maybe the recent CSRF-hardcore-paranoia [URL]
PS: i use AS3 with flex_sdk_3.2.0.3794 and flashdevelop (i activated flash10-support, but it still works in fp9)
View 1 Replies
Feb 10, 2011
I have a movie that has a bunch of animations on diferent scenes the problem is that I need my movie to wait for my sound to finish before it goes to the next scene, when I use the sound complete it works fine on the first scene but it won't go past that.
Code:
import flash.media.Sound;
import flash.net.URLRequest;
[code]....
View 1 Replies
Jun 6, 2007
I am working with a short vocal track and when the audio ends I would like a replay button to appear. The codes should work fine, no errors appear. Trace displays nothing...Here is some of the code:
var clip = "testClip.mp3";
//Create the Sound & SoundChannel Objs
var soundReq:URLRequest = new URLRequest(clip);
[code].....
View 5 Replies
Sep 18, 2010
This should be easy but I can't figure out. The sound is playing which means the mp3 file was successfully loaded but SOUND_COMPLETE event does not trigger
Code:
private var soundReq:URLRequest = new URLRequest("blabla.mp3");
private var sound:Sound = new Sound();
[code].....
View 2 Replies
Oct 4, 2011
I'm trying to run some simple code for a Flash slideshow involving the SOUND_COMPLETE event.All I'm trying to do is to get to the next frame where my nav buttons show up after the current audio file plays completely.I'm aware that new Sound Channel object is returned after the audio file plays and a new eventListener is required, but I've inserted a new listener in every place imaginable and I still can't get this to work.Here's my code.
var soundReq:URLRequest = new URLRequest("Slide_1.mp3");
var sound:Sound = new Sound();
var oneSoundChannel:SoundChannel = new SoundChannel();[code]...........
View 3 Replies
Sep 28, 2010
Working on an mp3 player that i have cobbled together myself, bit rusty on the as3 so im sure it could be improved in many ways but the it works apart from that i cannot get the SOUND_COMPLETE event to fire at the end of a track, thus playing the next track. I have looked on this forum and others but cannot seem to get this to work
[Code]...
View 6 Replies
Apr 11, 2009
I have a button that rotates a wheel 90 degrees each time the button is pressed. What I'm trying to do, is play a sound when the wheel stops at each rotation. So something like this:
Wheel rotates to 90 degrees.
90 degrees = sound #1
Sound #1 plays once.
The rotation works fine, but the problem is, when I tried to do this I put in a statement that with my wheel named "wheel" if wheel.rotation==90 play my sound. But my sound keeps looping and SOUND_COMPLETE is not firing to trigger it to stop.
[Code]...
View 4 Replies
Sep 19, 2011
I have a playlist menu made up of movie clips acting as buttons, one clip for each track from a CD. The user clicks on a button, a corresponding sound clip plays and the movie clip button the user selected switches from frame 1 to frame 2 to change color while the sound is playing to show which track is currently playing.
Using an array to store the music tracks (named "Track 01" to "Track 08") and a "switch" command, my user is currently able to select and listen to a given track. My current problems lie with presentation.
I am having two problems with this project:
1. If the user allows the track to play through to the end, I need a single function to be fired on the SOUND_COMPLETE event (and I have applied the appropriate listener to my sound channel) which will reset the button to frame 1, as a visual indicator that the track has stopped. I have been unable to come up with such a function as yet.
Currently, the selected button just stays yellow (frame 2) instead of turning white (frame 1), and the user has to click twice (instead of once) to make the track play again.
2. My playlist includes a "play all" function to play all the tracks through in sequence as laid out in an array. While the track sequence plays fine, I would like to have the corresponding button for each track jump to frame 2 while that track is playing, then back to frame 1 when the track stops.
View 0 Replies
Jul 3, 2007
I am trying to find a workaround to the problem of looping mp3 files, basically the silence in the transition (from end to start). I could use wav files but I need to load the file externally, which makes not possible to use wav. So I did this
HTML Code:
var channel:SoundChannel = myMp3.play();
channel. addEventListener (Event.SOUND_COMPLETE, onComplete);
[Code]....
Edit: Now I know it is not a problem of flash, it is problem of the mp3 format itself.
View 7 Replies
Jun 20, 2010
is there a way to play sounds one after another avoiding overlapping without using the SOUND_COMPLETE event by SoundChannel? I have a few sounds to be played in order and using SOUND_COMPLETE would take me to add to many listeners.
View 3 Replies
Dec 6, 2008
I just finished a simple music player... For testing purposes. I upload it in the following address:http:[url]....with 10 music songs that I had recorded from radio stations(added the last 2 twice for testing).The problem is that when a song has totally loaded, stop action taken needs about 1 second to be applied!I.e. When I press "STOP", the sound continue to play for 1 sec before stop. When I push "pause" it takes one second for the music to stop!
However when using resume (second time pause) the sound starts instantly! Thus I guess there is an issue with stop()function of the SoundChannel object that I am using to stop the sound. Also notice that when unpause the music, it continue ~one second before the last sound - which means that I saved the soundChannel.position number (and also call soundChannel.stop()) in correct time, but it didn't stop immediately - bug!?
This only happens when the application runs through a browser(plugin v. 10) - programmed in CS3.
PS1. Notice that ,this also happens when I change Volume too. Thus because Stop and Volume are parts of SoundChannel, I guess there might be a bug with SoundChannel in online plugins..... :/
PS2. Notice that ,this also happens when I close the browser (firefox). Even if browser is closed the music continue for 1 sec the same way as when pressing stop!.. Thus I guess it's flash bug!...
View 2 Replies
Dec 3, 2010
I am trying to stop a sound from playing after the user clicks the next button, and I have followed what I was told from others on how to use the SoundChannel but can't seem to get the stop() function to work?
here is the code:
ActionScript Code:
nxt1_btn.addEventListener(MouseEvent.CLICK, next1);
var grad:Sound = new graduationMusic();
var gradChannel:SoundChannel = grad.play(0,int.MAX_VALUE);
[Code].....
Error that keeps popping is : 1120 Access of unidentified property gradChannel.
View 6 Replies
May 3, 2011
I have a soundchannel, and I'm playing a lot of sounds in it, but I need the completion of any sound file within that channel to be followed by a wait of two seconds, then trigger an event. How can I do this?
View 4 Replies
May 28, 2008
I have a pause button that pauses a sound playing in a soundchannel. It works, but when I resume the sound, it isn't in thecorrect position, almost like it was rewinded a little. I'm usingthe code straight from the
View 1 Replies
Nov 24, 2011
I have this in my constructor:
[Code]..
The problem is I get Error: Error #2094: Event dispatch recursion overflow. Why does removechild keep getting called if this.parent does not exist? Why doesn't removing event listeners work?
View 1 Replies
Feb 3, 2010
i am using progress event to load video file from url, but it is not showing me preloader, code:-
ActionScript Code:
var urlRequest:URLRequest;
var urlLoader:URLLoader;
urlRequest = new URLRequest("video.flv");
[Code].....
View 2 Replies
Apr 17, 2009
I wondered if there is a way to find out from the soundChannel the url of the sound it is currently playing. once I found out its url, i can than use its name to call something else.Or anyway to find out the sound that is playing on a soundChannel.I will know which channel to look into, but different sound will be loaded into this soundChannel.If this is not possible, i thinking along the line of overloading SoundChannel play method so that is fires an event when the sondchannel plays and also find out the name of the sound file it is currently playing.
View 2 Replies
Jun 30, 2009
I am trying to build a simple player inside my swf file. The code is a bit messy but it seems to work.I´m using a soundChannel for Playback..I´m trying to figure out how to have the player play the next song once the previous one has reached its end.Do I add some sort of EventListener to the soundChannel?[code]...
View 7 Replies
Sep 2, 2010
when do we use SoundChannel and SoundMixer?
View 3 Replies
Dec 27, 2010
The soundChannel only plays once.Im guessing this has to do with using a class?[code]...
View 5 Replies
Jul 9, 2009
I'm having some problems with a script.I developed the app on a mac. It's intended to be both on mac and windows and also air and swf (I save data or not depending if it's installed or not).I've tested it on mac and several pc (winXP) but on win 2003 server and win 2008 server I get an error. Also on a winXP without flash player installed (through the projector) breaks at the same point.The problem is on the red line. It does always work right, sound loads, plays and when it finishes the event is called (in this case it loops). In other cases when sound completes the event should load a screen or so but, as I get an 'Error #1009: Cannot access a property or method of a null object reference' so the movie stops.I need all sounds to be inside flash so I put them in library and set their classes as com.escacs.sound.* (there are many sounds) I can't understand how mainSC can be null or undefined if the previous instruction initializes it.
[code]...
View 8 Replies
Sep 3, 2007
AS2 -> AS3 migration: doncha just love it?!have a look at the attached code. selection one makes us anew sound and gets it playting, great. then we need to adjust thevolume so we read in the files that:You can alter the volume and panning while a sound is playingby setting the pan or volume properties of a SoundTransform objectand then applying that object as the soundTransform property of aSoundChannel object.great, so selection 2 in code below should do that, right?
View 7 Replies
Sep 29, 2011
I was debugging sound in an app and decided to make a little test case as I kept getting odd errors... well I just moved to a new desk yesterday so hadn't hooked up speakers yet. Here's the test:
var backSound:Sound = new bgSound();
var backChannel:SoundChannel = backSound.play(0, 999);
trace(backChannel);
bgSound is just a library sound... if my speakers are unplugged from the sound card backChannel returns null. If speakers a plugged in backChannel is a soundChannel object.
View 1 Replies
Oct 23, 2009
so I have a lot of classes in actionscript 2. But I need to modify my application to use the soundchannel object for audio monitoring. as far as i know this is only in actionscript 3. so it it possible to write one class in AS3 and leave the rest in AS2?
if not is there a conversion tool which can make the process easier?
View 2 Replies
Jun 8, 2011
EDIT: Sorry for the question being reworded, but I am just simplifying the issue. I am not getting accurate values for SoundChannel. position for an external MP3 that is playing.I've tried a variety of audio bitrates and consistently,i am getting a SoundChannel.position that is less (~250 ms) then where the actual audio has played to. As well, the position never equals the duration. It always finishes behind, even when the SOUND_COMPLETE event is generated.
Adobe says any Sound position/duration issues are fixed with the latest Flash Player. I am obviously not getting the same results. I need very accurate position values in order to have a custom draggable timeline and cue points.
View 1 Replies
Jan 15, 2012
I have a Flex(4.6.0) application which creates 3 SoundChannels. I'd like to attach 2 of these channels to a NetStream for publishing, leaving the 3rd SoundChannel only for listening to locally.
The only audio component I can seem to attach to a NetStream is a Microphone, so I could use a Microphone loopback adapter and send ALL sound to the stream, but this would include all channels, windows sounds, sounds from other applications etc.
How do I attach individual soundchannels to a stream, or should I be going about this in a different way?
View 1 Replies
Jan 30, 2012
I'm creating a mute/unmute button.I have it working correctly, except 1 part.I want to make my SoundChannels remove themselves when the SOUND_COMPLETE Event is fired.I'm storing my Sounds and SoundChannels in an array called "soundsPlayingArray".I want to do 1 of 2 things.Either:
1) Have my "unMuteAll" function check to see whether a song is "playing" before unmuting it.
2) Remove the Sound + SoundChannel from array (and make them null) when the SOUND_COMPLETE Event fires.
How can I figure out what the instance name of the SoundChannel that dispatched the SOUND_COMPLETE event is?[code]
View 1 Replies
Jun 1, 2009
Code: Select allprivate var musicFadeAmount:Number = 0.005; // Amount to fade the music
// Helper function to change volume
private function SetVolume(vol:Number, sc:SoundChannel):void
{
[Code].....
I run the last two rows in an ENTER_FRAME loop, and from the trace in the SetVolume() function I can see that scMusicIdle changes it's volume like it's supposed to, but scMusic keeps it's volume. I can change the volume when I play the sound with a new SoundTransform().
how to fade between two tracks in a better way I'm all ears. If it makes any difference it's an AIR 1.5 app.
View 1 Replies
Oct 30, 2009
I am trying to call a method that pulls several variables depending upon the button clicked.Depending upon the button, it will play a certain sound/song. Below is what i have so far, if anyone could figure out why i get the following error: TypeError: Error #1034: Type Coercion failed: cannot convert "test_Btn12_soundChnl" to flash.media.SoundChannel."test_Btn12" is the button that i happened to click on at that time.
Code:
public function buttonClick(e:MouseEvent):void {
playSound(MovieClip(e.currentTarget), SoundChannel(String(e.currentTarget.name) +
[code].....
View 3 Replies