2 Replies Latest reply on Feb 2, 2009 9:05 AM by Gregory Lafrance

    Bindable variables

    istrasci Level 1
      This is beginner question that I suppose I should know the answer to by now, but when you declare Bindable variables in AS or <mx:Script>, do you have to explicitly do it for each variable, or does the [Bindable] tag apply to everything after it...? I hate doing it for each one because it takes up unnecessary space in my code! </complaining>
        • 1. Bindable variables
          levancho Level 3
          you can declare whole class bindable and than everything inside is bindable,
          but be carefull bindable is somewhat expensive feature, I would suggest not using it extensively unless you really need to use it, sometimes its better to write one extra line instead of using [Bindable] ..
          but , on the other hand, for remote Classes you need to make whole class bindable.

          • 2. Re: Bindable variables
            Gregory Lafrance Level 6
            One other note, from the FlexBuilder help:

            When you use the [Bindable] metadata tag before a public class definition, it only applies to public properties; it does not apply to private or protected properties, or to properties defined in any other namespace.

            You must insert the [Bindable] metadata tag before a nonpublic property to make it usable as the source for a data binding expression.