Hi,

Any reason this may fail (ie the box isn’t turned form black to red) when 
clicking on the button?

I can see that parseStyles is working correctly and returning 
{background-color: "red”} and I can see that a stylesChanged event is being 
dispatched.

Is it a bug or is there another way you are expected to change styles in FlexJS?

<?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"
                xmlns:comp="comp.*">

    <fx:Script><![CDATA[
        public function clicked():void {
            box.style = "background-color:red";
        }
        ]]></fx:Script>
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl/>
    </js:valuesImpl>

    <js:initialView>
        <js:View>
            <js:VContainer>
                <js:Container id="box" width="100" height="100" 
style="background-color:black" />
                <js:TextButton text="Click me" click="clicked()" />
            </js:VContainer>
        </js:View>
    </js:initialView>

</js:Application>

Thanks,
Justin

Reply via email to