Flex :: Removing Flex DisplayObjects From View AND Memory Pool

Feb 15, 2011

There is a Flex app with 7 main views. And there is a memory issue when navigating between views.All these views were in a ViewStack, but due to some involving 3D objects I assumed it was too much to have it all in the display list. I'm now clearing all children from the stack and adding/removing them when needed. This gave a small performance increase, but still becomes unresponsive with use. The strange thing is, with this and the original method, the CPU climbs with use but eventually levels out somewhere. Now I'm creating new instances of each screen when they are navigated to and setting the previous variable to null. Now it looks like CPU is spiking when the view is created, but leveling out to something much much lower than it was. This felt like progress, but now the available memory keeps climbing where it wasn't before....

My understanding was calling remove child or remove all children would mark the object for deletion when the garbage collector next ran. I can't see any other references to the instance. My code is along the lines of [code]I have a function for each button to add a new instance like the above.The only thing I can see and feel silly asking but need confirmation, is each view extends a class called "Screen", this class contains a singleton reference to some core components.[code]Would this trick the garbage collector into thinking it was still needed? General advice on clearing Objects from the memory pool would awesome!!! I've never needed to analyze the Flash Player in such depth.I think it's an error with sound drivers, removing all sound and shes purring like a kitten. Works on my machine fine with windows XP, but not on the touch pad the application is crashing on with windows 7 (unsure of the drivers looking into them now) Now I'm thinking its not the drivers, tried 3 different versions, all with no improvement. I did discover the sound was fading in and out with the TweenLite lib. Doesn't look like there are any memory leaks in TweenLite as it works fine on other machines. Just the use of volumeEasingFunction seems to consume increasing amounts of CPU until it freaks out. It is crappy hardware running windows 7, which doesn't help.

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Memory Management With An Object Pool

Sep 8, 2009

I've been trying to figure out how Flash does its memory management regarding object declarations but haven't found anything that describes declarations themselves. [code]Basically I want a pool of declared variables that get instantiated only when a certain type is set. I'd have logic in other functions that figures out what the type is and then does certain things to it, but for now I just wanted to know what kind of memory management Flash does with something like this. Does it do nothing until I actually instantiate it (= new Object()) or will space be set aside once I simply declare it (someObj:Object)?

View 2 Replies

