• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

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

New Here ,
Dec 16, 2012 Dec 16, 2012

Copy link to clipboard

Copied

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)?

TOPICS
Air beta

Views

3.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Dec 17, 2012 Dec 17, 2012

Copy link to clipboard

Copied

Hi,

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

-Nimisha

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 18, 2013 Jan 18, 2013

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Sep 03, 2013 Sep 03, 2013

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 29, 2014 Mar 29, 2014

Copy link to clipboard

Copied

Hi Nimisha

I think it still got some issue there, here is what i got

worker-ane-issue.jpg

FYI : i'm on winx64 test on device tab3 x86 atom with AIR13.76

source to reproduce

ANE : https://github.com/freshplanet/ANE-Alert/

Worker : http://esdot.ca/site/2012/intro-to-as3-workers-hello-world

and put both in constructor

both working but not together, simply comment

//AirAlert.getInstance().showAlert("My title", "My message", "OK", myCallback1);

is working without error throw but actaully all ane i've will throw error eventually after try to alloc ANE

weird part of this issue is only first alloc ANE will broken but other ANE alloc after that will be fine e.g.

// this one will throw error

new OtherANE();

 

// this one will working fine

AirAlert.getInstance().showAlert("My title", "My message", "OK", myCallback1);

in short

  1. yes, ANE is working
  2. yes, Worker is working
  3. yes, ANE is embed and not throw error until alloc
  4. yes, any ANE will get this error eventually after alloc
  5. no, Worker not working after error
  6. no, i didn't try to create Worker from other swf yet
  7. yes, error throw incorrect line, don't bother with it, like i said only alloc ANE is enough to produce this error.

workaround

  • don't alloc ANE and Worker in constructor together, let worker do their job for a while and then alloc ANE really later

do tell me if you want to me to file to bug base.

ref : http://sleepydesign.blogspot.com/2014/03/ane-daily-pitfall-ane-and-worker-dont.html

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 30, 2014 Mar 30, 2014

Copy link to clipboard

Copied

I confirm that I had exactly the same problem (tested before with AIR 3.9 + ANE for Android).

I posted a message here in forums.adobe without any reply from Adobe and I ended up given up (again Adobe in it's best) and ended up made one ANE that uses threads.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 23, 2014 Aug 23, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Aug 31, 2014 Aug 31, 2014

Copy link to clipboard

Copied

Hi,

Native extensions are not supported from non-primordial workers.

-Nimisha

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2018 Aug 01, 2018

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines