A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] Creating TextInputs With Code

  1. #1
    Member
    Join Date
    Jul 2007
    Posts
    40

    resolved [RESOLVED] Creating TextInputs With Code

    Hello. I need to create objects such as TextInputs and TextStatic with ActionScript. Each will have to have a different variable name to be referenced. Also I will need to duplicate a movie clip multiple times but have it have a different variable name each time so it can be referenced separately.
    I have tried a few things but cannot get it to work.

  2. #2
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,046
    just use the new TextField() constructor:
    Code:
    import flash.text.TextField;
    import flash.text.TextFieldType;
    
    var inputText:TextField = new TextField();
    inputText.type = TextFieldType.INPUT;
    inputText.text = "This is an input TextField";
    inputText.width = 200;
    inputText.height = 16;
    inputText.border = true;
    
    var dynamicText:TextField = new TextField();
    dynamicText.type = TextFieldType.DYNAMIC;
    dynamicText.y = 20;
    dynamicText.width = 200;
    dynamicText.selectable = false;
    dynamicText.text = "This is a dynamic TextField";
    
    addChild(inputText);
    addChild(dynamicText);

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