Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Actionscript doesn't support multithreading, which I think is what you are really asking about here.</p> <p>While the functionality isn't inherent in actionscript (or Flex) you could set up a mock system using events and timers.</p> <p>I'm a little unclear on your exact question, so I'll give two answers:</p> <p><strong>1) You want to process a file every few seconds to act on any changes.</strong></p> <p>In this case all you need to do is set up a timer to check the file periodically:</p> <pre><code>var fileTimer:Timer = new Timer(5000); fileTimer.addEventListener(TimerEvent.TIMER, checkFile); ... private function checkFile(event:TimerEvent):void { // read the file and do whatever you need to do. } </code></pre> <p><strong>2) You want to parse a very large file but don't want the application to hang whilst doing it.</strong></p> <p>If you want to process the file in the background, while keeping the main application responsive then I would probably create a function that would parse several lines of the file and then send an event and return. Listen for the event and start a timer that would wait a few milliseconds before calling the function again to parse the next set of lines. </p> <p>This would break up the parsing of a large file with enough down time to keep the rest of your app running smoothly. You'd have to play with the timer interval and number of lines to parse at once to strike a good balance of responsiveness and the time needed to parse the file.</p> <p>Hope that makes sense!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload