ActionScript 2.0 :: Code For When Sound Is Finished
Feb 14, 2009
I want the code for when a sound finishes playing. Example: when I click to make a sniper sound go off, I want it to have a script that wont let you play the sound again until the sound is finished playing.
View 4 Replies
Similar Posts:
Dec 12, 2009
How do I check when a sound in finished, example:
Quote:
var music:Sound=new Sound(newURLRequest("test.mp3"));
var sc:SoundChannel = music.play();
How do I tell when that sound is finished?
View 2 Replies
Mar 27, 2012
i did this
package{
import flash.display.MovieClip;
import flash.events.MouseEvent;[code]...
it works but only one time i wanna the sound keep working after finished
View 5 Replies
Jun 27, 2010
SOUND_COMPLETE apparently isn't working!
In short, this is what I have:
ActionScript Code:
var playingsong:Sound;
function loadTrack(track){
playingtrack = new Sound();
[Code].....
I have a trace on trackFinished, and it never happens, so it's never getting called.
View 5 Replies
Aug 25, 2009
I have this code in frame 1 [code]In frame 2 the animation/flash application starts.The preloader works fine BUT when it gets to frame 2 it stops. I cannot get it to start. I think it is a simple issue but I cannot see it.
View 3 Replies
Apr 29, 2009
how to detect if stream finished playing sound/movie?
View 1 Replies
Feb 13, 2010
I'm learning actionscript and would like to add a sound to the code below when a thumbnail is selected. The code is from Adobe Flash CS4Classroom in a book. The flash settings are AS 3.0 and Media Player 9.0
ActionScript Code:
//
thumbnails_tl.addEventListener(Event.CHANGE, thumbnailClicked);
function thumbnailClicked(event:Event):void {
[code]....
View 1 Replies
Apr 5, 2004
Everything except for the resume button on my sound player doesn't work. The stop works fine, but it doesn't seem to start back up again when I press the resume.
[Code]...
View 3 Replies
Mar 15, 2007
I can't seem to access the sound duration value in my code, I am not sure what I am doing wrong.
Code:
var directory:String = "Voices/";
var noOfSongs:Number = 100;
var aSongs:Array = [];
var currIndex:Number = 0;
[code]....
View 1 Replies
May 8, 2009
I made a button that starts the song, but when you press on the same button again it starts the song a second time. So now it is playing twice. Could use some help so no many how times the button is pressed the song only plays the first time it was pressed.[code]
View 4 Replies
Nov 18, 2009
Say I recorded and imported sound files of my voice saying "Two", "Four", "Equals", and "Plus"Would it be possible to have Flash on click string together those sound files like a string so that the user would hear:
View 1 Replies
Aug 19, 2010
I need it so the music plays at start and then the button will pause/stop it, and then turn into a play graphic which, when pressed, will play it again. I tried editing the code, but I am horrible at programming and of course nothing I tried worked. Please let me know what I have to change to start with music playing, and then have it stop/pause on first press, and alternate "play" and "stop" on subsequent presses.
[Code]...
View 9 Replies
Jan 22, 2011
I have a set of sound clips to be played one after another in a sequence with couple of time interval inbetween. In my case, its a question - followed by the set of four options.
When I write the below code, all the audop files start together at same time. How can I had time delay inbetween, so that the second clip plays only after the first one is over, and the third one starts playing, only when the second option is over.
[Code]...
View 3 Replies
Aug 19, 2010
this is the one code that I could make work, but I need it so the music plays at start and then the button will pause/stop it, and then turn into a play graphic which, when pressed, will play it again. I tried editing the code, but I am horrible at programming and of course nothing I tried worked. Please let me know what I have to change to start with music playing, and then have it stop/pause on first press, and alternate "play" and "stop" on subsequent presses.
[My fla has 2 layers, one for this AS, and one for the buttons... within the symbol section, I have two layers, one for the button common BG, and two frames in the button layer, one for play (triangle) and one for stop (square). They are saved as a movie clip.]
[Code]...
View 5 Replies
Dec 23, 2011
[code]I am making a soundboard and I need the code to stop previous sounds if I click on a new sound
View 3 Replies
May 22, 2009
I wanted to have this Zombie Penguin enemy use a walk sound (it would be odd if he moved and was silent) but because it is initializing the whole world, simply coding the sound into his animation state won't work because it will play the sound for every existing Zombie Penguin in the world, not just the one on the screen.
Now I've tried to get around this problem by using a SoundManager class [URL] to load and play/pause the sound when necessary. I've got this working by placing a movieclip above the world and hittesting everything and when it finds a Zombie Penguin activates the SFX. If it finds the enemy and you leave the room or kill the enemy (basically any way it is removed from the screen) it will pause the sound (not stop) and then unpause if you go back/find another instance of that enemy.
The problem is, though, that if I STUN the enemy (not kill it) it plays it's dizzy animation (which consists of hit sitting down with stars spinning around it's head) the walking SFX continues to play as the enemy is still on the screen.Now in the Zombie Penguins .as file it has a boolean that for being stunned or not (bStunned), and a function (public function getZPStun():Boolean -- returns bStunned). this bStunned boolean is set to a default of false.I figure that I just have to reference that somewhere in the following code, but I'm not sure where. The Zombie Penguin's .as is ZPEnemy, so I'm calling it like so:
ZPEnemy.getInstance().getZPStun()
I've tried calling it as part of an if statement a in a number of placesin hopes that calling it will relate the current state of the bStunned boolean, but I can't seem to get it to work.
Code:
var bNotPenguin = true;
for(var i = 0; i<this.numChildren; i++) //** Sound Manager Coding (May 15)
{
[code]....
View 4 Replies
Dec 12, 2009
For the typewriter effect, I'm trying to add a typewriter "click" sound every time this function (within a class) writes a letter:
private function setLetter(n:Number) {
var correctLetter:String = text.charAt(n); var part1:String = text.substr(0, n); temp_text = part1 + correctLetter + cursor;
[code].....
View 2 Replies
Apr 16, 2011
I am triggering short sounds dynamically from the library for a game (Specifically Air for Android). When the user clicks a button the sound can take up to 600ms to actually play. I have set it for any silence before the actual sound by calling the sound like so:
[Code]...
All return the same results. I know there are threads here that talk about this but none have offered a real solution that I can find. Is there no way to cache the sound or store it in a buffer?
View 1 Replies
Jul 16, 2009
_root.object_1.sunny.gotoAndPlay("walk"); _root.object_1.sunny.gotoAndPlay("laugh");Hi, I code the following. But it jumps straight to the seconf mc "laugh". Is there nbo way of playing walk and on finishing playing laugh.
View 4 Replies
Aug 9, 2010
I'm working on a project where a SWF will play (as sort of a splash), followed by JS. After the video plays, the navigation and content will appear, and the video will fade out. I'm just wondering what would be the best way to accomplish this? Play the video first and then load everything via ajax behind the scenes? The goal is to be as seamless as possible and I am having a flash asset provided to me by the client.
View 1 Replies
Nov 19, 2005
Need to make a photo gallery in flash. Not sure how to put the .swf into dreamweaver when finished.
View 2 Replies
Nov 30, 2006
I have a movie that plays a series of movie clips, it will play a clip, then, once the clip has finished, it will move to frame 2, where it will play another clip, and so on
Is there any way for the root timeline to now when a child movie clip has completed. I currently have the child clips do _root.nextframe, but i would prefer to have all control within the root
View 1 Replies
Sep 24, 2010
A.swf has an empty_mc on it's stage. Loading into the empty_mc is B.swf.B.swf plays C.flv. After the C.flv is done playing I want B.swf to tell A.swf to go to frame 3
View 2 Replies
Jan 22, 2011
if someone decompiles my code, do they see my comments?
View 1 Replies
Jan 11, 2009
I have set up a nice video site for a client. I have a sub menu where you can select swf files. Each swf has an FLV attatched to it. I prefered this method over XML for various reasons.In any case I would like after the swf has loaded, and the flv COMPLETES the entire movie, to automatically go to the next swf file and start that flv. I've tried many codes with no luck.
View 2 Replies
Jan 12, 2009
Im using an instance of the FLV PLayback component, how can I find out if the video is finished so I can then do another function?
View 2 Replies
Apr 9, 2009
I'm using Actionscript 2 for this interactive.This is what I'm trying to get a button to do:on release:check "mainmovie1" mc on main timeline.If "mainmovie1" mc's timeline is at frame labeled "finished" go to label "1.0" on main timeline If not, go to label "fake_1.0" main timeline
View 2 Replies
Sep 7, 2009
i have a client who wants to make a school system on his website, now i've done that, however what my client wants is to put wmv or flv files inside every lesson and he wants to be sure that the user who has registered to the online school WATCHES fully all the wmv or flv and then redirect him to a quiz page where he will take a test.My client wants to be sure that the users are watching the wmv or flv files before doing any quiz.SO is there a way where i can know when the wmv or flv file has FINISHED playing so that i would redirect them to another page??
View 1 Replies
Dec 30, 2009
I have an swf loaded into my main swf. So far I can get a button in the loaded swf, to link to a frame in my main swf. However, how can I let my main swf know when the loaded swf has finished playing?Here is my code so far:
Code:
stop();
var imageRequest:URLRequest = new URLRequest("dylanTalking1.swf");
var imageLoader:Loader = new Loader();
[code]....
But it does not seem to work.
View 13 Replies
Feb 16, 2010
I'm making a flash movie (in cs4 as2) with some textboxes that should enter the stage when a button is being clicked. I have made one box that works the way it should, and now I'm about to make several boxes that looks similar (different size/different text though). Is there an easy way to make a copy of the finished textbox, or should I duplicate every object in it to make new ones?
View 4 Replies