【问题标题】:Thread or background processing in actionscriptactionscript 中的线程或后台处理
【发布时间】:2012-08-26 14:32:34
【问题描述】:

我知道 Actionscript 不是多线程的。但是,我想以某种方式解决这个问题。在呈现 UI 时,我需要向服务器发出多个请求(UI 呈现多个图形)。

我找到了this article,我正在探索如何根据我的情况充分利用它。

还有其他的朋友吗?

【问题讨论】:

  • Flash Player 11.4(最近发布)引入了一个名为“Actionscript workers”的功能,您可以在其中创建工作线程并在后台执行操作。

标签: multithreading actionscript


【解决方案1】:

1) Flash ALL 远程调用(如RemoteObjectURLLoaderHTTPService 等)是异步。所以服务器请求不需要任何多线程 - UI 不会被冻结!

2) 在 FlashPlayer 11.4 和 Air 3.4 中,多线程成为可能,但尚未真正用于已知应用程序中...... 见这些: http://helpx.adobe.com/flash-player/release-note/fp_114_air_34_release_notes.html http://www.bytearray.org/?p=4423

3) 此外,可以使用延迟和调用超时来避免 Flash 中长时间进程操作的 UI 冻结,例如异步 JPEG 编码器的示例:

Fast or asynchronous AS3 JPEG encoding

http://www.switchonthecode.com/tutorials/flex-tutorial-an-asynchronous-jpeg-encoder

http://blog.inspirit.ru/?p=201

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-03-04
    • 2023-02-03
    • 2016-01-27
    • 2011-02-09
    • 1970-01-01
    • 2014-09-25
    • 1970-01-01
    • 2014-08-07
    相关资源
    最近更新 更多