A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Input Text with Events?

  1. #1
    Junior Member
    Join Date
    Jan 2002
    Posts
    24

    Input Text with Events?

    Hello,

    I have a fairly complicated HTML form that I am trying to convert to Flash MX.. The only problem is that the standard INPUT TEXT "component" in Flash MX does not support any events (onFocus, onBlur, onChange) like an <INPUT TYPE="TEXT"> does on an HTML page..

    Does anyone know of a pre-built Flash component that has these features built in to it?

    Thanks,

    Rich

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    could you use - ?
    Code:
    listen = {}
    listen.onChanged = function(field){
    myOutput.text=myInput.text;
    }
    myInput.addListener(listen);
    
    myInput.onKillFocus = function(field){
    myInput.text = "input textfield";
    }
    myInput.onSetFocus = function(field){
    myOutput.text = "dynamic textfield";
    }
    
    selection.setFocus("myInput");

  3. #3
    Junior Member
    Join Date
    Jan 2002
    Posts
    24
    Hi --

    Thanks for this code.. but I'm still a little confused..

    Lets say I have an input text, with the variable name of "CUSTOMERNAME" for example.. Is this the code I would use to assign that input text box an "onChange" event?

    listen = {}
    listen.onChanged = function() {
    // Some code for the onchange goes here
    }

    CUSTOMERNAME.addListener(listen)


    ?? Will this work?

    Thanks,

    Rich

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    Code:
    listen = {}
    listen.onChanged = function(field){
    myOutput.text=myInput.text;
    }
    myInput.addListener(listen);
    above states - whenever the text in the input field - myInput is changed,
    the text in the dynamic field - myOutput will change as well.

    as a test in a new movie, place the above textfields on a frame and add the code from the previous post

  5. #5
    Junior Member
    Join Date
    Jan 2002
    Posts
    24
    Cool I got this to work!

    Thanks for your help.

    Rich

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