简体   繁体   English

Flex移动项目中的多线程

[英]Multi threading in flex mobile project

I want to download a video on mobile device through flex framework. 我想通过Flex框架在移动设备上下载视频。 For that reason I need to have support of multithreading so that I can download video in background. 因此,我需要支持多线程,以便可以在后台下载视频。 Unfortunately, Flex doesn't have multithreading support. 不幸的是,Flex没有多线程支持。 Do you guys have any idea how can I do this? 你们知道我该怎么做吗? I am quite new with flex environment. 我对flex环境很陌生。

Thanks 谢谢

It might be useful to see what, exactly, you are trying to achieve. 看看您到底想达到什么目标可能会很有用。 What code are you writing that is blocking that you think you need multi-threading for? 您正在编写什么代码阻止您认为需要多线程处理的代码?

Multi-threading is not available to you in Flex, mostly because it is not available on the Flash platform. Flex中不提供多线程,主要是因为Flash平台上不提供多线程。 (You can implement "Green Threading" if you absolutely need it, though.) All actions in Flex, however, that take any time or block are asynchronous so multi-threading isn't needed for most actions. (不过,如果绝对需要,也可以实现“绿色线程”。)但是,Flex中的所有操作都花费时间或块是异步的,因此大多数操作不需要多线程。

For instance, you do not need multi-threading to download content. 例如,您不需要多线程即可下载内容。 Assuming you are using something like the HTTPService class, you simply build up your URL, send() the request, and get a callback when the data has been received. 假设您正在使用类似HTTPService类的类,则只需构建URL, send()请求,并在收到数据时获取回调。

If you want to display video, you usually do that in some sort of media player UI which presumably has already figured that out for you. 如果要显示视频,通常可以在某种媒体播放器UI中执行此操作,大概已经为您解决了这一问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM