A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: createTextField - can it trigger a Function?

  1. #1
    Senior Member
    Join Date
    Jan 2001
    Posts
    122

    createTextField - can it trigger a Function?

    Hi, by creating text field with createTextField, is there a way that on clicking/releasing the text field a function will be triggered (an event handler) - i want to creat dynamically textFields so that clicking on them will trigger/activate a function.

    Each of the text field has a different parameter to pass to the function.

    Thanks in advance,
    Maya.
    Maya Malimovka

  2. #2
    Keeper of Brooms and Jars
    Join Date
    Oct 2001
    Posts
    456
    If i were you I would put an mc about the size of the text box behind the textfield and assign it functions using the press/release handlers. An easy way to do this would be to create a movieclip with both the hit dection mc and the text field inside. Then you can drag and drop as many of these as you need (or use attachMovie). Be sure you get the paths to the variables correct - in nesting mcs and textfields, sometimes the paths get obscurred. Just be deliberate and think it through. If all else fails, come back to the board.
    *smiles, waves*

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Posts
    122
    Thanks, this is the way it is implemented at the moment, i was thinking maybe thre is a way of doing it evolving only the textField.
    I guess not... :-(

    Thanks again.
    Maya Malimovka

  4. #4
    Keeper of Brooms and Jars
    Join Date
    Oct 2001
    Posts
    456
    well, you could try an onMouseDown handler and then check to see if the mouse is within the bounds of the textfield. although ive never tried a getBounds on a textfield, i dont see why it shouldnt work.
    *smiles, waves*

  5. #5
    Senior Member
    Join Date
    Jan 2001
    Posts
    122
    Thanks
    Maya Malimovka

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