1 Reply Latest reply on May 9, 2007 6:08 AM by buabco

    Help... there has got to be a way!

    axehammer
      I have spent considerable time trying to find out how I can update the display while I'm in a for loop. I have created a self organizing map using actionscript 3.0 and I'd like to display the map learning. The SOM is computationally intensive and has to be in a tight for loop. When running actionscript code in a loop does flex respond to any events? Back in my VB days there was a doevents() statement to allow events to be handled... anything like that in flex?? doesn't seem like setting up a timer event is going to work if the for loop is blocking the event.
        • 1. Re: Help... there has got to be a way!
          buabco Level 1
          Alex,

          There is no doevents() fucntion in Flex, but there still is a way :)

          What you need to do is to encapsulate your loop in a function listening to the EnterFrame event, this will make the hole process slower (Since you'll do a part of it on each frame), but the display list will be updated and the program wont hang during the process.