Solved

Deleting Objects in flex

Posted on 2012-04-11
1
369 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 500 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AdvancedDataGrid 4 354
flex simple crossdomain problem 1 843
AS3 parent function 3 671
Adobe upload listbox 2 498
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…
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

776 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