A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Make my button appear

  1. #1
    Senior Member
    Join Date
    Mar 2002
    Location
    Eindhoven
    Posts
    123

    Make my button appear

    Hello all,

    Okay, so this is what I’m looking for. I have an input text field. As soon as somebody enters any information in this text field a button should appear. I have the text field and I have the button but I have no idea how to get this interaction.

    Can anybody help me.

    Thanks.

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Location
    IT
    Posts
    213
    Hi digibit, I suppose the best way is to use listeners.

    If you're using a 'textinput' component, just use this script:

    var my_ti:mx.controls.TextInput;
    // my_ti --> is the name of the text input
    var tiListener:Object = new Object();
    tiListener.change = function(evt_obj:Object) {
    trace("show me that button");
    };
    my_ti.addEventListener("change", tiListener);

    You'll find more informations about this in the flash help, just look for TextInput.change

    If you want to use your own text input, I'd just use a Key.listener:

    var myListener:Object = new Object();
    myListener.onKeyUp = function() {
    if (nameOftheTextInput.length>=1) {
    trace("show me the button")
    }
    };
    Key.addListener(myListener);

    In this case any time a key is pressed the listenet will check for the lenght of the text input

    That's all
    Hope it helps

    Giano

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