Hi,

Of course directly calling applyStyles like like means you don't need to use 
binding at all.

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
               xmlns:js="library://ns.apache.org/flexjs/basic">

  <fx:Script><![CDATA[
      import org.apache.flex.core.ValuesManager;

      public function clicked():void {
          bg.backgroundColor = "red";
          updateBoxStyles();
      }

      public function updateBoxStyles():void {
          ValuesManager.valuesImpl["applyStyles"](box, bg);
      }
      ]]></fx:Script>

  <js:valuesImpl>
      <js:SimpleCSSValuesImpl/>
  </js:valuesImpl>

  <js:initialView>
      <js:View>
          <js:VContainer>
              <js:Container id="box" width="100" height="100">
                  <js:style>
                      <js:SimpleCSSStyles id="bg" backgroundColor="grey" />
                  </js:style>
              </js:Container>

              <js:TextButton text="Click me" click="clicked()" />
          </js:VContainer>
      </js:View>
  </js:initialView>

</js:Application>

Thanks,
Justin

Reply via email to