files at this link: www.lindaweller.net/forum/prototype_cs3.zip Hello:
First you click the rotating star button 3 times. Then you have new assets on the stage. Reset button removes assets from the stage. Once these assets are removed by the reset button when you click the spinning star again *you cannot re-create the assets again.*(assets are polygons and the greeting) Here is the error I am getting : *Error* RangeError: Error #2006: The supplied index is out of bounds. at flash.display::DisplayObjectContainer/removeChildAt() at AddATree2/onClear() (I purposely set out of range because otherwise everything is removed including the bg(background). reset is at index 2 and -at bottom of the screen mcAdd is at index 1 -this is the rotating star button 1 bg is not index 0. Not sure why this is. Below is the code snippet that is the problem area:* Also: SEE ATTACHED FILES to see the code for the star button in AddATree2.as file. files at this link: www.lindaweller.net/forum/prototype_cs3.zip CS3 version Any feedback about they way it was coded is appreciated too. Let me know if I can clarify anything. I really need some help on this. thx, really appeciate your response. Best, Flashon_LA. ------------------------------------------------- //when you click the reset button everything is removed from the stage except the star and reset button private function onClear(event:MouseEvent) { //mcAdd.mouseChildrenEnabled = true; // trace(getChildAt(0) == bg); // text filed and reset button var . add text field so you can remove it below when the card is reset addChildAt(reset,1); //this removes everything var count:int = numChildren; for(var i:int = 0; i<count; i++) { removeChildAt(3); //set this out of index range on purpose to force it to work. //addChildAt(reset, 0); removed components individually?? } //var bg = new bg(); //addChildAt(bg, 0); addChildAt(mcAdd, 2); addChildAt(reset, 1); } _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders