Mailing List
Home
Flash Pro
Extending Flash
Flash Macromedia Developer
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
memory management - removeMovieClip /

memory management - removeMovieClip /

2004-02-24       - By Cédric de Crozant

 Back
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

afaik, this short example shows that :
- we should delete mc references variables after removeMovieClip() to avoid
holding broken ref vars in mem.
- (ref==undefined) won 't work if we don 't delete the ref manually after
removeMovieClip()
- removeMovieClip() correctly deletes onEnterFrame events affected to an
instance.


trace( "##START ");
trace( "_global.myRef_mc= "+typeof _global.myRef_mc);
trace( "onEnterFrame= "+typeof _global.myRef_mc.onEnterFrame);
//
_global.myRef_mc=this.createEmptyMovieClip( "my_mc ",10);
trace( "##CLIP CREATED ");
_global.myRef_mc.onEnterFrame=function(){};
trace( "_global.myRef_mc= "+typeof _global.myRef_mc);
trace( "onEnterFrame= "+typeof _global.myRef_mc.onEnterFrame);
//
_global.myRef_mc.removeMovieClip();
trace( "##CLIP REMOVED ");
trace( "_global.myRef_mc= "+typeof _global.myRef_mc);
trace( "onEnterFrame= "+typeof _global.myRef_mc.onEnterFrame);
//
delete _global.myRef_mc;
trace( "##REF DELETED ");
trace( "_global.myRef_mc= "+typeof _global.myRef_mc);
trace( "onEnterFrame= "+typeof _global.myRef_mc.onEnterFrame);


cedric.

-- -- Original Message -- --
From: "ryanm " <ryanm@(protected) >
To: <flashcoders@(protected) >
Sent: Monday, February 23, 2004 1:27 PM
Subject: Re: [Flashcoders] memory management - removeMovieClip /


> > If m has some event associated like onEnterFrame I delete the
> > handler BEFORE deleting my instance like:
> >
> > delete m.onEnterFrame;
> > delete m;
> >
> I believe that removeMovieClip cleans everything up for you. Of course
> it only works for movie clips, but it should clean up any events or
> properties attached to the clip.
>
> ryanm
>
>
> =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
> Supported by Fig Leaf Software
> =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
> Be sure to check the archives and the wiki:
> http://chattyfig.figleaf.com/
> =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
> http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:104961
> =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
> To unsubscribe send a blank e-mail to:
> Normal Mode: flashcoders-unsubscribe@(protected)
> Digest Mode: flashcoders-digest-unsubscrive@(protected)
>
>


=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:105024
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)