Solved

Deleting Objects in flex

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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FLEX 3 LineChart doubt 4 280
DropDownList Skin 5 1,263
AS3 Image Edit Package 3 562
Flex Mobile: Get Gps Coordinates 6 1,358
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…
The business world is becoming increasingly integrated with tech. It’s not just for a select few anymore — but what about if you have a small business? It may be easier than you think to integrate technology into your small business, and it’s likely…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

820 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