简体   繁体   English

如果Adobe Air ANE影响或与Adobe Air发生冲突

[英]If Adobe Air ANE affect or conflict with Adobe Air

Because Adobe Air ANE enable developer to write native codes to control almost everything. 因为Adobe Air ANE使开发人员能够编写本机代码来控制几乎所有内容。 So I wonder if it is possible ANE codes influence or conflict with Adobe Air native functions. 所以我想知道ANE代码是否可能影响或与Adobe Air本机功能发生冲突。 For example, I turn the volume by actionscript3. 例如,我按actionscript3转动音量。 meanwhile, I also adjust volume by ANE. 同时,我也通过ANE调整音量。 Is it possible causes error or conflicts? 是否可能导致错误或冲突?

AS3 is single threaded and completely linear. AS3是单线程的,完全是线性的。 Two things cannot happen at the same time, even with an ANE (unless you use the ANE to leverage a second thread, obviously). 即使使用ANE,也不可能同时发生两件事(除非您使用ANE来利用第二个线程,显然)。 Basically, with an ANE, you call a method from a SWC/AS3 library that calls a method in native code. 基本上,使用ANE,您可以从SWC / AS3库中调用一个方法,该方法使用本机代码调用方法。 The native code runs and then comes back to the SWC/AS3 library and then back to the originating code. 本机代码运行然后返回到SWC / AS3库,然后返回到原始代码。

So... 所以...

as3 -> start changeVolume()
as3 library -> start changeVolume()
native code -> changeVolume()
as3 library -> finish changeVolume()
as3 -> finish changeVolum()
as3 -> next set of instructions run

EDIT: I should mention that this is not entirely true anymore. 编辑:我应该提到这不再完全正确。 You can use workers that will allow you to utilize other threads. 您可以使用允许您使用其他线程的工作程序。 However, the most likely case for an ANE is on mobile and the workers do not currently work for mobile devices. 然而,ANE最可能的情况是移动设备,而工作人员目前不在移动设备上工作。

As I know, ANE just works like an library in AS3 code. 据我所知, ANE就像AS3代码中的库一样。 It works like a linked SWC. 它的工作方式类似于链接的SWC。 So you just treat ANE as a SWC as a part of AS3 library code and wouldn't worry conflicts. 因此,您只需将ANE视为SWC作为AS3库代码的一部分,并且不会担心冲突。

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

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