Flex Tip of the Day #5: Bindable property
If you use [Bindable] property then do not forget to put semicolon at the
end of all the declaration before the [Bindable] property, otherwise
compiler will throw error . I have given three different scenarios below.
Code 1: Compliler will throw error for missing semicolon
<?xml version=”1.0″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml“>
<mx:Script>
<![CDATA[
private var myNum:Number= 4
[Bindable]
private var myStr:String = “HelloWord!!”
]]>
</mx:Script>
<mx:Button id=”button1″ label=”{myStr}” width=”100″/>
</mx:Application>
Code 2: Complier will not throw any error for missing semicolon.
<?xml version=”1.0″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml“>
<mx:Script>
<![CDATA[
[Bindable]
private var myStr:String = “HelloWord!!”;
private var myNum:Number= 4
]]>
</mx:Script>
<mx:Button id=”button1″ label=”{myStr}” width=”100″/>
</mx:Application>
Code 3: This is the correct one. I have put semicolon*
<?xml version=”1.0″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml“>
<mx:Script>
<![CDATA[
private var myNum:Number= 4;
[Bindable]
private var myStr:String = “HelloWord!!” ;
]]>
</mx:Script>
<mx:Button id=”button1″ label=”{myStr}” width=”100″/>
</mx:Application>
. As I learn new stuff and pickup interesting stuff from around the internet and the other Flash/Flex Gurus out there, I store them here in this blog so that I can always check back for stuff filled away safely.

thanks