Flex :: Get An Access To A Flash Player`s Events Pool?

Sep 22, 2009

I want trace every event on every object, there is way to do it?

View 2 Replies

Actionscript 3 :: Implement An Object Pool For Flex Data/Item Renderers

Oct 6, 2010

You can hook into the creation of Flex 4 item renderers easily enough (through itemRenderer, or itemRendererFunction) allowing you to pull renderers from a custom object pool, but how would you put those renderers back into the pool?

I understand that layout virtualization does a form of object pooling, but I'd like a way to hook in to that. For example, when an itemRendererFunction has been assigned to a data group with a virtualized layout, item renderer construction is indeed deferred, but the instances are not re-used - I'd like to be able to intervene there, if possible.

But even in the case of normal virtualized renderers (where the instances are re-cycled) it would still be useful to be able to manage the pool manually. Pools could be shared between data groups, for example, to reduce the initial buffer required to populate each group.

Is there any way to know when Flex discards an item renderer instance? I have a sinking feeling that there is just no reliable way to tell - even though perhaps there should be.

View 2 Replies

Flex :: Adding Dynamic DisplayObjects To Canvas

Jan 5, 2010

I am adding DisplayObjects to a Canvas using
ContentContainer.addChild(c);
Where ContentContainer is my Canvas object and c is the DisplayObject I have created at run-time. Some of these DisplayObjects also have children of there own which are added at run-time prior to the DisplayObject being added to the Canvas.

I then need to iterate over all the children of ContentContainer but the first time I do this, it says that ContentContainer has no children (i.e., ContentContainer.numChildren = 0). If I do it again tho then it is fine and returns the correct number of children. Is there something I need to call to get ContentContainer to recalculate how many children it has?

View 2 Replies

Actionscript 3 :: What Is The Complementary Event Of 'show' For Flex Displayobjects

Jul 12, 2011

Since flex memory management is poor, objects once instantiated dont die very easily (even when they go out of scope), one would need to check on various properties of components. I am using one such thing to know if the screen (which is a display object) is in current view. For this I am turning on a boolean property (currently visible), and I am setting it true on show event of the display object.

What I need to know is, which event (something opposite of show, e.g left?) could be used when the screen is replaced by another display object?

Something like focusIn and focusOut from dotnet.

Or if there is some property which could directly tell me if the display object is currently in view (hasFocus doesnt seem to be giving me expected results).

View 2 Replies

Flex :: Presentation Model Pattern Can View Specific Logic Reside In View?

Aug 15, 2011

I'm currently using RobotLegs with the Presentation Model pattern to develop a Flex 4 project. I understand that all business logic related to a View resides in the Presentation Model associated with that view, however, I am confused when it comes to View specific logic.For example, I have an indicator that needs to be positioned relatively to list items depending on which list item is selected. Is it acceptable in the Presentation pattern to put the logic that will position the indicator in the View and simply have that logic run in reaction to a selectedIndex property changing in the presentation model?The reason I am considering this is that since the Presentation Model does not have a reference to the view it is difficult to come up with an ideal solution for manipulating view components.

View 1 Replies

Flex :: Change A View From Inside A View?

Jun 13, 2010

I have one .mxml file (the Application) with a ViewStack (with 4 views) and a ControlBard, obviously I can change the views with it, but what I want to do is: in view #1 I have an image which I want to convert to a "hyperlink", so when I click it I go to View #2, is this doable? Also I would like to pass somehow some data (like a String) to that View #2 (lets say the it's a user avatar I click so I want to go to the second view which will show me his profile, that's why I need his name/id).

View 1 Replies

Flex :: Taken Push View Object Into Next View?

Sep 28, 2011

My problem is that when I try to pass an object from the navigator.pushView(view, dataobject), I can't figure out how to access the dataobject from actionscript. I can access {dataobject.property} from MXML easily, but I want to set a variable in the new view to the passed dataobjects property.

View 1 Replies

Flex - Can't Find Huge Memory Leak In A Flex 4.6 Web Application?

Mar 16, 2012

I have a Flex 4.6 web game which displays 2 Lists with virtual layouts with 2 custom item renderers. The renderers consist mainly of BitmapImages displaying user avatars + few Labels.

The Lists are being updated often over TCP socket with gzipped JSON data. I merge that data into 2 ArrayCollections serving as dataProviders for the Lists. This seems to work well, the Lists do not flicker and are updated correctly (I've monitored debug traces a lot to get it right).

[Code]...

View 1 Replies

Flex :: Split View In Adobe Flex Mobile?

Nov 24, 2011

I have four views:1.SplitView (main view)2.SplitViewHomeView(root Panel)3.SimpleView(Right panel)4.Details(child of Right Panel View).I am trying to accomplish the split view as in Ipad in adobe flex mobile.But unable to connect the root panel to right panel...Can any one suggest the path to me.My Code is below

Split View
**
<?xml version="1.0" encoding="utf-8"?>

[code]...

View 1 Replies

Flex :: Customizing Flex MenuBar / Removing Hover Effect

Jan 8, 2010

Is there a way to disable the hover effects?I don't want flex to highlight the entire component for both link buttons and menu bar.On the menubar, I applied a backgroundSkin, so having flex highlight the whole menubar when the user hovers their mouse on top quitely destroys the design.

View 1 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 3.0 :: Removing Things From Memory?

Mar 27, 2008

I'll try to explain the general operation of my program, and that might shed some light on my issue. I have a menu with 50 different small postcards. When one is chosen, the program zooms it up in order to fill the screen, populates some data which is unique to each postcard, and "flips" it so you can see the writing on the back. The postcard is a movieclip which imports a front image, 3 back images, and some XML text. There are some buttons on the "back" of the postcard to choose to look at a few images and text.When you choose to close the postcard, it flies away. I use the same movieclip for all 50 postcards, and just change the images and text that I load.

Once the postcard flies away, I want to remove it from memory. It won't happen with removeChild() as that keeps it there in case I want to reference it again I guess, and I have tried setting the postcard variable name to "null" without much success.I add listeners to the buttons on the postcard when I instantiate its class, so I am not sure if I have to remove them in order to get the garbage collector to deal with it. But, I also don't know what I don't know about removing things from memory. In one section of the Flash docs (Working with display object containers) it says:

"The removeChild() and removeChildAt() methods do not delete a display object instance entirely. They simply remove it from the child list of the container. The instance can still be referenced by another variable.(Use the delete operator to completely remove an object.)"And, at another place in the docs (the script reference about removeChild()) it says:

"Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance. The parent property of the removed child is set to null , and the object is garbage collected if no other references to the child exist. The index positions of any display objects above the child in the DisplayObjectContainer are decreased by 1.

View 6 Replies

ActionScript 3.0 :: Removing SWF From Memory After Deleting From DOM

Sep 29, 2011

I'm having a problem where I load my SWF (Advertisement) into the dom after an event happens in a flash game.  After viewing the ad, the SWF is removed with JavaScript and users continues to play, this continues several times without ever reloading the page.
 
The problem I am running into is in IE 8 & 9 performance of the game drops and frame rate becomes choppy after several ads are shown.  Each advertisment has a timer built in and my thought is that the ad is not being fully removed from memory hence causing a slowdown. 
 
Is there a way to ensure a full removal of the ad or at least a way to detect within the ad that it is no longer on the page & kill the timer?

View 1 Replies

ActionScript 3.0 :: Removing A MovieClip From Memory

Jan 11, 2011

I have a function called changeMovie which is supposed to load a new movie/swf into a already established container.I can get the new movie to load (all these movies have sound embedded in them) but I can not figure out how to get the old movieclip out of memory.I can foresee an instance of memory overload in my application down the line.I am using Flash CS3 with AS3.[code]As it stands now, I can get the new movie to play and be shown but the old movie clip still continues to play "in the background - along with its sound".

View 9 Replies

ActionScript 3.0 :: Removing Object From Memory?

Aug 5, 2011

I have this line

Code:
this.parent.removeChild(this);

So basicaly the object is removing it self from the parent object,but I still think that it exisits in memory and doing its backend job.How can I remove it completely from memory?

View 8 Replies

ActionScript 3.0 :: Removing Items From Memory Using Loop?

Feb 18, 2009

The following for loop removes children from their parent if they're in the display list. It works correctly, but I also want to remove each child from memory with the same loop.

View 1 Replies

ActionScript 3.0 :: Removing Stage Items From Memory

Apr 14, 2010

I am adding few items dynamically from the library to the stage by creating instances. If I remove them using removeChildAt() then the item gets removed from the display but exists in the memory. How can I remove this from memory?

View 2 Replies

Actionscript 3 :: Removing Parent Memory Used By All The Children?

Sep 17, 2010

I'm making a rather large flash project and so I'm concerned about memory usage. At the end of each section of the application I remove the overarching parent element that holds the content. Although this remove the parent, does this also free up the memory for each of the children contained within this, or should I run an iteration to remove those prior to removing the parent?

I'll give a little more explanation in-case I'm not expressing what I want:

addChild(movie1);
movie1.addChild(movie2);
movie1.addChild(movie3);
By using this code:
removeChild(movie1);

Does it remove movie2 and movie3 from memory or are they still stored, just unlinked?

View 3 Replies

ActionScript 3.0 :: Remove Something From The Stage Without Removing It From The Memory?

Sep 29, 2009

its possible to remove something from the stage without removing it from the memory. Ie not using removieChild(); Reason being: I want to replace an image inside a movieclip rather than add another image on top or remove the image and movieclip entirely.

View 2 Replies

ActionScript 3.0 :: Removing Array Contents From Memory?

Dec 2, 2009

I'm performing the following operation many times (sniped of code below). I'm creating a two dimension array whose overall size depends on each iteration the process takes.

myArray = new Array(); // initialize the array
myArray[0] = new Array(); // add new array to first index
myArray[1] = new Array(); // add new array to second index

Question is: When I need to recreate this sequence again, do I just perform the same operation (repeat the same 3-lines)? Or is there a way of freeing up resource first.

View 3 Replies

ActionScript 3.0 :: Removing Images From Memory In A Loop

Aug 14, 2009

I've made a script which loads in, at intervals, images in a sequence (image1.jpg, image2.jpg ). However I've being doing my nut as to how to remove the preceeding image from memory as looking a the Windows Task Manager, each image gets added again and again, accumulating memory usage. I've tried removeChild, and null; stuff, but to no avail.I want it to go through the 10 images, and with each step to the next image, remove the last one from memory.[code]

View 2 Replies

ActionScript 3.0 :: Removing Unreferenced Objects From Memory

Oct 15, 2009

I'm trying to make a Starfield program as practice for ActionScript 3. I'm using a timer event in the document class to create Star objects which are defined by an object class connected to the movieclip Star in the Library. The object class has a timer as well, and at each tick it repositions itself a few points away and scales up, creating the image of a star shooting towards the sides of the stage. When the star has gone past the boundaries of the stage or when it has scaled to a certain size, it removes itself from the display list with the command: this.parent. removeChild(this);This removes the star from the display list just fine, however after that I can't get the star to set itself to null so that it will be removed from memory, and I'd like some suggestions on how to do this properly. An idea I had was to make a function in the document class that the child objects can call, something like this.parent.KillMe(this) which would give itself as a reference to the function, which could then use a local variable reference to set the child to null, removing it from memory. This all seems terribly complex, so I'm sure there's another way.

I haven't noticed a memory leak or slowdown, however, so I'm curious if objects without references that are removed from the display list are automatically removed? That could be both good and bad, as the object might want to add itself to the display list again at a later time; not in this Starfield program, but perhaps in another I write.

View 11 Replies

ActionScript 2.0 :: Removing Out Of View Movie Tile In Map?

Nov 1, 2006

I'm tiling a map using a set of tiles generated on the fly. Here's a link to the map as it is: [URL]. It's still very rough but if you hover your cursor over the right hand side it scrolls that way. The problem is, I can't get it to remove the movie tiles which are out of view so it's getting too cumbersome and sluggish. I tried swapping the depths then using removeClip() but that didn't work.

Here's how I'm adding the new tiles in case:
Code:
myDotArray[myY][myX+7] = myC.attachMovie("MapTile", sss, myC.getNextHighestDepth()+1, {_x:(myX+7)*108, _y:myY*108});
myDotArray[myY][myX+7].doDot_string(superA[(myY*40) + myX+7]);

View 1 Replies

ActionScript 3.0 :: Removing Children Produces Memory Leaking?

Apr 22, 2009

I am having memory problems when adding & removing children. Here is a brief overview of what I'm doing:I'm ading children to a VBox component:the structure of the children is:

Code:
<mx:Canvas>
<mx:Image/>
<mx:Text/>

[code]....

All remove the children, BUT I am getting memory leaking, especially using the second method! If I don't add the TextField child to the UIComponent I don't seem to experience any memory problems!

View 2 Replies

ActionScript 3.0 :: Removing A Movie Clip Properly From Memory?

Jan 21, 2011

I am having a bit trouble removing a movieclip properly from memory.In the onComplete event I use this to add the swf content to my clip

[code]....

The removeChild is double here just for savty But the trace command from the clip I loaded continues to put somthing in my output window. So it still keeps running and it isn't even stoping.

View 4 Replies

ActionScript 3.0 :: Memory Doesn't Release When Removing MovieClips

Jul 8, 2009

The app is basically an animated character that sits on screen and moves around doing stupid little animations. Each animation (Talking, Dancing, Jumping, etc) is an individual Movie Clip made up of around 50 or so PNGs in sequence. I'm using CS3 to create the clips, and exported them as SWCs for use in Flex. When I addChild() the MovieClip to stage, memory usage increases, which makes sense. However when I use removeChild() on the same clip, and then add another clip, memory increases, and this goes on with every new clip... essentially leaving 10 clips in memory even if they aren't being played.

Now, first thing you are going to think is I've got a reference to the clip somewhere and it's not garbage collecting. Well, I'm using weak listeners everywhere, and I'm pretty sure I've killed every reference by NULLing out the objects. I understand Garbage Collection doesn't happen right away... but it never seems to happen. As a test, I wrote a really bare-bones app to attach and remove a clip to see if the memory ever frees. I've left the app running for a half hour after removing the clip from stage, and memory usage stays the same:

[Code]...

View 2 Replies

ActionScript 3.0 :: Removing Loaded Objects / Events From Player Memory?

May 31, 2010

Is this at all possible? I just finished re-building my entire portfolio site in AS3 because I can't change the frame rate for loaded content in AS2. Now I find out after completely rebuilding this thing that AS2 content gets stuck in Flash Player 9's memory and won't erase on Loader.unload. All my work from years back is in AS2.

View 0 Replies

Flex :: Best View Architecture In It?

Aug 11, 2011

I have started learning flex 4 and I got myself thinking about how to change views. So I have a question what do people usually use - states or views (ViewStack). The type of web application I am making, can use both, but what do developers use in big projects or maybe they use non of the mentioned before?[code]...Best view architecture in it?

View 1 Replies







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