Hello,
I cannot figure out why the Flex designer does not update my component
when I change my caption property in the designer. The caption should
simply set a label's text property, but it only works during run-time.
Any advice on what's wrong with the code below is greatly appreciated.

Cheers,
Morten

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas  xmlns:mx="http://www.adobe.com/2006/mxml"; width="100"
height="100" >
     <mx:Label id="lbl"/>
     <mx:Script>
         <![CDATA[


             private var _caption: String = "";
             private var labelChanged : Boolean = false;

             public function get caption(): String {
                 return _caption;
             }

             public function set caption(value:String): void {
                 _caption = value;
                 labelChanged = true;
                 invalidateProperties();
             }


             override protected function commitProperties(): void {
                 super.commitProperties();
                 if (labelChanged == true) {
                     lbl.text = _caption;
                     labelChanged = false;
                 }
             }

         ]]>
     </mx:Script>
</mx:Canvas>


Reply via email to