Skip to main content
New Participant
December 16, 2012
Question

Is it possible to access an AIR Native Extension inside an Actionscript worker?

  • December 16, 2012
  • 3 replies
  • 4044 views

Hi, I'm currently trying to push off some time consuming tasks to an actionscript worker. This worker will in turn needs to call out to an AIR Native Extension as part of it's processing.

I've tried various combination in Flash Builder 4.7 i.e. embedded worker and external worker (with explicit packaging of the ANE in the external worker project)  but alas I've been unable to get this to setup to work. I keep getting an error from the worker saying that the native extesion class could not be found (Error #1014).

Does anyone know if it is at all possible to do this or it's a limitation of Actionscript workers (loading thw swf bytes does not load up the ANE)?

This topic has been closed for replies.

3 replies

New Participant
August 1, 2018

I have encountered the same problem, have you got it solved? Can you tell me the solution? Thanks

Jalps
New Participant
August 24, 2014

Hi

I also met the same problem---"native extesion class could not be found"


The problem is solved?


I think the reason is

" <extensions>

  <extensionID>XXXXXX</extensionID>

</extensions>“ in  "-app.xml"

the worker do not  konw the extensionID

....

In this article :

Adobe AIR * Using native extensions for Adobe AIR

.....................

Including the ANE file in your application’s library path

To compile an application that uses a native extension, include the ANE file in your library path.

Using the ANE file with Flash Builder

If your application uses a native extension, include the ANE file for the native extension in your library path. Then you can use Flash Builder to compile your ActionScript code.

Do the following steps, which use Flash Builder 4.5.1:

Change the filename extension of the ANE file from .ane to .swc. This step is necessary so that Flash Builder can find the file.

Select Project > Properties on your Flash Builder project.

Select the Flex Build Path in the Properties dialog box.

In the Library Path tab, select Add SWC....

Browse to the SWC file and select Open.

Select OK in the Add SWC... dialog box.

The ANE file now appears in the Library Path tab in the Properties dialog box.

Expand the SWC file entry. Double-click Link Type to open the Library Path Item Options dialog box.

In the Library Path Item Options dialog box, change the Link Type to External.

Now you can compile your application using, for example, Project > Build Project.

.......................

the error will be done

Unfortunately, it still does not work well!

Error: Error #3731: This feature is not available within this context.

  at flash.external::ExtensionContext$/_createExtensionContext()

  at flash.external::ExtensionContext$/createExtensionContext()

3731This feature is not available within this context.This error occurs if a background worker attempts to access an API that is not available to it. 

Run-Time Errors - Adobe ActionScript® 3 (AS3) API Reference

Nimisha1
Participating Frequently
September 1, 2014

Hi,

Native extensions are not supported from non-primordial workers.

-Nimisha

Nimisha1
Participating Frequently
December 17, 2012

Hi,

Which platform are you using? You might be aware but ActionScript workers API isn't supported on mobile platforms.

-Nimisha

January 18, 2013

Hi Nimisha,

There was some talk of ActionScript workers being made available on the mobile platform for AIR 3.6.

In our case they still do not seem to be working for Android.

When is the ActionScript workers likely to be available for Android?

- Conor

Nimisha1
Participating Frequently
September 4, 2013

Hi,

Workers on Android is now available in AIR 3.9 Beta, to use the same download AIR SDK fromhttp://labs.adobe.com/downloads/air.html and to know more read release noteshttp://labsdownload.adobe.com/pub/labs/flashruntimes/shared/air3-9_fla shplayer11-9_releasenotes.pdf.

Please share your feedback with us.

PS: It will work with -swf-version=22.

Thanks,

Nimisha