"Bindable" capability does not work in all situations

114 views Asked by At

When I try to set the width of a BorderContainer to a bindable variable in Flex tags declaration it works well. Code looks something like this:

<s:BorderContainer id="mainContent" left="0" right="0" top="0" bottom="0" backgroundAlpha="1" backgroundColor="0xfee6ca" 
                               borderVisible="false">
                <s:layout>
                    <s:VerticalLayout/>
                </s:layout>
      <s:BorderContainer id="containedBc" width={mainContent.width} />
    </s:BorderContainer>

When I try to change the width of "mainContent", the width of "containedBc" is updated also.

But when I try to add the "containedBc" BorderContainer from an actionScript class, the width of "containdBc" does not vary when I try to change mainContent's width. Can you explain me why this? And how to resolve it?

1

There are 1 answers

0
artaxerxe On BEST ANSWER

When need to use bindable capability from actionscript3, you can use BindingUtils.bindProperty(...) function. Hope to help you:)