dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: adding Text area to stage with code

  1. #1
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194

    adding Text area to stage with code

    Hi,

    is it possible to add a text area to the stage at run time? using actionscript? I've had a quick read of Docs and is TextAea class something which allows this? ideally I would be able to add an area in run time, and then pull the right/bottom edges around with the mouse to change the size of the user input area, possible?

    thanks for any advice

    boombanguk

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    put a textarea component in the library:

    this.createClassObject(mx.controls.TextArea, "myText", 1);
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  3. #3
    OOP is one letter from OOPS kortex's Avatar
    Join Date
    Aug 2005
    Location
    New Hope, PA
    Posts
    2,668
    Or you could use this:

    _root.createTextField("mytext",1,100,100,300,100);
    mytext.multiline = true;
    mytext.wordWrap = true;
    mytext.border = false;

    myformat = new TextFormat();
    myformat.color = 0xff0000;
    myformat.bullet = false;
    myformat.underline = true;

    mytext.text = "this is my first test field object text";
    mytext.setTextFormat(myformat);
    Jeremy Wischusen
    Flash - Flex - LAMP - Web Developer Purple Inc
    AS OOP FAQ-Best Practices Thread | Flashkit OOP Tutorials | Purple Inc (day job) | Blog


  4. #4
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    thanks, after some more thought, I think I'll go with just having an input area already on the stage, but the what I want now is for when someone types over a number of levels for 1 line it automatically wraps to the next line......i've got a 2 line input area set up, with multiline turned on, but in run time when you type something in, it just keeps going on the same line, and not moving down to the 2nd line when going beyond the width of the area, how do i get it to wrap to the next line?

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