[Flashcoders] scoping issue (?) with static, recursive function

2007-04-24 Thread me myself
Okay, so I have an FLA with a series of embedded movieclips: garden tree branch twig flower. I want a static function -- in an as 2.0 class -- that, when given flower, returns tree. In other words, you can give in an embedded movieclip and it finds that clips ALMOST outermost parent.

Re: [Flashcoders] scoping issue (?) with static, recursive function

2007-04-24 Thread Andy Herrman
You need a 'return' before the recursive call: class com.research.StaticRecurse { public static function getOuterMostParent(mc:MovieClip,mcRoot:MovieClip):MovieClip { if (mc._parent._name == garden) { trace(inside getOuterMostParent:

Re: [Flashcoders] scoping issue (?) with static, recursive function

2007-04-24 Thread me myself
duh! Thanks, Andy. On 4/24/07, Andy Herrman [EMAIL PROTECTED] wrote: You need a 'return' before the recursive call: class com.research.StaticRecurse { public static function getOuterMostParent(mc:MovieClip,mcRoot:MovieClip):MovieClip { if (mc._parent._name ==