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
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
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
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
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
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
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
7 matches
Mail list logo