Assuming View.scene.children is a standard Vector as the documentation
suggests, you can give this a try instead:

while(View.scene.children.length > 0){
View.scene.removeChild(Object3D(View.scene.children[0]));
}

It's been quite a long time since I've actually been using away3D so I
could be wrong or you might have to adjust the code a bit. I tend to
stay away from while() loops but they're the most effective when you
want to clear all children of a display object (or a similar function)
and don't tend to cause issues or lock up the player. If in fact if
you were to do run the same code as you provided to clear all children
of a standard MovieClip, you'd find that most of the time it wouldn't
clear all children anyway but in the case of a while loop it certainly
does. Anyway hope that helps.

On Mar 2, 10:26 am, originaltomato <[email protected]> wrote:
> hi guys,
>
> away 3.6 how to remove everything from the scene?
>
> i'm trying this
>
> for each(var ch in View.scene.children){
> View.scene.removeChild(ch);
>
> }
>
> but it's not working

Reply via email to