ActionScript 3.0 :: Memory Leaks Eventlisteners And New Sounds?

Oct 13, 2010

Memory leaks eventlisteners and new sounds. I have written up a media player code, which does what it is supposed to do, but the System.totalMemory steadily increases with time.My code essentially consists of nested calls using EvenListeners that trigger initiation of new sounds. I call up mp3 files that load and start play and on EventCOMPLETE load the next file Example of code snippet:

ActionScript Code:

function LoadNextTheme(e:Event = null):void // set next theme
{
if (A_play)  {

[code]....

What parts of this kind of code keeps adding to total system memory?And how can I best stop that leak?

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Memory Leaks Eventlisteners And New Sounds

Oct 13, 2010

Memory leaks eventlisteners and new sounds.I have written up a media player code, which does what it is supposed to do, but the System.totalMemory steadily increases with time.My code essentially consists of nested calls using EvenListeners that trigger initiation of new sounds. I call up mp3 files that load and start play and on EventCOMPLETE load the next file.[code]What parts of this kind of code keeps adding to total systemmemory?

View 3 Replies

ActionScript 3.0 :: Identifying Memory Leaks?

Feb 23, 2007

I have an AS3 application which seems to be leaking memory slowly while running. I've been looking for a profiler for Flex 2 / AS3 and haven't been able to find one yet, in fact I saw posts from people at Adobe saying they were working on it but no release in the short term!

Does anyone have any more news on this, or more usefully have any information on a profiler or other way it is possible to find memory allocation and usage during runtime of an AS3 application? It would really help me to identify what areas of my application are leaking memory.

View 4 Replies

Flex :: Spot Memory Leaks In Profiler?

Jul 20, 2009

I have an AIR/Flex app I made, I have a few people testing it and everyone is reporting that after leaving it running for a while, it is making all there machines run very slow. It runs fine at first so this must be a memory leak somewhere. I used the profiler on this and the only thing that shows as using a substantial amount of memory is MethodQueueElement which is not a class I wrote, and I have no idea what it does, I am assuming its part of the Flex framework. I am not familiar with using a profiler so I am not sure what all I shuld be looking at, that was the only class that was high on "memory" and it said it had over 100,000 instances. If this is my problem what can I do to fix it?

View 1 Replies

Flex :: Detect Memory Leaks In Flash?

Feb 11, 2010

How do you know if your compiled SWF file has a memory leak?

Are there tools, a firebug setting, etc... to see if there is a problem? I cannot find much in the debug Flash player besides file size and loading time.

I have a large Flash application that I maintain and suspect that is using way too much memory so I wanted to measure the amount of RAM being used while it executes to find key areas to optimize.

View 3 Replies

Flex :: Track Down Memory Leaks In The Application?

Feb 14, 2011

I've been trying to track down memory leaks in our application, and keep finding myself back looking at Spark components as the culprit.

Many classes in Spark use RichEditableText for displaying their text properties (ComboBox,TextInput).RichEditableText has a local textContainerManager property, and frequently calls compose() on this.Here's the relevant abridged extract from TextContainerManager

// Line 282 - 292:
static private var stringFactoryDictionary:Dictionary = new Dictionary(true);
static private function inputManagerStringFactory(config:IConfiguration):StringTextLineFactory
{

[code]...

Line 1242 is the crucial line here, as it gives the static dictionary a reference to our component.(Note - I've checked this with the debugger to confirm which branch of the ternary gets executed.) This would prevent the instance from ever being garbage collected.

Eg: Static dictionary has a value with a reference to the instance -- instance cannot be GC'd.In turn, this would prevent any other instances which have a reference to the instance of TextContainerManager from being GC'd also.While this theory certainly matches what I'm seeing in our app, I can't beleive that there really is a memory leak in such a low-level spark component.

View 1 Replies

Flex :: Cairgrom ModuleLoader Memory Leaks?

Mar 23, 2012

I also found this topic but it doesn't fix my problem other topicI have a module loader that load other swc's but when I look at the memory off the application it seems that each time a module gets loaded the previous module doesn't get unloaded and so the memory increases..

This is how I load the modules:
<module:ModuleViewLoader id="moduleViewLoader" moduleManager="{presenter.deviceModuleManager}"

[code].....

View 1 Replies

ActionScript 3.0 :: Unexplainable String Memory Leaks?

Dec 23, 2010

I developed a game in AS2, and got a decent sponsorship deal, but I had to convert it to AS3 for them. I've been working my way through and it's pretty much done, but I've found I'm getting big memory leaks. I'm not sure if they were there in the AS2 version, but I need to clear them out in either case. I couldnt get the flex/flash builder 4 profiler to work, but I did manage to get this profiler working: (ok I can't post links, but put flashpreloadprofiler into google and you'll find it)

It does seem useful for working out where all the memory is being allocated. It lists "String" as a large contributing factor, and I've narrowed half of that down to this one simple function, and I can't understand why it would cause memory leaks. I wrote a function to check if a movieclip exists on stage, in order to then do things like hittest against it without errors if it doesn't exist. Here's the function:

[Code]...

View 3 Replies

ActionScript 2.0 :: Memory Leaks When Loading In External Swfs

Dec 8, 2009

I have a problem in that i have a holder swf which loads in other swf's externally. My problem is that the holder loads all the movies in correctly but the memory usage of the swf just keeps going up and up even though i am trying to remove the movieclip after each has finished it's run.

[Code]..

View 0 Replies

ActionScript 2.0 :: Memory Leaks In Loading / Unloading Pictures

Nov 15, 2011

I load image from url like this
Code:
imageholder = this.attachMovie("imageholder", "image", this.getNextHighestDepth());
imageholder.swapDepths(selectMenu);
loader.loadClip(uri, imageholder.bigImage_mc);
this== root, imageholder is MC that contains empty MC named bigImage_mc, selectMenu needs to be in front of loaded image (2nd line) and loader is MovieClipLoader()

Image is unloaded and removed like this
Code:
loader.unloadClip(imageholder.bigImage_mc);
imageholder.swapDepths(selectMenu);
removeMovieClip(imageholder);
but when I unload image it doesn't free any memory, and when i load new image it increase memory usage...

I even tried
Code:
System.gc();
System.gc();
after removeMovieClip(); as I found this on some website... but with no improvement

View 3 Replies

ActionScript 3.0 :: Garbage Collecting - Make Sure There Are No Memory Leaks?

Feb 9, 2010

What's necessary to do when removing an object to make sure there are no memory leaks? Do you have to remove all children? Or just remove all event listeners? Or both?

View 1 Replies

ActionScript 3.0 :: Loading / Unloading External SWF - Prevent Memory Leaks

Sep 19, 2011

Im creating a flash projector which has a holder swf with an empty movieclip. A series of external SWFs are loaded into the empty movieclip on the push of a button. Once the clip has been loaded, other external SWFs can be replaced in the empty movieclip at the push of a button. As memory leaks and garbage collection seem to be an issue, I was wondering the most memory efficient way of loading, unloading and replacing these external swfs so that memory leaks are kept to an absolute minimum.

View 1 Replies

ActionScript 3.0 :: Memory Leaks - Variable Reference Inside A Function Or Outside It?

Mar 11, 2009

I wonder what the most common reasons for memory leaks in AS3 are.First thing what I am not sure about is: is it better to have a variable reference inside a function or outside it. Will the variable be null-d automaticly inside a function or when do I have to null it and when not?I have massive problems with my game with memory leaks. I noticed I reference some of the clips of the timeline even inside my debugging clip to display propertys and this was causing collecting huge amount of memory.But even before I go into the game with bigger objects the System.memory is slowly growing and growing.I just have a socket connection and some interval loops and enter_frame events.

View 5 Replies

ActionScript 2.0 :: Use With Music Is Affecting All Other Sounds - Button Sounds And Background Sound

Apr 16, 2010

I followed the mp3player tutorial (part 3) from [URL] and got it working fine. Only problem is that the setVolume I'm trying to use with my music is affecting all my other sounds - button sounds and background sound. I'm aware of the createEmptyMovieClip/attachSound approach and got it working on my other sounds. But Lee's tutorial-mp3player is using a slight different technique, and so my normal approach doesn't quite work.

[Code]....

View 7 Replies

ActionScript 3.0 :: Synchronize Sounds Perfectly To Do A Kind Of Audio Mixer Using Different Sounds?

Feb 7, 2011

I want to synchronize sounds perfectly to do a kind of Audio Mixer, using different sounds. [URL] does it perfectly, I've been researching and researching and I just don't know how to do it! How does [URL] synchonize audio so perfectly? you can even change sounds and the new ones will come on time! How do I do that? Is it just Action Script? or something else?

View 1 Replies

Actionscript 3 :: Greensock LoaderMax Memory - Clean The Memory Which Been Occupied By The Previous Queue

Jan 31, 2012

I have a bit trouble with LoaderMax memory occupy, i have a queue, and i am keep loading images depend on user's action. if they click load more and it keep load, but i would like to clean the memory which been occupied by the previous queue (i have remove all the children been added by the loading previously). is there a way i can do it? the behavior like this.

[Code]...

View 1 Replies

ActionScript 3.0 :: Memory Monitor That Allows To See The Memory Leaked And Find Its Location?

Sep 26, 2010

I have an FPS monitor running and notice that I am getting choppiness here and there, bringing my game from 40 to 27 fps and back and forth at certain stages. I have an idea of where it is happening, but do not know for sure. I looked up quite a few memory monitors but haven't found anything decent yet. Is there a memory monitor that allows you to see the memory leaked and find its location? If not, how about just he memory leaked?

View 4 Replies

ActionScript 2.0 :: CS3 Getting Sounds To Start Again After Using Stop All Sounds

Nov 29, 2009

I have a film with 4 scenes in it: Here's a link to the film and as you can see the film does not play the music the second time because of the StopAllSounds function which is probably the wrong code to use. The first scene is just a button with 1 frame, a stop action and a music clip. The second scene is the film. The third scene is the credits fourth scene is a Play again button. I have a Stop all Sounds action on the fourth scene because if I do not use it and I press the Play Again button, the music from the first song keeps playing but also the music from the film starts up again so it starts to play twice. What I want to know is, how do I get the music to stop at the end of the film but start up again once I hit Play Again?

I am using Flash CS3 if that helps and using Actionscript2.

View 2 Replies

ActionScript 2.0 :: Memory Management - Take Less Memory For Scrolling

Aug 2, 2007

I'm making an isometric game and I need to know which takes less memory for scrolling, making everything invisible that you can't see? Like if(!this.base.hitTest(worldHitter))this._visible = false; Or would it be better to remove the movieclips unseen and then reattach them when i should see them?

View 2 Replies

Flex :: Flash - Total Memory Usage And TaskManager Memory Usage Are Different?

Aug 24, 2010

I wrote an application in flash AS3, and when I trace from flash the total memory usage of the total application is only about 9MB, But at the same time Task Manager Shows the memory usage as 110MB. Around 100MB difference.Flash Trace Method System.totalMemory difference of the Trace from the Beginning of the application to end of the application.

View 2 Replies

ActionScript 2.0 :: Necessary To Remove EventListeners?

Mar 6, 2009

Let's say I have a global SoundChannel object, and inside a function I am repeatedly creating new instances of the Sound object to play songs one after the other. Each time I do this, I need to add a new eventListener to the SoundChannel to call the function 'onSoundComplete' that will load the next song on completion.Coming from a strict C++ programming background, I often wonder if it's necessary to do some kind of cleanup in Flash, or if it handles it automagically.Here's example code that specifically removes the eventListener from the previous Sound object everytime a new one is created, but I don't want to be doing this if it isn't necessary:

Code:
// Setup sound object buffer
var slc:SoundLoaderContext = new SoundLoaderContext(3000);

[code].....

View 8 Replies

ActionScript 3.0 :: How To Remove The Eventlisteners

Aug 16, 2009

I have images loading from an array. A slideshow. This works fine, but they pile on top of each other. I cannot figure out how to remove them. what's the simplest way to remove them? How do I say - if pic1 is loaded, before loading pic2, remove pic1?

Code:

var aPics:Array=new Array("pic1.jpg","pic2.jpg","pic3.jpg","pic4.jpg","pic5.jpg");
var threeSeconds:Timer=new Timer(3000,aPics.length);
threeSeconds.start();

[code]....

View 3 Replies

Flash :: Using Eventlisteners In Classes?

Dec 15, 2011

I'm trying to use an eventlistener in a class, but I can't make it work!

The class is ment to handle a HTTPRequest, so I'm using ResultEvent.RESULT.

public class GetXML
{
public var content:Object;
public var url:String;

[Code].....

View 2 Replies

ActionScript 3.0 :: Add EventListeners To Shapes?

Feb 7, 2009

Can I add eventListeners to shapes ?

View 2 Replies

ActionScript 3.0 :: Add EventListeners To Bitmaps?

Apr 18, 2009

Trying to add EventListeners to Bitmaps.Can I add an EventListener directly to a bitmap?If I load an image to a UILoader then addEventListener to the UILoader instance that works just fine, but if I use a Bitmap instead, nada...I could load the Bitmap into a Sprite and add the EventListener to that, but would prefer the direct method...

View 4 Replies

ActionScript 3.0 :: EventListeners For Input Text?

Nov 11, 2009

Is there a way to listen for the cursor in the input text field? I am making a form, and when the user clicks on the input box I want text to appear to the right side and than fade when they leave that text field.

the text field is called input_txt;

psuedo code

input_txt.addEventLister(event.MouseEvent, showText);
function showText(evt:MouseEvent):void{
text_mc.visibile = true;
}

View 8 Replies

ActionScript 1/2 :: Run Time MovieClip EventListeners?

Jun 6, 2009

I'm working on an image gallery which builds dynamically at runtime, simple enough.imageList is an array loaded with the images to display.

var imageList:Array = _root.images.split(",");var imageArray = new Array();var count = 0;for( var i = 0; i < imageList.length; i++ ){  _root.createEmptyMovieClip("myMC"+i, (i + 1)); _root["tmpMCL"+i] = new MovieClipLoader();  imageArray[i] = new Array();  ima

[code].....

View 6 Replies

ActionScript 3.0 :: Pass Parameters Through Eventlisteners?

Jun 11, 2010

Inside a .fla file I have some buttons and each button will tween a different image to the stage. All the images are outside the stage in the same x and y position and I just need to tween the x coordinate.

Now I'm working with an external document class where I'm trying to hold all my functions and I'm stucked with the Tweens. I'm willing to stay away from the flash tween engine and I'm trying to work with tweenLite.
 
Is it possible to pass parameters through eventListeners so I can use something like this inside my docClass?
 
public function animeThis (e:MouseEvent, mc:MovieClip, ep:int):void { //ep stands for endPoint.
TweenLite.to(mc, 2, {x:ep});
}
 
If this is possible, how am I supposed to write the listeners so it will pass the event to be listened for AND those parameters? And how to build the function so it will receive those parameters and the event?

View 23 Replies

Actionscript 3 :: EventListeners In Nested Functions?

Mar 12, 2012

I've got a few MouseEvent listeners outside of a function that contains nested functions that need to use the functions attached to the listeners.

button1.addEventListener(MouseEvent.ROLL_OVER, buttonOver);
function navigation (): void {
if statements;

[code]....

I keep getting an "1120:Access of undefined property buttonOver" error. I know it's because the EventListener is outside of the function "navigation" but I need it to be accessed by other functions later.

View 5 Replies

ActionScript 3.0 :: Talking To MovieClips From EventListeners?

Aug 13, 2009

im trying find out a value of a var from a mc called from an eventlistener.

//////////// as2 oldSchool ////////////
function loadPlayer() {
trace("myScene: "+this.myScene)

[code]...

View 3 Replies







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