3 Replies Latest reply on Oct 6, 2009 5:02 AM by Michael19871987

    TextBox

    Michael19871987

      Hi,

       

      i need to set the width of a textbox. But somehow "textbox.width = 300;" doesn't work.

      Can smbd please tell me how to do that.

       

      Thanks in advance

        • 1. Re: TextBox
          RossRitchey Level 4

          textbox.width = 300; should work IF

           

          1. "textbox" is the instance name of your object

          2. You are using ActionScript 3

           

          If you are using AS2:

           

          textbox._width = 300; will work

           

          If "textbox" is not the instance name, change "textbox" to the instance name.

           

          If you haven't set an instance name yet, you can do this by selecting the object on stage and entering it into the instance name field on the properties palette.  (At the top of the palette in CS4, or on the left side under the drop-down in all prior versions)  Then, replace "textbox" with what you entered.

          • 2. Re: TextBox
            thil

            it is as2 or as3? if its as3 this will work...as2 we need to write like that _width..

            • 3. Re: TextBox
              Michael19871987 Level 1

              It's as3 but it seems like a bug, i really don't get it. I got this txtfield and an mc where i draw the border of the txtfield. And i set the same values.

              It woks fine with the mc, but the texfield somehow doesn't take this value.

              So when i do smth like that:


                   txtfield.width = 200;

                   trace(txtfield.width.toString());

               

              it traces me a value of 350.

              How is that possible?

               

              Thanks guys