Safe, ergonomic Rust abstraction over the AIR Native Extension (ANE) C API (fre-sys) for native-side development.
This crate depends on the AIR SDK via fre-sys. See its documentation for setup instructions.
- Adobe AIR SDK from HARMAN
- AIR | AIR SDK
- ActionScript 3.0 Language Reference
- Adobe Flash Platform * Developing Native Extensions for AdobeAIR
- Adobe ActionScript® 3 (AS3) API Reference
This crate provides safe abstractions over the ANE C API.
Underlying objects may still be modified externally by the AIR runtime.
Unsafe code is minimized and encapsulated, but correct usage of this crate's API is still required.
MIT OR Apache-2.0
The primary entry points of this crate are the macros extension! and function!.
Refer to their documentation for details and examples.
use fre_rs::prelude::*;
fre_rs::extension! {
extern Initializer;
gen init_ctx, final;
}
fn init_ctx(_: &mut CurrentContext) -> (Option<Box<dyn Any>>, FunctionSet) {
let mut funcs = FunctionSet::new();
funcs.add(None, None, hello);
(None, funcs)
}
fre_rs::function! {
hello (ctx, _, args) -> as3::String {
trace(args);
as3::String::new(ctx, "Hello, Flash runtime!")
}
}The repository provides a comprehensive example of ANE integration within an AIR project. It covers the full development workflow, including native implementation (Rust), ActionScript 3 wrapper, automated build script, and required configuration files.
To build and execute the example, ensure the following environment is configured:
- Operating System: Windows 10+ (x86-64)
- Rust Toolchain: version 1.85+ (supporting Edition 2024)
- C++ Build Tools: Visual Studio Build Tools (MSVC)
- AIR SDK: HARMAN AIR SDK (latest version recommended)
- Java Runtime: JRE or JDK 8+ (required for the AIR Developer Tool)