Solved

Deleting Objects in flex

Posted on 2012-04-11
1
364 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 Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
google maps with flash 1 371
html into FLEX 3 264
Flex Mobile: Get Gps Coordinates 6 1,348
Consuming WCF in Action Script 3 [ flash Develop ] 3 294
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…
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now