Importing / embedding .swc targeting Neko / html

Can someone direct me to an up to date working example (for noobs) of someone using a .swc file in an OpenFL project that isn’t targeting Flash?
I’m new here and I keep finding references to .nmml files which don’t seem to exist with my configuration.

Are you trying to use SWF graphic elements, or are you trying to use code? If you are using code, are you using ActionScript, or Haxe?

We do include an ActionScript virtual machine in OpenFL, so it is not possible to run ActionScript code, but we do have options for leveraging SWF assets. If you rename your SWC to ZIP, you’ll find it’s a SWF file and an XML file inside. We can use the SWF file with the OpenFL SWF library to recreate many types of SWF graphics :slight_smile:

I used this:

<haxeflag name="-swf-lib" value="assets/swc/PlayerIOClient.swc" />

And it works when targeting flash but not in Neko.
I’m trying to use the PlayerIO client library to connect to their API from inside Neko.

While I’m on the subject, does anyone know how to configure Flex to allow rightClick functionality.
It used to work from the vanilla build of FlashDevelop but it doesn’t seem to work anymore and I’m targeting Flex 4.6.

I looked into the license for PlayerIO, I have not been able to tell what the permissions are on their client library. Unfortunately, without knowing the license, it will not be possible to know whether we would be allowed to port their library to Haxe, or not. I have reached to contact them by email, so maybe we will hear something back soon.

In this SWC, they have pre-compiled ActionScript code for use in Flash. This (as you have seen) works in Flash, but is not possible to run, say, in a web browser, which understands JavaScript, not ActionScript, without the Flash Player plugin. It could be possible to write native extensions for Java and Objective-C use of their library, but one Haxe library would obviously be ideal, so we’ll see what they say.

I thought that Flex supported right-click in Flash if you add an event listener for the right click event?

Yeah right click is working now, i thought it was because I updated to AIR 22.0 but it works on my other projects that are still targeting 3.1. Must have been something that got updated in the switch to OpenFL.

Thanks for emailing them, I’d happily write the HaXe version myself if I was getting paid for it XD I have an old copy of their .as files before they had that .swc sdk. They still work fine but thought it would be best to learn how to import into HaXe before trying something that laborious.