I was trying a lot, but not knowing the correct English phrase (I am Dutch :-)) to look for, I failed. Recursion was the big helper here.
And no, the 10 minutes were not wasted! You did a good deed! THANK YOU! regards, Cor -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Paul Andrews Sent: zaterdag 13 november 2010 17:58 To: Flash Coders List Subject: Re: [Flashcoders] How to iterate through arrays On 13/11/2010 16:44, Cor wrote: > OK, I think I figured it out. > > function findIndex (psdArray:Array, psdButton:Object, psdLevel:uint):void { > > for (var i:uint=0; i< psdArray[psdLevel].length; ++i){ > var curBtn:uint = psdArray.indexOf(psdButton); > if(curBtn == -1){ > ++psdLevel; > //recursie > findIndex (psdArray[psdLevel], psdButton, psdLevel); > } > } > trace(psdArray[psdLevel], psdButton, psdLevel); > } LOL, that's ten minutes of my life wasted because you didn't try before asking... > Regards > Cor _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Geen virus gevonden in het binnenkomende-bericht. Gecontroleerd door AVG - www.avg.com Versie: 9.0.869 / Virusdatabase: 271.1.1/3249 - datum van uitgifte: 11/10/10 20:34:00 _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

