0 Replies Latest reply on Mar 23, 2010 1:44 PM by yruan

    States RemoveChild with Repeater?


      I have a repeater going over an arraycollection and adding in child components


      <mx:Repeater id="rp" dataProvider="{dataProvider}">

           <mx:Label id="label1" text="{rp.currentItem.mydata1}"/>

           <mx:Label id="label2" text="{rp.currentItem.mydata2}"/>



      in my "edit" state, I need to remove the 2nd one.


      you can't do this because it complains that label2 is an array and you're trying to coerce it into a displayObject.


           <State name="edit">

           <mx:RemoveChild target="{label2}"/>



      since label2 is inside a repeater, it must mean it creates an array of labels all having the id "label2" for as many there are in dataProvider.


      so how do i remove all label2's?