The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 6 of 6

Thread: about input text

  1. #1

    about input text

    How can I create a textbox that user can input it with number,then with a check button,it will trace ("user input")?

    Thanks.

  2. #2
    Code:
    import flash.text.TextField;
    import flash.text.TextFormat;
    import flash.events.MouseEvent;
    
    
    var txt:TextField = new TextField();
    txt.defaultTextFormat = new TextFormat("Arial",12,0x000000);
    txt.border = true;
    txt.borderColor = 0xBBBBBB;
    txt.type = TextFieldType.INPUT;
    txt.background = true;
    txt.backgroundColor = 0xFFFFFF;
    txt.width = 200;
    txt.height = 25;
    addChild(txt);
    
    btn.addEventListener(MouseEvent.CLICK, traceText);
    
    function traceText(evt:MouseEvent):void
    {
      trace(txt.text);
    }

  3. #3
    Quote Originally Posted by giobongio View Post
    Code:
    import flash.text.TextField;
    import flash.text.TextFormat;
    import flash.events.MouseEvent;
    
    
    var txt:TextField = new TextField();
    txt.defaultTextFormat = new TextFormat("Arial",12,0x000000);
    txt.border = true;
    txt.borderColor = 0xBBBBBB;
    txt.type = TextFieldType.INPUT;
    txt.background = true;
    txt.backgroundColor = 0xFFFFFF;
    txt.width = 200;
    txt.height = 25;
    addChild(txt);
    
    btn.addEventListener(MouseEvent.CLICK, traceText);
    
    function traceText(evt:MouseEvent):void
    {
      trace(txt.text);
    }
    What if I want :

    user input "241" on the textinputfield,then after press btn,external file "241.txt" can be loaded into a new textfield?

    So when I have hundred texts,I won't get confused.

    Thanks for your help.
    Last edited by eggblade; May 8th, 2012 at 08:14 PM.

  4. #4
    I want to do something similar, but don't need any external files.
    User inputs some text & presses a btn, that text gets passed to a different text field.

    Thanks, I'm scratching my head on this one...

  5. #5
    I think this is the answer you are looking for...
    http://www.republicofcode.com/tutori...3externaltext/
    Hope it helps.

  6. #6
    This simple bit of code did the trick. From kglad over at Adobe:
    http://forums.adobe.com/thread/1000821

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012