Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4268244
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:00:36+00:00 2026-05-21T07:00:36+00:00

i want to adjust the size of my text area in action script based

  • 0

i want to adjust the size of my text area in action script based on the text i put inside dynamically, but absolutly don’t know how to do that… searched a lot for nothing. Here is my code if it can help you situate the problem. I want to adjust the height of msgLabel to the content.

Thanks a lot ;).

public function createTweet(tweet:XML, lineName:String, isTweetInList:Boolean):IVisualElement{
    var authorS:String = tweet.posterName;
    var tweetID:String = tweet.tweetID;

    //Main vertical group
    var vg:VGroup = new VGroup();
    vg.percentWidth = 100;
    if(!isTweetInList){
        //Add the new VGroup to the tweetTabHolder
        tweetTabHolder[tweetID+lineName] = vg;

        //Add the new tweetID to the tweet posted by an author
        if(tweetByLineByAuthor[authorS] == null)
            tweetByLineByAuthor[authorS] = new Dictionary();
        if(tweetByLineByAuthor[authorS][lineName] == null)
            tweetByLineByAuthor[authorS][lineName] = new ArrayList();
        tweetByLineByAuthor[authorS][lineName].addItem(tweetID);
    }

    vg.setStyle("backgroundAlpha", 0);
    vg.paddingLeft = 20;

    var sp0:Spacer = new Spacer();
    sp0.height = 10;
    vg.addElement(sp0);

    //Tweet Content
        //Author
    var hgA:HGroup = new HGroup();
    var aSpacer:Spacer = new Spacer();
    aSpacer.width = 10;
    hgA.addElement(aSpacer);
    var authorLabel:RichText = new RichText();
    authorLabel.text = authorS;
    authorLabel.setStyle("fontSize",20);
    authorLabel.setStyle("fontWeight",FontWeight.BOLD);
    authorLabel.setStyle("color",authorColor);
    authorLabel.addEventListener("click",authorClickHandler);
    authorLabel.addEventListener(MouseEvent.MOUSE_OVER,authorFocusInHandler);
    authorLabel.addEventListener(MouseEvent.MOUSE_OUT,authorFocusOutHandler);
    hgA.addElement(authorLabel);
    if(tweet.posterName == userNameLogged || isTweetInList){
        var abs1:Spacer = new Spacer();
        abs1.width = 25;
        hgA.addElement(abs1);
        hgA.addElement(createDeleteTweetButton(tweetID,vg, isTweetInList));
        var abs2:Spacer = new Spacer();
    }
    if(!isTweetInList){
        abs2.width = 4;
        hgA.addElement(abs2);
        hgA.addElement(createFavorisButton(tweetID));
    }
    vg.addElement(hgA);
        //Msg
    var hgM:HGroup = new HGroup();
    var mSpacer:Spacer = new Spacer();
    mSpacer.width = 15;
    hgM.addElement(mSpacer);
    var msgLabel:TextArea = new TextArea();
    hgM.addElement(msgLabel);
    hgM.percentWidth = 100;
    msgLabel.percentWidth = 100;
    msgLabel.text = tweet.msg;
    msgLabel.setStyle("fontSize",12);
    msgLabel.setStyle("color",msgColor);
    msgLabel.editable = false;
    msgLabel.setStyle("lineBreak", "toFit");
    vg.addElement(hgM);

    //Date
    var hgD:HGroup = new HGroup();
    var dSpacer:Spacer = new Spacer();
    dSpacer.width = 10;
    hgD.addElement(dSpacer);
    var dateLabel:Label = new Label();
    dateLabel.text = tweet.postingDate.date;
    dateLabel.setStyle("fontSize",10);
    dateLabel.setStyle("color",dateColor);
    hgD.addElement(dateLabel);
    vg.addElement(hgD);

    var sp1:Spacer = new Spacer();
    sp1.height = 10;
    vg.addElement(sp1);
    var hr:HRule = new HRule();
    hr.percentWidth = 90;
    hr.x = 20;
    vg.addElement(hr);
    return vg;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T07:00:37+00:00Added an answer on May 21, 2026 at 7:00 am

    First off, why are you using Actionscript when your application is clearly Flex? You could reduce that mess of code by 2/3. Also, last I checked they all resize to their content unless you specify their dimensions. Either way, here’s an example which works great:

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx">
    
        <fx:Script>
            <![CDATA[
                [Bindable] private var someText:String = "Enter long text here.";
            ]]>
        </fx:Script>
        <s:RichEditableText selectable="true" editable="false" text="{someText}" multiline="true" width="100%" />
    
    </s:Application>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a background image in my website. I want to adjust the size
I want to change text size of EditText as text entered. It means initially
I have a DIV I want to adjust its size regarding the window size.
Re: http://fancyapps.com/fancybox/#docs I’ve set the option for a custom margin but want to adjust
I want to adjust a Static control's size to its content size, so I
I am trying to adjust text size so it can fill a certain space
I want to adjust zsh so that I can tab complete: myprog <tab> using
I am working on a blog at www.tosreport.com/scripting and might want to adjust where
when my form is shown, i want to adjust the height of certain control,
want to know why String behaves like value type while using ==. String s1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.