Does Flex 3 support threading?

Does Flex 3 support threading? If so, are there any examples or links that I could look at?

+6
source share
4 answers

Somewhere in Adobe Flash Player supports multithreading ... http://www.bytearray.org/?p=3007 . It is not yet available to the public.

Other than that, see Threading or green threading in actionscript? There are also several articles on the Internet about using Pixel Bender multithreading to process data.

+6
source

As pointed out by Alex here :

ActionScript is single-threaded, if you spend a lot of time doing heavy calculations, the user interface cannot be updated while you do this calculation, so your application seems stuck or the effects do not start smoothly.

Similarly, in ActionScript, there is no assignment or blocking either. If the next line of code should work, you cannot prevent the next line of startup code. This means that when you call Alert.show (), the next line of code following this starts immediately.

In many other execution modes, the warning window should be closed before the next line of code continues. Threading may be a feature of Actioncript on some day, but before that you have to live with the fact that there isn’t such a thing right now.

+4
source

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(); // do the next slice of work: // you'll want to calibrate how much work a slice contains to maximize // performance while not affecting responsiveness excessively _long_process_work_object.doSomeOfTheWork(); if (!_long_process_work_object.Done) { // long process is not done, start timer again _long_process_timer.start(); return; } // long process work is done, do whatever comes after } 
+4
source

Flex 3 is based on ActionScript 3. ActionScript 3 does not support multithreading (you cannot write code designed for multithreaded execution). The compiled flex application runs on the Flash Player platform. Adobe Flash Player 11.4 and multithreading support added.

0
source

Source: https://habr.com/ru/post/885708/


All Articles