2 Replies Latest reply on Feb 22, 2007 4:35 PM by Newsgroup_User

    Form - FormItem - FormItemLabel

    Level 7
      Hi everybody,

      I've got an issue with a form. The form is rotated at an angle, and I
      used embedded fonts to render everything. Everything looks good, but, I have
      some labels that are being truncated. However, they have enough space to be
      displayed, I would like to use the truncatetofit from FormItemLabel, but I
      cannot find a way to access this class through the FormItem. As a matter of
      fact, I have no clue how to use that class at all.

      So if anybody can give me some guidance it will be greatly appreaciated!

      Thank you,

      JG


        • 1. Re: Form - FormItem - FormItemLabel
          JabbyPandaUA Level 3
          Extend FormItem class to your own to get access to truncatetofit property from Label component inside FormItem.

          From 'FormItem.as':
          --------------------------
          mx_internal function get labelObject():Object
          {
          return labelObj;
          }
          • 2. Re: Form - FormItem - FormItemLabel
            Level 7
            FYI here is how I did it. I couldn't manage to override and of the
            labelObject functions.....

            package com.projectbeachball.containers {
            import mx.containers.FormItem;
            import mx.controls.FormItemLabel;

            public class myFormItem extends FormItem {

            public function setMyLabel():void {
            for ( var i:Number = 0 ; i < rawChildren.numChildren ; i++ ) {
            if(rawChildren.getChildAt(i) is FormItemLabel) {
            var myLabel:FormItemLabel = FormItemLabel(rawChildren.getChildAt(i));
            myLabel.truncateToFit = false ;
            }
            }
            }

            override protected function commitProperties():void {
            super.commitProperties();
            setMyLabel();
            }

            }

            }




            "JabbyPandaUA" <webforumsuser@macromedia.com> wrote in message
            news:erjg61$efa$1@forums.macromedia.com...
            > Extend FormItem class to your own to get access to truncatetofit property
            > from
            > Label component inside FormItem.
            >
            > From 'FormItem.as':
            > --------------------------
            > mx_internal function get labelObject():Object
            > {
            > return labelObj;
            > }
            >