Solved

Deleting Objects in flex

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Video Playback in Flex Mobile App 4 1,444
Adobe Error Message - kenlly.dll 7 666
parse string in as3 2 332
Adobe live streaming 8 688
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…
In  today’s increasingly digital world, managed service providers (MSPs) fight for their customers’ attention, looking for ways to make them stay and purchase more services. One way to encourage that behavior is to develop a dependable brand of prod…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

746 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

13 Experts available now in Live!

Get 1:1 Help Now