Pipan
10-28-2007, 12:07 AM
When I create an instance from a class, lets say like this:
circle = new Circle("blue");:
box.addChild(circle);
and later want to replace the blue circle with a green, how can I do?
I mean the application doesnt always know if a circle have been added
or not before.
So if I try this:
box.removeChild(circle);
circle = new Circle("green");:
box.addChild(circle);
...I get an error if there was no circle-instnce there allready.
So how do I solve this?
Thanks.
circle = new Circle("blue");:
box.addChild(circle);
and later want to replace the blue circle with a green, how can I do?
I mean the application doesnt always know if a circle have been added
or not before.
So if I try this:
box.removeChild(circle);
circle = new Circle("green");:
box.addChild(circle);
...I get an error if there was no circle-instnce there allready.
So how do I solve this?
Thanks.