A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: problem disabling input text field

  1. #1
    Member
    Join Date
    Mar 2009
    Location
    Pune
    Posts
    62

    problem disabling input text field

    I have an input text box. When the the number of characters entered in this text box reach a certain limit, i want to disable the text box.
    my code -

    import flash.text.TextField;
    if(charCount == maxCharacters)
    {
    message_txt.enabled =false;
    }

    but i am getting the error
    1119: Access of possibly undefined property enabled through a reference with static type flash.text:TextField.
    how can i disable the text box?

  2. #2
    Señor Member Mavrisa's Avatar
    Join Date
    Oct 2005
    Location
    Canada
    Posts
    506
    Input text fields cannot be disabled. You must use a textfield component to change the editable propery. Either that or in actionscript create a TextField instance and change its 'type' property from input to dynamic.
    If you want, you can always set the 'maxChars' property to set the maximum number of characters in the field, if that is what you were trying to do..

    Hope that helps,
    Mavrisa
    Last edited by Mavrisa; 03-13-2009 at 05:06 PM.
    Haikus are easy
    But sometimes they don't make sense
    Refrigerator

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center