ActionScript 3.0 :: Unload Swf From Memory After <div> Is Hidden
Dec 8, 2009
I tried a search but it keeps saying I failed the No Spam when I didnt get a question - d'oh. Ok, this has probably been covered before, but a lot of research hasn't got me far, so I thought I'd post. I have a single page html site with several links that load up a homebrewed lightbox. The inline content is written out at the bottom of the page and the divs are set to hidden.
When a link is clicked, the light box loads and the correct <div> is set to visible. The flash plays, or is interacted with but when the user has finished, they click an html Close button and the div is hidden again. Obviously the swf is still loaded and running; it could be even mid animation. The more swfs loaded, the more memory that is taken up.
My development machine can handle the 600mb + used up by have a few FF windows open and a couple of copies of the site; but I imagine it will cause problems for users. So I've been looking into externalInterface to fire a command into the swf to close itself down when the close button is clicked, but I can't seem to find anything
Selecting - buttonOne- loads the external "galleryOne.swf" file as expected, but when buttonTwo is selected it should unload the "galleryOne.swf" file that is currently loaded in the container and load the "galleryTwo.swf" file in its place.
when buttonTwo is selected it loads the "galleryTwo.swf" file and you see it for just a second, but the "galleryOne.swf" file returns to the display.
Does unloadMovie remove the targeted file from the flash player memory? It not, how do I dump it?
I'm struggling to understand this, so I'm hoping someone can explain how to further enhance the functionality of my simple unload function, or maybe just point out some best practices in unloading external content. The scenario is that I'm loading and unloading external swfs into my movie(many, many times over) In order to load my external content, I am doing the following:
I am trying to unload a class from memory using the following experiment:Create a shape on stage, make a movieclip out of it, add a trace in the first frame, extend the movieclip to be about 40 frames, give the movieclip a linkage name "test" and remove it fromstage.Experiment 1:Add the following code to the stage:ActionScript Code:var mcl = new test();Publish the movie. You should see the trace statement showing up all the time.Now I wish to delete this instance.Experiment 2:ActionScript Code:delete mcl;gives an error that it cannot delete a fixed property and have to set it to null instead.Experiment 3:
ActionScript Code: mcl = null; No error, but still see the repeating trace output.
I'm having real problems with unloading external SWFs, I've spent 2 days looking for a solution and looking at this forum and using the code supplied and Flash help files and much much reading and trying, I still cannot achieve the desired results.I have a Menu.swf which hosts many buttons which loads External SWFs ... simple enough and fairly common.These External SWFs are the same size as the menu and so loads completely over the top of Menu.swf which is exactly what I want to happen.I have a button on these External SWFs which I want to, delete the External SWF from the Flash player's memory and remove all event listeners (which I guess will happen if the External SWF is deleted from memory)The reason why I want it to remove the movie completely from memory is that I have 18 items and by the time it loads the 18th item, the player is going slower then trying to swim in hummous.[code]
I have a menu and each button reveals a hidden layer which includes it's submenu (another swf).The submenus have sub-submenus in the same swf.When I take the mouse away from these layers the submenus hide again.All these work.The problem is that when a sub-submenu is opened and then the layer hides, when it's shown again the sub-submenu is still opened.Is there a way to clear memory or unload a swf file through html or through the main menu swf?
The application is too big to describe here, but I can tell you I have up to 20 modules or more that the client can use at any time. And if I go on loading screen after screen, my application can ocuppy 500MB and more.The script that I use to load and unload modules is:
public function createModule(modulo:String):void { if(moduleLoader != null){ moduleLoader.unloadModule();[code]..............
I can't seem to remove / unload the external swf files e.g when the carousel.swf (portfolio) is displayed and I press the about button the about content is overlapping the carousel (portfolio) . How can I remove / unload an external swf file from the main flash file and load a new swf file, while at the same time removing garbage collection from memory?
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 am working on a school project that requires me to load external .swf or .jpg files. I currently have all of the buttons working and are loading an external .swf file on to the screen. The problem I am having is that when I go from one button to the next the loaded .swf stays on the screen and the next .swf gets loaded on top of it. I know that I need to unload the file but I am not sure where to put the code for the unload or what code exactly to use. I would like when the button is pressed to unload the previous loaded .swf and load the new .swf without having a separate button to unload.
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?
I'm trying to unload an external SWF on _root to load a new one instead. I've tried (almost) everything but can't figure it out... I get this error : "Error #1010: A term is undefined and has no properties."
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'm attempting to unravel a Flash template and there are two Flash movies, Main and Magazine, the second being embedded into the first. The Magazine Flash file contains a menu of links to various pages in the Magazine movie. There are 5 of these links - About, Services, Contact, etc.I've been trying to find the text elements so I can assign new colors, but the only thing that I can find is the first element. Tere is a scene called menutxt which has an area with text for each of the five links but they all have the text "About" in the buttons. I would have expected each button to contain the different link names.o I was assuming that this was a standard
I'm working on a project for a presentation that has hidden buttons. I want a way that the hidden buttons can be located, if someone else has to give the presentation. I've seen an example where if the user hits the tab key it would cycle through all buttons and outline them in red. I am new to flash and action script and have no idea how to do this.
I didnt see a place in preferences to keep edges hidden. I have some text that has a dotted line around it. I can hide it with hide edges, but as soon as I select them and let go, the edges come back. maybe their not edges since theyre dotted. maybe its flash telling me somethings not set up correctly? anyone?
I'm lost, at school we use CS3 and at home I have CS4. I cannot recall how to create a hidden button. From my previous work it appears that they come from the components, however I just can't see them there on CS4. Or have I got this completely wrong and do I have to create one from scratch.
I'm working on new presentation that has hidden buttons. In the previous presentation, when you hit the tab key it cycled through the hidden buttons by outlining them in red. I'm trying to recreate that feature, but am new to Flash and Action Script. I have many books and search the web often, but can not find an example of this or how it is done
Running CS4 I have a .fla that was compiling fine yesterday. Today I made some slight additions and it wouldn't compile, giving errors saying that various things were undefined I was starting to go nuts until finally I made all layers in the timeline visible and compiled again. Now it compiles fineJust in case it was something Flash itself I created a new file, hid some layers and compiled and it was fine. So it's not the application, just this particular file.
What are some of the hidden features of MXML? What existing features are not well known but very useful?MXML being used in Flex Framework became quite popular language because Flash Player is something every PC has and Flash Builder and Flash Catalist are quite popular Adobe programs.specify one feature per answer, and read all answers before posting a dupliate.It's not always a great idea to use these hidden features; often times they are surprising and confusing to others reading your code.
In flex UI, my <mx:list> can not be shown completely because of other component shelterring (for example: the refresh button shelter part of it ). How can I make the <mx:list> in front of all other UI component.
I found a lot of interesting info in the 'hidden features of...' series. I am very new to cairngorm . What are some of the hidden features of cairngorm.
my css drop down menu is hidden behind a flash element I have on my site. I have tried changing the z index but still nothing. Please help.... here is the page.[URL]..
I have 20 indtances in my scene..named 1, 2, 3, 4 etc..and i am loading some variables pc1, pc2, pc3 etc plus more for other things.I know the variables are loading cause other bits work, but what i am trying to do thats not working is make the relative instane hidden if the corresponding variable is empty.
I have a timeline with several buttons on it - some if these are created at runtime, and some by putting buttons on the page on frame 1 I then have an emptyMC into which I import a swf that COVERS the whole stage. This all works fine - you can't see anything of the underlying material. However, as you "mouse around" it seems that the buttons that are covered are still active - pointer becomes a hand etc. I can disable the buttons using enabled=false. This is quite invloved, and I would have thought that these buttons wouldn't be active - surely they are covered! How is the possible, and is there a neater way to stop these buttons being active.