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

  • Home
  • SEARCH
  • 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 755225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:06:18+00:00 2026-05-14T15:06:18+00:00

I am writing a flex application that involves modifying a textarea very frequently. I

  • 0

I am writing a flex application that involves modifying a textarea very frequently. I have encountered issues with the textarea sometimes not displaying my modifications.

The following actionscript code illustrates my problem:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600">
    <mx:TextArea x="82" y="36" width="354" height="291" id="textArea" creationComplete="initApp()"/>

    <mx:Script>
        <![CDATA[
            private var testSentence:String = "The big brown fox jumps over the lazy dog.";

            private var testCounter:int = 0;

            private function initApp():void {
                var timer:Timer = new Timer(10);
                timer.addEventListener(TimerEvent.TIMER, playSentence);
                timer.start();
            }

            private function playSentence(event:TimerEvent):void {
                textArea.editable = false;

                if (testCounter == testSentence.length)  {
                    testCounter = 0;
                    textArea.text += "\n";
                }
                else {
                    textArea.text += testSentence.charAt(testCounter++);
                }

                textArea.editable = true;
            }
        ]]>
    </mx:Script>
</mx:Application>

When you run the above code in a flex project, it should repeatedly print, character by character, the sentence “The big brown fox jumps over the lazy dog.”. But, if you are typing into the textarea at the same time, you will notice the text the timer prints is distorted.

I am really curious as to why this happens. The single-threaded nature of flex and disabling user input for the textarea when I make modifications should prevent this from happening, but for some reason this doesn’t seem to be working.

I must note too that, when running the timer at larger intervals (around 100ms) it seems to work perfectly, so I am tempted to think it’s some kind of synchronization issue in the internals of the flex framework.

Any ideas on what could be causing the problem?

  • 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-14T15:06:19+00:00Added an answer on May 14, 2026 at 3:06 pm

    My son is having a rough go at this teething thing, hense my being awake. AND, I’m not really sure how I happened upon this random question/answer since I’m so rarely on stackoverflow…. but…

    You SHOULD NOT have to increase your framerate by 4x because of a textArea! We’re talking about system resources, not to mention a very elegant flex framework that you could instead leverage:

    Here’s a very quick, and flex-sdk compliant and happy fix:

    create a component that extends TextArea and add the following property and override (if this in fact what you’re trying to do):

    private var _tackOnText : String = "";
    private var _tackOnTextChanged : Boolean = false;
    public function set tackOnText(value:String):void
    {
        _tackOnText = value;
        _tackOnTextChanged = true;
        invalidateProperties();
    }
    
    public function get tackOnText():String
    {
        return _tackOnText;
    }
    
    
    override protected function commitProperties():void
    {
        super.commitProperties();
    
        if(_tackOnTextChanged) {
            this.textField.text += _tackOnText;
            _tackOnText = "";
            _tackOnTextChanged = false;
        }
    
    }
    

    Then change your playSentence to do this:

    if (testCounter == testSentence.length)  {
        testCounter = 0;
        textArea.tackOnText += "\n";
    }
    else {
        textArea.tackOnText += testSentence.charAt(testCounter++);
    }
    

    This is one fix to a semi-common problem that should allow you to not increase your frameRate by 4x to get your app to function correctly AND you’ll be better working with the flex sdk.

    My 2p.

    Have a good one,
    Jeremy

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 505k
  • Answers 505k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer upload.form is the URL of the HTTP POST request that… May 16, 2026 at 3:23 pm
  • Editorial Team
    Editorial Team added an answer You can prepare the names, maxValuations, and endowments as lists… May 16, 2026 at 3:23 pm
  • Editorial Team
    Editorial Team added an answer According to MSDN the <services> tag should be inside your… May 16, 2026 at 3:23 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm writing a Flex application that makes full use of BlazeDS to a Java
I'm writing a flex application that polls an xml file on the server to
I´m writing an application for Android in which I have a character that I
I'm writing a Flex application and I came across what I think is a
I am writing an Adobe AIR application that needs to build in a CI
I'm writing a mock backend service for my flex application. Because I will likely
We currently have a quite complex business application that contains a huge lot of
I am writing a Flex application for use on a private intranet with no
We have a pretty big application with lots of objects being passed between flex
In Flex/Actionscript When writing an on mouseMove event on a Canvas control for example,

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.