ActionScript 3.0 :: Game Runs Slowly And The Sound Effects Began To Lag?
Oct 22, 2010
I am trying to play sounds in my Flash gameAt times, the game runs slowly and the sound effects began to lagI noticed that all of the sound effects that are played using AS3 sound and soundChannel objects (which are held in an array and are triggered by a Click Event listener function) are lagging worse that sound effects which are played from within MovieClips timelines (These MovieClips are played using gotoAndPlay() which is called by a different Click Event listener function.) I am wondering why this is happening. I assume that anything done within Actionscript would be processed faster that anything done on a timeline.
View 0 Replies
Similar Posts:
Jul 23, 2011
I've been working on a flash game, and recently added in sound effects. However, the sound effects only seem to play the first half-second of the audio file whenever I call on them to. I have been using the standard code.
ActionScript Code:
on (rollOver) {
if (_global.sound) {
_global.SFX1.start(0,1);
}}
But the sound effect only plays through a small amount of the audio. Also, the sound effects are not very stable, and will only play the butchered audio if there is some time in between clicking on several buttons. The odd thing is that I took the same code to another flash file, and the audio played through all the way with no problem, not requiring any additional time to play the sound effect again. I used the same code to load the sounds, which is
ActionScript Code:
onClipEvent (load) {
_global.Music1 = new Sound();
Music1.attachSound('Music1');
_global.Music2 = new Sound();
Music2.attachSound('Music2');
[Code] .....
View 8 Replies
Jan 19, 2010
I have a swf with 5 buttons (the number of buttons doesn't matter). Each button calls pictLoader to load a jpg and the percentTxt to show the percentage. Everything runs perfectly if I wait each jpg to load completely before clicking other buttons.But clicking another button to perform a second load by the same Loader before the first one is complete, doesn't kill this first load. The swf finally shows the right jpg ( the second one ) but the download runs slowly because it is downloading both jpgs.
Code:
var pictLoader:Loader = new Loader();
pictLoader.y = 70;
addChild(pictLoader);[code]....
Here I click 3 buttons in sequence. As we can see, despite the Loader will show just one jpg ( the last call ) it is downloading 3 !!
View 1 Replies
Mar 3, 2011
I get a working application in Flash made that lets the user click to create blocks which subsequently gravitate towards the mouse. I made the exact same thing in Processing too, just to compare speeds.However, when I run the Flash version and add around 15-20 blocks, the framerate drops to 5-10 FPS.In the Processing version I can add ~60 with no noticeable slowdown. What's the deal, Flash?
Links to each version's source:
Flash version
Processing version
Here is the source for each in case you are a wizard and can help just by glowering at the code sternly and telling it to behave:
Flash version:
blocks.fla
import flash.events.Event;
import flash.display.MovieClip;
[code]....
View 1 Replies
Jul 29, 2011
Ive stumbled upon a few sites that have free sound FX's but the ones I want which I wuld think are the easiest to get I cant find.I want a sound for when someone clicks the right thing, like a under a sec tiriring or something like when you kill a guy in Leauge of Legends or something like that and also one for when you click the wrong thing like an windows warning ut a little different, yet all the sites and SFX I come across are for everything but those.
View 5 Replies
Jul 22, 2009
This is an issue that I've run into over and over again, and it just drives me insane. Whenever I make a game which stays on one frame for a while (lots of dynamic objects are made, particle effects, bla bla), the framerate very very slowly starts to drag. After a few minutes, it's at about half what it started at, and it steadily drops until the game is unplayable.I use some variation of the following code to clean up dead movieclips:
Code:
e.currentTarget.visible=false;
e.currentTarget.removeEventListener(Event.ENTER_FRAME, moveThing);
e.currentTarget.parent.removeChild(e.currentTarget);
I guess I should mention that I do contain references to the movieclips in arrays, but I splice them out. Is that ok?I'm almost positive that somehow Flash is still keeping track of my old movie clips, even though I feel like I'm getting rid of them. Is there something wrong? Do I have to do some extra special magic to totally banish them forever? Please help. This has been driving me insane.
View 4 Replies
Feb 28, 2006
I have made a plattformgame in flash, and after I had published it I tested it (local) when it was embedded in a browser, and it hacks and laggs! But when I play it in the flash player it works just fine.
I removed all the heavy graphics, lowerd the fps to 30fps and removed all the code so now its just the bassis left (gravity, collision, key checking etc. and yes u should bounce on the walls giving a wall jump effect).[URL]
View 4 Replies
Apr 1, 2011
Basically what happens is 5 eggs fall from the top of the screen. What I'm trying to have happen is, to have flash recognize when all 5 have been clicked and goto and stop on frame 3. The other problem is I want the animation to reset when the timer runs out. Thus clearing all current eggs off the stage. I've zipped the 2 files I'm working with the (fla and as files).
View 3 Replies
Mar 8, 2009
Since my project uses class actionscript files my whole game project runs on one frame and nothing is on the maintimeline so there is only just one frame on the timeline. Just wondering how I could make it so that I could have the first frame with game instructions and a description which then goes into the game being second frame and when gameover goes to third frame using actionscript. or any tutorials or some peice of advice
View 3 Replies
May 12, 2010
Well, the title said everything, I saw some very nice effects using After Effects, but I want to apply those to a Flash game.. will it be useful?, or After Effects only works on cut scenes, animations, etc?
View 1 Replies
Aug 24, 2009
I am need a wide range of sound effects for flash projects.
View 3 Replies
Sep 26, 2009
Yeh, does any 1 know where i can find good non-copyright music? I have search araound on google, but i wanna check here, i am scared of virus and im not that person some download whithout ceck if its virus on the site or not...
So: Do you know where i can get much on-copyright music and soundeffects whithout virus???
View 2 Replies
Aug 14, 2009
I'm playing around with the new Sound API in flash player 10 and I managed to load a mp3 from HD, extract it's bytearray and let it play. While playing I can play around with the pitch in realtime.
Now I want to add distortion, bass and echo on the sound, the only thing is I'm not a music specialist. I don't know the mathematics behind the effects.
View 3 Replies
May 13, 2009
I'm working on a pause feature for my game and the only issue giving me trouble is how to pause/restart the sound effects and music that is being played in various classes.
I do understand how to record the position when stopping and then play from the new position. All code examples are based on a single sound being played at a time.
I have multiple channels to handle music and for various sound effect categories (so the volume may be controlled separately).
Currently, all of the channels are all in a single class but the sound effects they are assigned (.play commands) are executed within each class (Bullet, Enemy, Tank, etc...)
I'm sure other developers have experience with sound effects in various classes as well... so how did you handle pausing multiple channels and then restarting all of the same sounds that were playing previously?
View 3 Replies
Apr 22, 2011
my sister asked me to do smth for her that let me scratch my head: she wants to make a signature text in a forum and wants to add sound to this signature so when her post is shown the sound will play in background together with her text signature.
I'm not sure this could be done in flash? is there a way to have some jpeg image with sound effect? or should it be a video? maybe forums restrict adding a flash doc as a signature?
View 2 Replies
Apr 10, 2008
AS2 Trying to figure out to add sound effects to my buttons (which are actually mcs) in this file. I'm familiar with adding sound effects to "regular" buttons using the button state frames, but I have no idea how to go about adding them to these buttons (for rollovers and clicks). My FLA file can be found and downloaded here: [URL]..
View 1 Replies
Nov 30, 2003
I have an animation that plays a couple of different sound effects (depending on what button is pushed). I have a checkbox that I would like to use to turn on/off the sound effects. I have read somewhere that it is possible to set up sort of a global sound that if stopped, stops all sound effects. I have tried to set this sort of thing up but no success . When I test getValue() of my checkbox it seems to work (defaulted to true) but nothing happens when I uncheck the box. What am I doing wrong? p.s. In what forum would I make the suggestion to have a new category for just sound problems? Does anyone else think it would be a good thing to sequester sound issues in their own category?
View 8 Replies
Aug 2, 2009
I downloaded an image from the web and brought it into Flash. I then created a new layer and began tracing over the image with the pen tool. When all was said and done, I went to use the paint bucket tool to fill in the sections of the paths I created. My only problem is I can't fill the image. I click and click and no color is being filled. I tried converting the selection to both movie clip and graphic symbols and I still can't fill it in.
View 6 Replies
May 28, 2009
I have made a javascript/flash system to play sound effects on an AJAX-based game I have made. For some reason, on some systems (it appears to be just Firefox 3 on Windows XP), users can only hear the sound effects play while the window is in focus. If they minimize the window or are looking at a different window the sound effects don't play.
View 8 Replies
Apr 28, 2010
I'm feeling a bit low now as I have been suffering this for months. A simple loader loads my simple game and runs VERY FAST on even slow pcs BUT when I build this other loader, it goes quite slowly and I don't know where the app is going wrong. WHERE is the processing consumptoin coming from out of my app.
[Code]...
View 1 Replies
May 19, 2010
We have a bug in one game whereby the sound of the word repeats. Even when we use stopAllSounds - the sound is still kept in memory and you can hear it in the next activity - it's a disaster and kids get real angry.
View 3 Replies
Nov 7, 2009
I have a flash template in Flash AS - 2 , with a initial sound that triggers at the very beginning in full sound. Now what I want to slowly mute the sound gradually step by step up to the loading of the home page. How can I do that? Worthless. I attached a very simple fla with sound. There is a stop action and at this point the home page is loaded.Now how can I mute the sound slowly upto this point.
View 5 Replies
Nov 7, 2009
I have a flash template in flash AS-2 with a initial sound that triggers at the very beginning.
Now what I want to slowly mute the sound gradually step by step up to the loading of the home page. How can I do that?
View 3 Replies
Jan 3, 2012
So i am trying to insert a sound inside a class of my game. In the constructor function i declare the variable private var retDamage3:Sound = new Sound();
and in the place i want it to play i put this code retDamage3.load(new URLRequest("sfx/destruirbarra.mp3"));
retDamage3.play(); Except it gives the error:
View 1 Replies
Apr 22, 2005
Any tutorials on adding right and wrong sounds to a game? Im making this game where on a wrong answer there is a wrong sound and on a right answer a right sound! How to get the code to do this!
View 1 Replies
Jul 5, 2011
I'm currently making a flash game and to insert sound. The sound effect has to play everytime the character touches the coin yet the coin still has to be able to unload. I never used sound before in flash.
View 1 Replies
Apr 26, 2011
I am currently having a problem with Flash CS5. I am trying to link a sound file to my Flash game without having to put it on the stage. It would play when my character got hit by an enemy. The problem is is that when I go to edit the properties, all of the options except to play the sample are all blanked out. This is currently driving me insane as I have done everything I could think of to get around this.
View 1 Replies
Oct 17, 2009
I'm making a tycoon game and have a few queries to do with controlling sound. I have two buttons, one is my play button playBTN and my other is my stop button stopBTN. Now i want to play the song mainSong using actionscript from the second frame, but I also want to play the song without it going over the top after you release playBTN.
P.S: I'm sure the stopBTN code is:
ActionScript Code:
on(release){
[code]......
View 5 Replies
Feb 12, 2012
Any examples of ActionScript 3.0 code that deploys any kind of sound files to be used in Flash Pro files, for final output as SWF. I am using the code (below) for the Base class of a Bubble Game (of sorts), and the problem is, that when popped, the sound plays a little too late, not spot on.
This is my code - which is linked to the Bubbles in the library of my FLA:
package {
import flash.display.*;
import flash.events.*;
import flash.media.Sound;
import flash.net.URLRequest;
public class BubbleBaseNew4 extends MovieClip {
[Code] .....
View 1 Replies
Mar 16, 2011
I am trying to develop a simple game for kids in which an Alphabet will be spoken and the kid will have to choose the correct alphabet being displayed on the screen. What I have tried to do is that I have saved each of the sound in a seperate movieclip.
how can I develop the code that randomly choose a movieclip to play the sound and then when the kid click on the correct alphabet, it adds the point and if wrong alphabet is clicked, it gives error.
View 6 Replies