Re: [Flashcoders] Why doesn't this work addChild removechild

2011-04-23 Thread Paul Andrews
On 22/04/2011 18:35, Steve Abaffy wrote: Quick update Function{ Var Mort: MovieClip = new Mort(); Try{ removeChild(Mort); }catch(e:Error){ // Do nothing; } addChild(Mort); } This function is called multiple times and each time it adds the child

[Flashcoders] Why doesn't this work addChild() removeChild()

2011-04-22 Thread Steve Abaffy
Hello, Why doesn't this work?? In the same function Var Mort:movieClip = new Mort(); addChild(Mort); removeChild(Mort); I get this error The supplied DisplayObject must be a child of the caller. ___ Flashcoders mailing list

Re: [Flashcoders] Why doesn't this work addChild() removeChild()

2011-04-22 Thread Deepanjan Das
Hi Steve, This is because of timing. You are trying to remove an object which has not completed its addChild actions. Hence its not getting the instance when removing. Warm Regards Deepanjan Das W: http://deepanjandas.wordpress.com || Om Manasamarthadata Shri Aniruddhaya Namah

Re: [Flashcoders] Why doesn't this work addChild() removeChild()

2011-04-22 Thread Kerry Thompson
Steve Abaffy wrote: Why doesn't this work?? In the same function Var Mort:movieClip = new Mort(); addChild(Mort); removeChild(Mort); I get this error The supplied DisplayObject must be a child of the caller. It's likely that Mort hasn't had time to instantiate. Either that, or

[Flashcoders] Why doesn't this work addChild removechild

2011-04-22 Thread Steve Abaffy
Quick update Function{ Var Mort: MovieClip = new Mort(); Try{ removeChild(Mort); }catch(e:Error){ // Do nothing; } addChild(Mort); } This function is called multiple times and each time it adds the child Mort, but I want to remove the one placed

RE: [Flashcoders] Why doesn't this work addChild() removeChild()

2011-04-22 Thread Merrill, Jason
Coders List' Subject: [Flashcoders] Why doesn't this work addChild() removeChild() Hello, Why doesn't this work?? In the same function Var Mort:movieClip = new Mort(); addChild(Mort); removeChild(Mort); I get this error The supplied DisplayObject must be a child of the caller

Re: [Flashcoders] Why doesn't this work addChild removechild

2011-04-22 Thread Kerry Thompson
Steve Abaffy wrote: Quick update Function{ Var Mort: MovieClip = new Mort(); Try{ removeChild(Mort); }catch(e:Error){ // Do nothing; } addChild(Mort); } This function is called multiple times and each time it adds the child Mort, but I want to