Analyze, extract, and migrate Flash/ActionScript game projects (.fla, .swf, .as files) to modern web technologies (JavaScript, TypeScript, HTML5 Canvas, Haxe/OpenFL). Use this skill whenever the user mentions Flash, ActionScript, AS2, AS3, FLA, SWF, decompiling Flash games, extracting assets from Flash files, converting Flash to HTML5, porting Flash games to modern browsers, migrating legacy Flash content, JPEXS, FFDec, Ruffle, CreateJS, OpenFL, Haxe, or any Flash-era game preservation task. Also applies when the user has old .fla or .swf files and wants to understand, extract, rebuild, or modernize their content. NOT for: general web game development without Flash involvement, PDF/document conversion, or video format conversion.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
The command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
File Explorer
4 files
Showing SKILL.md
SKILL.md
Source instructions · Read-only preview
name
as3-fla-migration
metadata
{"author":"Z.AI","version":"1.0"}
description
Analyze, extract, and migrate Flash/ActionScript game projects (.fla, .swf, .as files) to modern web technologies (JavaScript, TypeScript, HTML5 Canvas, Haxe/OpenFL). Use this skill whenever the user mentions Flash, ActionScript, AS2, AS3, FLA, SWF, decompiling Flash games, extracting assets from Flash files, converting Flash to HTML5, porting Flash games to modern browsers, migrating legacy Flash content, JPEXS, FFDec, Ruffle, CreateJS, OpenFL, Haxe, or any Flash-era game preservation task. Also applies when the user has old .fla or .swf files and wants to understand, extract, rebuild, or modernize their content. NOT for: general web game development without Flash involvement, PDF/document conversion, or video format conversion.
Flash / ActionScript Game Migration Skill
A comprehensive skill for analyzing, extracting assets from, and migrating legacy Flash/ActionScript game projects to modern web technologies.
Quick Reference: File Types
Type
Format
What It Contains
How to Handle
.fla
ZIP archive (compressed)
Timeline, library, assets, embedded scripts
Rename to .zip, extract, or use JPEXS
.xfl
Uncompressed FLA
Same as FLA but as XML + folders
Direct XML parsing
.swf
Compiled binary
Compiled game (code + assets)
Decompile with JPEXS FFDec
.as / .as3
Text (ActionScript)
Source code (if available)
Read directly, convert to JS/TS/Haxe
.swc
ZIP archive
Library/component SWF + catalog.xml
Extract with JPEXS or unzip
.gfx
Modified SWF
ScaleForm UI (Unreal Engine)
JPEXS with GFX support
Workflow Overview
The migration process follows these phases. Read the detailed reference for each phase as needed:
Phase 1: Inventory & Analysis - Understand what you're working with
Platforms: Windows, macOS, Linux (requires Java 8+)
Command-Line Export (Batch)
Export all resources from an SWF in one command:
# Export everything to a directory
java -jar ffdec.jar -export script "output/scripts" game.swf
java -jar ffdec.jar -export image "output/images" game.swf
java -jar ffdec.jar -export shape "output/shapes" game.swf
java -jar ffdec.jar -export sound "output/sounds" game.swf
java -jar ffdec.jar -export font "output/fonts" game.swf
java -jar ffdec.jar -export text "output/texts" game.swf
java -jar ffdec.jar -export frame "output/frames" game.swf
java -jar ffdec.jar -export sprite "output/sprites" game.swf
java -jar ffdec.jar -export button "output/buttons" game.swf
java -jar ffdec.jar -export binaryData "output/binary" game.swf
# Export multiple types at once (comma-separated, NO spaces)
java -jar ffdec.jar -export"script,image,shape,sound,font,text""output/all" game.swf
# Export to XFL format (uncompressed FLA - XML based, editable)
java -jar ffdec.jar -export xfl "output/xfl" game.swf
# Export to FLA format (compressed, opens in Adobe Animate)
java -jar ffdec.jar -export fla "output/fla" game.swf
Export Format Options
Customize export formats with -format:
# Images as PNG (default), JPEG, or original format
java -jar ffdec.jar -export image "output/images" game.swf -format png
# Shapes as SVG (default) or PNG
java -jar ffdec.jar -export shape "output/shapes" game.swf -format svg
# Scripts as AS source (default)
java -jar ffdec.jar -export script "output/scripts" game.swf -format as
# Fonts as TTF (default) or CFF
java -jar ffdec.jar -export font "output/fonts" game.swf -format ttf
# Sounds as MP3, WAV, or FLV
java -jar ffdec.jar -export sound "output/sounds" game.swf -format mp3
Processing FLA Files Directly
FLA files (CS4+) are ZIP archives. To extract their contents:
# Method 1: Rename and unzipcp game.fla game.zip
unzip game.zip -d fla_extracted/
# The extracted FLA contains:# - DOMDocument.xml (timeline, library, frames structure)# - LIBRARY/ (library items as separate XML files)# - bin/ (compiled assets)# - Settings.xml (publish settings)
The DOMDocument.xml is the most important file - it describes the entire timeline structure, frame scripts, layer ordering, and library symbol references.
Handling Specific Asset Types
Images
Extracted as PNG or JPEG from SWF
Check both DefineBitsJPEG2/3/4 and DefineBitsLossless1/2 tags
Some images may be inside sprites/movieclips - export sprites to get them
Sounds
May be in MP3, WAV, ADPCM, or raw PCM format
DefineSound tags for embedded sounds
SoundStreamBlock tags for streaming audio (longer clips/music)
Export as MP3 when possible for modern compatibility
Vector Shapes
Export as SVG for best quality (scalable, editable)
Complex shapes may need cleanup after extraction
Shapes can be converted to Canvas paths or SVG for web use
Text
Static text: exported as plain text
Dynamic/input text: check for embedded font references
Text may use device fonts (no extraction needed) or embedded fonts (export separately)
Fonts
Export as TTF (TrueType) for modern web use
Font names may be obfuscated in SWF - check JPEXS's font viewer
Consider converting to WOFF2 for web embedding
Phase 3: Code Analysis & Translation
This is the most critical phase. The approach depends on the target technology.
Option A: ActionScript to JavaScript/TypeScript (Direct Translation)
Best for: AS3 projects, games that need full rewrite anyway, web-only targets.
Key Mapping: AS3 → JavaScript/TypeScript
AS3 Concept
JS/TS Equivalent
Notes
MovieClip
Canvas context / DOM element
Use EaselJS Stage or raw Canvas
Sprite
createjs.Container / custom class
DisplayObject equivalent
Event.ENTER_FRAME
requestAnimationFrame loop
Game loop pattern
addEventListener
Same in JS, or on('event') in EaselJS
Nearly identical API
Timer / setInterval
setTimeout / setInterval
Direct equivalent
getTimer()
performance.now()
Milliseconds since page load
URLRequest / Loader
fetch() / Image()
Async loading
SharedObject
localStorage
Local persistence
SoundChannel
Web Audio API / Howler.js
Audio playback
BitmapData
Canvas ImageData
Pixel manipulation
Point
{x, y} object or custom class
Simple value object
Rectangle
{x, y, width, height}
Simple value object
Matrix
DOMMatrix / Canvas transforms
2D transformation
TextField
DOM element / Canvas text
Text rendering
Graphics.lineTo()
ctx.lineTo()
Canvas path API (very similar)
Graphics.drawCircle()
Translation Strategy
Extract all AS3 code with JPEXS
Identify the entry point (document class or frame scripts)
Map the class hierarchy - document inheritance chains
Translate incrementally: utilities → data models → display → game logic
Use CreateJS (EaselJS + TweenJS + SoundJS + PreloadJS) to preserve Flash-like display list API
AS3 Code Analysis Checklist
For each extracted AS3 class, analyze:
Class purpose: What does it manage? (player, enemy, UI, physics, etc.)
Dependencies: What other classes does it reference?
Display objects: What does it render? (shapes, bitmaps, text)
Events: What events does it listen to and dispatch?
Timers/loops: Does it use ENTER_FRAME, Timer, or intervals?
State: What data does it maintain between frames?
External resources: Does it load external data, sounds, or images?
AS3-specific features: Does it use byte manipulation (ByteArray), sockets, or other features without direct JS equivalents?
Option B: ActionScript to Haxe (via as3hx)
Best for: AS3 projects wanting cross-platform output, games with existing AS3 class libraries.
Using as3hx
as3hx is an automated converter from ActionScript 3 to Haxe 3, created by the HaxeFoundation.
# Install (requires Haxe 3+ and Neko)
git clone https://github.com/HaxeFoundation/as3hx.git
cd as3hx
haxe --no-traces as3hx.hxml
# Convert a directory of AS3 files
neko run.n source_as3_dir/ output_haxe_dir/
# Convert a single file
neko run.n MyClass.as output/MyClass.hx
Handle assets: Copy extracted images/sounds to assets/ directory
Build for HTML5: openfl test html5
Pros: Fastest path for AS3 games, cross-platform (HTML5 + native), familiar API for Flash developers.
Cons: Requires Haxe knowledge, some Flash features not supported in OpenFL HTML5 target.
Option C: AI-Assisted Translation
Use LLM to assist with code translation when dealing with complex ActionScript:
Extract all AS3 code into individual files
Create a context document describing the game architecture
Translate class by class, providing the LLM with:
The full AS3 source code
A description of what the class does
The target language/framework (e.g., "TypeScript + Phaser.js")
Any dependencies or related classes
Best practices for AI translation:
Translate utility/helper classes first (they have fewer dependencies)
Provide the LLM with class relationships and interfaces
Review output carefully - AI may "hallucinate" Flash APIs in JavaScript
Test incrementally - don't wait until everything is "translated"
Phase 4: Rebuild on Modern Framework
Framework Selection Guide
Target Framework
Best For
Difficulty
Display List Model
Audio
CreateJS (EaselJS)
Simple/medium games, timeline animations
Low
Flash-like hierarchy
SoundJS
PixiJS
Performance-critical 2D games
Medium
Scene graph
Howler.js
Phaser
Full-featured 2D games
Medium
Scene-based
Built-in
Pixi.js + Phaser
Complex 2D games
Medium-High
Scene + render
Built-in
Three.js
2.5D / simple 3D conversions
High
Scene graph
Custom
OpenFL/Haxe
AS3 code preservation, cross-platform
Medium
Flash API clone
OpenAL
Raw Canvas
Simple games, learning
Medium
Manual
Web Audio API
Recommended: CreateJS for Flash-like Projects
CreateJS is the closest JavaScript equivalent to the Flash display list API:
// Flash AS3 → CreateJS JavaScriptvarmc:MovieClip = newMovieClip(); → var mc = new createjs.MovieClip();
mc.x = 100; → mc.x = 100;
mc.addEventListener("click", fn); → mc.on("click", fn);
stage.addChild(mc); → stage.addChild(mc);
createjs.Tween.get(mc).to({x:200}, 1000); // Like TweenLite in AS3
CreateJS modules:
EaselJS: Display list, hit detection, caching (like Flash display API)