RE: [Flashcoders] Display Object Container refresh ...

2009-02-20 Thread Cor
Nice(r)

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Weyert de
Boer
Sent: vrijdag 20 februari 2009 14:35
To: Flash Coders List
Subject: Re: [Flashcoders] Display Object Container refresh ...

var n: Number = container.numChildren;
while ( n-- ) {
   container.removeChildAt(n);
}

sounds better ;) less problems when you start from the bottom is my 
experience.
> You have a class with a public DOC (DisplayObjectContainer).
>
> This DOC contains all the visual assets of your class.
>
> In you refresh/reset/constructor method, do you use either:
>
> container = null;
>
> or a loop to manually remove all display objects within the container, eg:
>
> if (container != null)
> {
> if (container.numChildren > 0)
> {
> for (var i = 0; i < container.numChildren; i++)
> {
> container.removeChildAt(i);
> }
> }
> }
>
> Um ... that's it.
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
>
>   

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.0.237 / Virus Database: 270.10.25/1957 - Release Date: 02/19/09
18:45:00

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Display Object Container refresh ...

2009-02-20 Thread Weyert de Boer

var n: Number = container.numChildren;
while ( n-- ) {
  container.removeChildAt(n);
}

sounds better ;) less problems when you start from the bottom is my 
experience.

You have a class with a public DOC (DisplayObjectContainer).

This DOC contains all the visual assets of your class.

In you refresh/reset/constructor method, do you use either:

container = null;

or a loop to manually remove all display objects within the container, eg:

if (container != null)
{
if (container.numChildren > 0)
{
for (var i = 0; i < container.numChildren; i++)
{
container.removeChildAt(i);
}
}
}

Um ... that's it.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


  


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Display Object Container refresh ...

2009-02-20 Thread SJF
You have a class with a public DOC (DisplayObjectContainer).

This DOC contains all the visual assets of your class.

In you refresh/reset/constructor method, do you use either:

container = null;

or a loop to manually remove all display objects within the container, eg:

if (container != null)
{
if (container.numChildren > 0)
{
for (var i = 0; i < container.numChildren; i++)
{
container.removeChildAt(i);
}
}
}

Um ... that's it.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders