12 Replies Latest reply on Sep 10, 2010 7:19 AM by Arun Ganesh

    how to handle getter and setter in flex?

    pad_birk Level 1

      i want to create getter and setter methods for a shared variable. how to create using bindable?

       

      and how to call that getter and setter from a model class?

       

      for ex:

       

      1) In IDMLEditor.mxml file

       

      [Bindable] public var currentDoc:IdmlDocument = null;

       

      private var _currentDoc:String;

       

      [Bindable]

      public function get currentDoc ():IdmlDocument {

      return currentDoc;

      }

       

      public function set currentDoc (idmlDoc:IdmlDocument) {

      this.currentDoc = idmlDoc;

      }

      2) how to access from EditorModel.as?

       

      public class EditorModel {

       

      [Bindable] public var currentDoc:IdmlDocument = null;