RE: [Flashcoders] Simplify XML Call

2011-08-14 Thread Merrill, Jason
>> What I need it to target a specific sequence of nodes. You can do that with my function as well - just pass in the sequence you want to target. Jason Merrill Instructional Technology Architect II Bank of America Global Learning ___ -Original Message- Fr

Re: [Flashcoders] Custom Event Question

2011-08-14 Thread John Polk
> From: John Polk > To: Flash List > Sent: Sunday, August 14, 2011 12:04 PM > Subject: [Flashcoders] Custom Event Question I have figured out how to do this. It requires more than just dispatching a custom event. It requires a getter as well. I took the wrong a

[Flashcoders] Custom Event Question

2011-08-14 Thread John Polk
Hi; I have this code in the class dispatching the custom event:         private function progressHandler(e:LoaderEvent):void         {             dispatchEvent(new Event(e.target.progress));         } (This is from a greensock loaderEvent.) I have this pseudo-code from the class listening fo

Re: [Flashcoders] Simplify XML Call

2011-08-14 Thread John Polk
> From: Taka Kojima > To: Flash Coders List > Sent: Sunday, August 14, 2011 4:24 AM > Subject: Re: [Flashcoders] Simplify XML Call > function getNumItems(level:int, xml:XML):int{ > var levelXML:XML = xml.menu; > for(var i:int = 0; i < level; i ++){ > levelXML = levelXML.item[whichItems[level]];

Re: [Flashcoders] Simplify XML Call

2011-08-14 Thread Taka Kojima
errr... function getNumItems(level:int, xml:XML):int{ var levelXML:XML = xml.menu; for(var i:int = 0; i < level; i ++){ levelXML = levelXML.item[whichItems[i]]; } return levelXML.length(); } On Sun, Aug 14, 2011 at 1:24 AM, Taka Kojima wrote: > I don't even know why I'm responding to this, bu

Re: [Flashcoders] Simplify XML Call

2011-08-14 Thread Taka Kojima
I don't even know why I'm responding to this, but. Ktu gave you the answer yet you seemed to ignore it? You don't need an eval at all. function getNumItems(level:int, xml:XML):int{ var levelXML:XML = xml.menu; for(var i:int = 0; i < level; i ++){ levelXML = levelXML.item[whichItems[level]]; } r