[Flashcoders] recursive question?

2009-01-14 Thread Mendelsohn, Michael
Hi list... I have two functions, where either an X is rendered, a Y is rendered, or both an X and a Y. removePrevious() is called before anything gets rendered, so as to clear the stage. The problem is when both are rendered, removePrevious() is called twice. It first clears the stage, renders

RE: [Flashcoders] recursive question?

2009-01-14 Thread Merrill, Jason
. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Mendelsohn, Michael Sent: Wednesday, January 14, 2009 2:28 PM To: Flash Coders List Subject: [Flashcoders] recursive question? Hi list... I have two functions, where

Re: [Flashcoders] recursive question?

2009-01-14 Thread Taka Kojima
I would probably just do something like... private function renderAxis(which:String, doRemove:Boolean = true):void if(doRemove){removePrevious();} switch (which) { case (X) : xAxis = new Sprite(); addChild(xAxis);

RE: [Flashcoders] recursive question?

2009-01-14 Thread Merrill, Jason
...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Taka Kojima Sent: Wednesday, January 14, 2009 3:09 PM To: Flash Coders List Subject: Re: [Flashcoders] recursive question? I would probably just do something like... private function renderAxis(which:String, doRemove:Boolean

RE: [Flashcoders] recursive question?

2009-01-14 Thread Mendelsohn, Michael
Interesting answers, Jason and Taka. Thanks very much! In migrating to AS3, I guess I have to be reminded about simply removing the child. - MM ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

RE: [Flashcoders] recursive question?

2009-01-14 Thread Mendelsohn, Michael
Oh trust me Jason, there's *plenty* more going on besides blank things. :-D - MM Right Taka, thinking the same thing, and I was just assuming he was doing something more (not shown) in the draw function other than just adding the child - otherwise, you're just adding blank things to the screen.

Re: [Flashcoders] recursive question?

2009-01-14 Thread Taka Kojima
List Subject: Re: [Flashcoders] recursive question? I would probably just do something like... private function renderAxis(which:String, doRemove:Boolean = true):void if(doRemove){removePrevious();} switch (which) { case (X) : xAxis = new Sprite