ActionScript 3 is single-threaded.
What you can do is cut off work on slices small enough so that the reaction to it does not suffer much. For instance:
private var _long_process_work_object:LongProcessWorkClass; private var _long_process_timer:Timer; private function startSomeLongAndIntensiveWork():void { _long_process_work_object = new LongProcessWorkClass(); _long_process_timer = new Timer(10); _long_process_timer.addEventListener("timer", longProcessTimerHandler); _long_process_timer.start(); } private function longProcessTimerHandler(event:TimerEvent):void { _long_process_timer.stop();
user610650
source share