3 Replies Latest reply on Dec 11, 2008 11:18 AM by Newsgroup_User

    Is it possible to refer label functions to a function contained in a class

    nikos101 Level 2
      Is it possible to refer label functions to a function contained in a class. eg

      labelFunction = myClass.formatFunction

      This would save me repeating code.
        • 1. Re: Is it possible to refer label functions to a function contained in a class
          Level 7

          "nikos101" <webforumsuser@macromedia.com> wrote in message
          news:gge4nd$h5v$1@forums.macromedia.com...
          > Is it possible to refer label functions to a function contained in a
          > class. eg
          >
          > labelFunction = myClass.formatFunction
          >
          > This would save me repeating code.

          Yes, but you might want to consider just creating a custom toString().

          HTH;

          Amy


          • 2. Re: Is it possible to refer label functions to a function contained in a class
            nikos101 Level 2
            As my applications grow I'm finding it more and more appealing to starting moving my common funcitons into classes, functions like this for example:

            private function dateFilterFunction(item:Object):Boolean
            {
            var t:Boolean = false;
            if(item.valueDate.time >=slider.values[0] && item.valueDate.time <=slider.values[1]){
            t = true;
            }
            return t;

            }

            Can Other developers share their experiances of doing things this way please ;-)
            • 3. Re: Is it possible to refer label functions to a function contained in a class
              Level 7

              "nikos101" <webforumsuser@macromedia.com> wrote in message
              news:ghrj6p$m8l$1@forums.macromedia.com...
              > As my applications grow I'm finding it more and more appealing to starting
              > moving my common funcitons into classes, functions like this for example:
              >
              > private function dateFilterFunction(item:Object):Boolean
              > {
              > var t:Boolean = false;
              > if(item.valueDate.time >=slider.values[0] && item.valueDate.time
              > <=slider.values[1]){
              > t = true;
              > }
              > return t;
              >
              > }
              >
              > Can Other developers share their experiances of doing things this way
              > please
              > ;-)

              I don't see where that makes sense as a class method. Could you provide
              more details about how you're using this?