wesflex73 wrote:

>function dStates(delState:Array):Void {
>               
>                 for ( var i = 0; i < delState.length; i++){
>                        states.removeItemAt(delState[i]);
>                     }
>}
>  
>

Just change the line in the loop to:

states.removeItemAt(delState[i]-i);

Everytime you remove an item, all of the indexes need to be shifted left 
1.  If you remove 2 items, they need to be shifted left 2.  Becuase the 
value of i through every iteration is the number of items you have 
previously removed, i acts as the amount you need to shift by... which 
makes the calculation pretty easy.

-d



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to