ActionScript 3.0 :: Looping Mp3 File And Event.SOUND_COMPLETE
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.
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);
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();
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]...........
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
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.
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.
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.
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.
why my function "replicaLoop" doesn't run?? I'm sure the function will work but it's not running
var replicaConnection:NetConnection = new NetConnection(); replicaConnection.connect(null); var replicaStream:NetStream = new NetStream(replicaConnection); replicaStream.play("replica.flv"); var replicaListener:Object = new Object(); [Code]....
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 :
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)
I have tried the following code to create a thumbnail preview that loops and is clickable to go to a new page with a video gallery. The video plays anbd loops, but, it does not seem to recognize the mouse click i have a trace that isn't being triggered an nothing happens. code is below.
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.
Im having trouble getting my head around writing script for looping certain layers of a fla file.I have a project that I urgently need to finish and can't figure out how to achieve what I need.I have an fla file that has several animated layers.I want layer 1 to play once and stop while continuing to be visible (which I have achieved).I then need to play layer 2, layer 3 and layer 4, and loop these layers continuosly without relooping layer 1.
I created a small Flash movie that I want to end at the last frame. Instead it keeps looping and starting from the beginning. This is the link: [URL] At the end of each timeline I inserted a keyframe and added the action: stop(); But this doesn't seem to have any effect.
I'm having a problem with a .swf file created in Flash CS3. I want it to loop, which it does when I Test Movie in Flash, or when I play the .swf file in the Flash Player. But when I upload to my web space it stops looping.
I used the follwing script in the last frame of the file to create the loop:
I'm working with a swf file (a simple flash movie) and I am trying to get it to loop. I've tried setting loop="true" in the embed tag, and for the object.
Does this mean that the problem is in the swf file itself?
I am very new to flash CS4 and am having trouble getting my head around writing script for looping certain layers of a fla file.I have a project that I urgently need to finish and can't figure out how to achieve what I need.I have an fla file that has several animated layers.I want layer 1 to play once and stop while continuing to be visible (which I have achieved).I then need to play layer 2, layer 3 and layer 4, and loop these layers continuosly without relooping layer 1
I'm new to this actionscript stuff and I'm having trouble making my swf file loop over and over. I have several movie clips in my scene and in the last movie clip, in the "actions" layer, in the last frame, I put "gotoAndPlay(1);" hoping that this would make the file loop over and over.
Instead, I get a error message: 1120: Access of undefined property social_media_mc. How I can make my swf loop over and over?
I have an fla file that has several animated layers.I want layer 1 to play once and stop (which I have achieved).I then need to play layer 2, layer 3, layer 4 and loop these layers continuosly without relooping layer 1.
I'm having a problem with my onPress actions when reading them form an XML file. Here's what I'm trying to do: Read xml file: duplicate movie clip according to how many xml items there are. Place a different onPress action to each movie clip according to what the corresponding path is in the xml. My problem is that each time I press any movieclip I always get the last path in the xml file. The loop is over writing the value and when the onPress function is called it uses the last value. How do I get the onPress to remember which movie clip it is and use the appropriate onPress action?
Here is my code: import mx.transitions.Tween; import mx.transitions.easing.*; var Portfolio:XML = new XML(); Portfolio.ignoreWhite = true; Portfolio.onLoad = function(bSuccess:Boolean):Void { [Code] .....
I have a .swf file that is not looping although I have added the parameter to do so. It plays just the once, and at the end of the video it stops instead of looping. <div id="video"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="211" height="316" id="FLVPlayer" style="visibility: visible; "> <param name="movie" value="FLVPlayer_Progressive.swf"> <param name="quality" value="best"> <param name="wmode" value="opaque"> [Code] .....
I have done before, but unfortunately no longer have the FLA file. The idea is to have a web page header that has some eye-catching animated messages that keep changing to the next one after a few seconds.
An XML file (header-messages.xml) contains one line per message, and also a hyperlink, see example below
<?xml version="1.0"?> <config> <message1 lineOne="Special offer on red widgets" hyperLink="/special-offer.htm" /> <message1 lineOne="Read our latest news" hyperLink="/latest-news.htm" />
How can I stop my Logo.swf file from looping. Actually the external Logo.swf file doesn't contain any looping code inside it. If I open it in any flash player it animates only one time. Writing "stop();" in code stops all other animations which I don't want.
Ive created a banner ad in AS 1.0-2.0. The ad can only loop 4 times then it must stop. The following code does this at frame 170. The timeline is 170 frames in length, and this code is keyframed on an actions layer on frame 170 - however, I'd like the final stopped flash swf file to occur at frame 155. I can't just put this code on frame 155 - it skips a whole section of animation (from frames 155 to 170) that I want to keep in the loops.
I want to get my flv file looping within the swf. I've used the FLVPlayback Component. I've given the flv file the instance name of "vid". Actionscript is as follows: