I also facing the same memory problem.As you said in this case it works fine. But my case i am not loading images instead i load swf file which has sound embeded to the timeline as stream.
According to this code, same memory management performs well for me also. but the sound in the unloaded swf is still audible and when i load the next swf, these all sounds mix up and i don't hear anything properly.
To avoid the sound problem i added a line SoundMixer.stopAll() to getaway the problem, but after i added this line memory management got lost and my system gets hanged.
I've coded a 2000 line game on one actions layer (facepalm*) and I just recently learned about the GC (garbage collector). I've looked around a bit and can't, how to trace the source of it. There is an interesting article that mentioned event listeners and for every addEventListener there should be a removeEventListener. My game has 60 adds and only 15. What I can't make sense is that the mc's that have the event listeners are never removed, but just moved off of the stage. Others are just made invisible. So if the event listener is added once, why would the memory keep growing? (I'm using the Windows Task Manager to monitor this). Another point was to remove objects so that the GC can do its work. What I did was create an object, add it to an array then null it.
Then removed the object from the array. for ( var ii:int = 0; ii<instanceArray.length - 1; ii++ ) { stage.removeChild(instanceArray[ii]); delete(instanceArray[ii]); instanceArray[ii] = null; }
I was using a trial edition of flash builder 4 professional and I figured before it ran out I would test the profiler. What shocked me was the number of objects that were left resident in memory. After seeing that I decided to set up a small test and had very bad luck. I was hoping someone can look at the following and tell me assumption i have that is just wrong.
I used to write programs in the android sdk for google phone. One of the android developers guide that I read says that it is more efficient to declare a const public static const NO:String = "no";
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.
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.
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?
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?
As stupid as my question might sound, i have spent the last 2 weeks reading oop books; but could use some guidance. I have a flash project that is basically a supped up slide show. On the stage i have the following: main_mc (instance name = images_mc) = movieclip which holds "pictures" ui1 (instance name = ui1_mc) = user interface that allows user to draw on picture (when drawing is enabled) ui2 (instance name = ui2_mc) = activates invisible hit areas (buttons) on select pics, when hit area is clicked, we jump to another pic in the main_mc.
I accomplished all of this on the timeline, but am updating the code to OOP. I am having A HELL OF A TIME trying to figure out how to store references to the instances (images_mc etc..), so i can control them from varying class files. I have found it is easy to control the instances from the documentclass, but not from unrelated class files. Example: images_mc.stop(); works in document class; but ovieclip(Parent).images_mc.stop() doesn't seem to work from any class file.(ui2 class file for example);
I'm looking for a workaround to the "AdSense does not let you choose only images but no flash" issue. I'm rather a newbie to JS, but is there any way for one script to prevent other scripts embedded in a site from detecting the presence of the flash plugin? Even if it doesn't work with AdSense, it would be nice to know if there's a hack to do this that might work in other settings.By the way, I suppose I wouldn't care if it failed to work on IE or obsolete browser versions.
Got to the point where the hole in my AS3 knowledge is getting large!Realising I have confusion about the relationship of:Body of code on first frame of AS3 file.(Which I have so far used to create instances of library objects using addchild and make calls to class code).Is this code called the document code? What do people call it?Numerous classes linked together by extending each other etc.Library objects (usually graphical objects)Should it be done differently? have the following problems due to lack of understanding:Addchild complicated from a class but straight forward in main body code.Cant call functions on the main body code from classes, because class code does not know the main body code exists?
I'm looking for some help converting as3 code to pixelbender code in an attempt to improve the performance of my application. This as3 code goes as follows. I scan through the Number values of a bytearray in chunks. Lets say this chunk lenght was 100 numbers I read 2 numbers (left and right) and try find the maximum values. The numbers in my bytearray are PCM data so there is millions of them and this code can often take a long time to execute, especially on a low spec machine.
The whole aim of this is to render a waveform as quickly as possible. I know very little about pixel bender. I can basically make a new file and create a shaderJob of it in flash but I'm really uncertain how to approach this...
Right now I'm using Flash CS3 and, as my animation projects get to be a few thousand frames with four or five characters each with around 15 layers or so, things start getting really slow. I'll be getting CS5 tomorrow and I'm wondering how much RAM CS5 is capable of handling. I'd really like to speed things up. Or, as a side question, are there any tricks people use to keep things running fast once the timeline gets fairly long?
I was playing a flash game when a friend of mine showed me some Cheat Engine trick where you can search for integers in a flash game. eg your score is 100. To find the score, you'll need to search for the value 800 in Cheat Engine—this is probably a popular trick nowadays.I've never played with Cheat Engine before, but I understand that it's a memory editor? I thought it had something to do with bits and bytes; 8 bits = 1 byte, but I'm not sure at all.why you multiply by 8?
I'm using an online charting program written in flash. I have Flash 10 and IE8. Each time it draws a chart, my available physical memory decreases. On my WinXP Pro machine with an i7 processor and 4G RAM I can draw ~20 charts before available memory decreases to 1.6G and IE locks up. On my laptop with WinXP Pro, Core 2 Duo and 2G RAM with Flash 10 and IE7 I can draw about ~40 charts before available memory decreases to 160M and IE locks up. It seems that the only way to get the memory back is to close and then reopen the tab. Is this common to Flash or was this program poorly written? Would I have better luck with another browser
have been making a digital portfolio that I plan on putting up as a website. Once before the project has gotten very large (at the time 500megs). Now this originally large project had gotten to the point where it was telling me there wasn't enough memory. What I did to fix this was copy and paste all the frames from each scene into several new projects and then piece those new projects together to remake my complete project.
I am now doing this again but at this point piecing back the last scene of mine is taking up too much memory. I have 4 gigs of memory on a 3.06 GHz intel core 2 duo imac. first off, should this be happening? Should 4 ghz be enough? second, it appears that flash projects tend to compile a lot of baggage; is this true? Thirdly, is there any way I can fix this without buying two more 4 gig memory cards?
I have created a swf interactive content, but I notice that the more I click on the buttons, the more memory it consumes, how can I prevent flash consuming my memory instead of closing the entire flash and reload it again?
Just curious, if I have a sprite on the stage with the alpha set to 0 does that take up just as much memory as a sprite that is visible? I imagine it does because it draws the sprite to the stage and then it has to set the alpha to zero.
I am building a website which loads some collada objects for each area. But I couldn't manage to clean the memory. It seems impossible to kill the objects.
I've found some samples implementing destroy() methods for away3d internal classes, but they're not working as well.
I'm making a photo browser. I load 15 photos as Images and add these Images to HGroup every time. When user presses 'next page', I first unload the existing Images by 'Image.unloadAndStop()' and 'Image.source=null', and then load new photos. However, it seems that the GC never works. The task monitor shows that the memory use of my AIR reaches as much as 1.2G! Some people said it's a bug of Image when you load a picture larger than 1.5M. Is it true?
I have a loader SWF that runs some code in the background and loads other SWFs. Using this code:
private function loadScreensaver():void { screensaverSWF = new Loader(); var req:URLRequest; switch(areaNumber){
[code]....
I load the screensaver and add it to the stage. Using MonsterDebugger I can see that memory steadily rises from around 80mb upwards until the application exits (Im using windows projector). What I can't work out is why, there is no code attached to the screensaver SWF, just some timeline animations of things fading in and out.
EDIT:I've kept testing and found where I have an image that starts of stage then tweens on and off and is removed. When it loops it adds to memory again, as if the first image is still kept. This is all done on the timeline.
I have 3-4 3 sec flv files and I need to play them multiple times I dont want to import the flv's and I cant load them dynamically everytime. can I load them at the beginning of my swf ONCE and play it anytime I want ?
How much memory in bytes can Flash normally handle? I have a fairly involved program that is running at 39MB usage and now may be causing some memory issues (I'm not sure it's the memory, since it was running smoothly up until I made a few code changes and now Flash freezes after making those changes). But anyway, I have been wondering about memory usage and Flash CS3 and felt like this was a good topic to dicuss. Is there a way to force an increase in available memory for Flash?
I am doing a flash getting data from mysql. My Database is quite big (200+MB) with lots of datas. here is my problems, after using my flash for some searching, maybe because of calling mysql to get too much data (like getting 900 records with their names and images), my memory usage increase to over 2 GB. Thus my flash is dead. I need to restart it. Is there any ways to reduce the memory usage?? Or it might be some other problems. I am quite new at my job, so it might be something that I forget to close ot remove.
Right now, I'm doing a lot of byte write operations, and I believe this is taking up a bunch of memory, which is then throwing an error. Is there anyway to flush some unneeded memory every now and then? It's not flushing the memory every time I run it in the fla either.
So I was wondering does it cost extra memory when I import vector art stuff from Illustrator (CS5) to Flash (CS5) rather than making the shapes in Flash? Maybe Illustrator sends some meta data as well when importing so it may use more memory.
I'm been working on a large-scale Flash game for the past 13 months, and a few months ago I was encountering an error message when trying to export saying, "Error creating Flash movie. There was not enough memory available." Here is a screenshot <url...> This isn't due to large videos or photos in the file, it's because theres a huge amount of frame by frame animation, so I can't just reduce quality.
I was off of a crappy laptop so at first I just bought a new computer with tons of ram because I didn't realize the software was an issue. This did not change anything (though I can run flash with less lag).
Then, I decided to do as much optimizing as I could. After a few months, all opimization possible as been done, and I have reached the point where I get the error again.
Then, I decided to cut the main file up into smaller pieces and link them together. This worked, but now some individual pieces require too much memory and get the error.
I' making a flash file with AS2 in Flash CS3. I put a FlVPlayback in stage and let it load a couple of FLV files from my local HDD and playing continuously. I use "addEventListener" to check the current running flash movie is completed. After complete event occur, I load another flv movie to paly again.Here, I noticed that memory usage is increasing every time a new flv file is loaded and played. I heard "addEventListener" in CS3 is causing the memory leak and not being detected by GC. [code]