Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Deleting Objects in flex

Posted on 2012-04-11
1
Medium Priority
?
414 Views
Last Modified: 2012-04-11
I have a calendar which i toggle between the view of Day Week and month using ViewStack
I want to delete the previous view objects or unused memory when i am in an other view
all the views are custom components, which are loading several child objects at a time.
when i navigate frm day to month view the objects of the child view are still persisted.
I used removechild() method, but its not actually deleting the obj, but keeoing its reference.
which method is used to delete the unsused objs explicitally.
0
Comment
Question by:shaku111
1 Comment
 
LVL 11

Accepted Solution

by:
petiex earned 2000 total points
ID: 37835006
Flash has a "garbage collection" facility that deletes objects, at some indeterminate point, provided they are no longer referenced by any active variables or event listeners. Actionscript doesn't let you directly remove anything from memory. It just gives you the opportunity to make objects eligible for garbage collection. For this reason, it's a good idea to make event listeners weak (set the 5th argument in addEventListener to true) and/or to use removeEventListener when/if they become unnecessary.

To make an object eligible for garbage collection, the best you can do is to set to null any class-level variables (properties) on it or referencing it, and to use the delete operator(?) with each dynamically declared property of it, if, like the Object class, it supports dynamically declared properties.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Your business may be under attack from a silent enemy that is hard to detect. It works stealthily in the shadows to access and exploit your critical business information, sensitive confidential data and intellectual property, for commercial gain. T…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question