I'm having problems with a binding issue.  I'll dumb down my component
a bit in hopes to make this easier.  I have a component, MyComponent,
based on Canvas.  This Canvas has objects placed around in it and some
effects base on what the user clicks.  The dynamic part is that there
is one spot in MyComponent where I can pass in an object for display.

code snippet of MyComponent:

<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml";
creationComplete="init()">

   <mx:Script>
      <![CDATA[
         import mx.core.UIComponent;

         [Bindable] public var itemComponent : UIComponent;

         private function init() : void
         {
            if ( itemComponent != null )
            {
               addChildAt(itemComponent, numChildren);
            }
         }    

So you can see I'm simply adding what ever I give to itemComponent as
the last object.  That works just fine and when this is rendered I see
MyComponent as well as my dynamically added component.  Here is the
problem.  I'm adding a VBox with a Repeater that has it's dataProvider
bound to an ArrayCollection.  When I modify the bound
ArrayCollection the view in MyComponent does not change.  I moved the
VBox outside of MyComponent to make sure that it was behaving
correctly and it is.  Changing the bound ArrayCollection changes the
VBox.  As soon as I place it back into MyComponent, it does not change
any more.

Here is a code snippet of how I am creating MyComponent in mxml:

<comps:MyComponent width="100%">
   <comps:itemComponent>
      <mx:VBox width="100%" height="100%">
         <mx:Repeater id="myRepeater" dataProvider="{myList}">
            <mx:Text text="{String(myRepeater.currentItem)}"/>
         </mx:Repeater>
      </mx:VBox>
   </comps:itemComponent>
</comps:MyComponent>

Any advice on how to have the changes to the VBox (based on {myList})
update in MyComponent would be appreciated.

Thanks,
Dale

Reply via email to