3 Replies Latest reply on Nov 3, 2008 7:53 AM by Newsgroup_User

    TextArea didn't displayed

    carlosmera20 Level 1
      Hi everyone,

      I am stuck in a strange problem, can anyone suggest what I am doing wrong here: the TextArea component didn't displayed:

      var text:TextArea = new TextArea();
      text.height = 500;
      text.width = 200;
      text.text = " ... anything in TextArea... ";
      text.x = 10;
      text.y = 10;

      var field:TextField = new TextField();
      field.height = 20;
      field.width = 200;
      field.text = " ... anything in TextField... ";
      field.x = 5;
      field.y = 5;

      var sprite:Sprite = new Sprite();
      sprite.addChild(text);
      sprite.addChild(field);

      this.addChild(sprite);

      Where "this" is a class that extends from Sprite. The TextField was displayed, but the TextArea didn't. I have the same problem with other components that extends from UIComponent.

      Thanks in advance,

      Carlos
        • 1. Re: TextArea didn't displayed
          Gregory Lafrance Level 6
          This code shows there must be something about Sprites that prevent it from containing decendants of UIComponent, though I could be wrong that is exactly the problem:
          • 2. Re: TextArea didn't displayed
            Level 7

            "carlosmera20" <webforumsuser@macromedia.com> wrote in message
            news:gemq09$t5h$1@forums.macromedia.com...
            > Hi everyone,
            >
            > I am stuck in a strange problem, can anyone suggest what I am doing wrong
            > here: the TextArea component didn't displayed:
            >
            > var text:TextArea = new TextArea();
            > text.height = 500;
            > text.width = 200;
            > text.text = " ... anything in TextArea... ";
            > text.x = 10;
            > text.y = 10;
            >
            > var field:TextField = new TextField();
            > field.height = 20;
            > field.width = 200;
            > field.text = " ... anything in TextField... ";
            > field.x = 5;
            > field.y = 5;
            >
            > var sprite:Sprite = new Sprite();
            > sprite.addChild(text);
            > sprite.addChild(field);
            >
            > this.addChild(sprite);
            >
            > Where "this" is a class that extends from Sprite. The TextField was
            > displayed,
            > but the TextArea didn't. I have the same problem with other components
            > that
            > extends from UIComponent.

            I don't think Sprite has the necessary infrastructure to display a
            UIComponent.


            • 3. Re: TextArea didn't displayed
              carlosmera20 Level 1
              Thanks for the answer, however I can not change my Sprite implementation to a UIComponent at this time. Is there any other way to do it? So, Sprites not containing UIComponents is a known limitation?