A TCP-based assets preview server built in ActionScript 3 for Flash/AIR content. It runs a local server that listens for JSON requests to render SWF-based assets (characters, items, armor, maps, icons), captures a bitmap, then returns a Base64-encoded PNG. Originally used with AQWorlds-style assets; see notes below.
- Community-focused: this tool helps preview SWF-based assets.
- References to AQWorlds are for compatibility/context. If you point
urlat official hosts, make sure your usage follows their terms.
- TCP Server: Listens on port 4567 for incoming preview requests
- Multiple Render Types:
- Character (full, head, profile, dialog)
- Armor/equipment previews
- Map rendering (standard and large)
- Icon generation
- Generic asset rendering
- Image Export: Converts rendered MovieClips to Base64-encoded PNG images
- Debug Interface: Built-in logging and control buttons
src/— Main source code directoryMain.as— Entry point and TCP server setupAvatar/— Character and armor rendering classesImage/— Image capture and Base64 encodingLoad/— Asset loading and caching systemMap/— Map rendering functionalityNetwork/— TCP networking and render dispatchingRender/— Specialized renderers for different asset types
com/adobe/— Adobe utility libraries (crypto, JSON, etc.)
lib/fl/— Flash UI components and controlsitem-preview.fla— Flash project fileItem.swf— Compiled SWF application
- Compile: Open
item-preview.flain Adobe Animate/Flash and publish as an Adobe AIR application to generate the AIR package. - Execute: Run the application using Adobe AIR Runtime (TCP socket functionality requires AIR).
- Server: The application automatically starts a TCP server on port 4567.
Send JSON requests to localhost:4567 with the following structure:
{
"type": "character|icon|armor|map|map_big|profile|head|dialog",
"data": {
// Render-specific data object
}
}You’ll typically point
urlto your asset mirror or a permitted host.
Character Rendering (type: "character"):
{
"type": "character",
"data": {
"url": "https://game.aq.com/game/gamefiles/",
"gender": "M",
"ia1": 0,
"equipment": {
"en": { "File": "none", "Link": "" },
"co": { "File": "SomeClass.swf", "Link": "rSomeClass" },
"he": { "File": "none", "Link": "" },
"Weapon": { "File": "SomeWeapon.swf", "Type": "Sword", "Link": "rSomeWeapon" },
"ba": { "File": "none", "Link": "" },
"pe": { "File": "none", "Link": "" },
"mi": { "File": "none", "Link": "" }
},
"hair": { "File": "hair/Hair_101.swf", "Name": "rHair101" },
"intColorSkin": 16777215,
"intColorHair": 8421504,
"intColorEye": 255,
"intColorBase": 16711680,
"intColorTrim": 16777215,
"intColorAccessory": 65280
}
}Notes:
co.Fileis appended internally asclasses/{gender}/{co.File}.- Set
en.Fileto a SWF anden.Linkto a symbol to render an entity instead of a standard avatar. ia1is a bitmask controlling hidden equipment (cape, helm, pet). Use0for visible defaults.
Armor Preview (type: "armor"):
{
"type": "armor",
"data": {
"url": "https://game.aq.com/game/gamefiles/",
"file": "classes/M/SomeClass.swf",
"linkage": "rSomeClass",
"gender": "M"
}
}Item/Icon Symbols (type: "icon"):
{
"type": "icon",
"data": {
"url": "https://game.aq.com/game/gamefiles/",
"assets": [
"items/Icons.swf",
"classes/M/SomeClass.swf"
],
"icons": "iSomeItem,iAnotherSymbol"
}
}Map Rendering (type: "map"):
{
"type": "map",
"data": {
"url": "https://assets.example.com/maps",
"file": "battleon.swf",
"frame": "Enter"
}
}Large Map Rendering (type: "map_big"):
{
"type": "map_big",
"data": {
"url": "https://assets.example.com/maps",
"file": "battleon.swf",
"frame": "Enter"
}
}Character Profile (type: "profile"):
{
"type": "profile",
"data": {
"url": "https://game.aq.com/game/gamefiles/",
"username": "Player123",
"guild": "Community Guild",
"level": 150,
"ranking_player": "Legend",
"intColorName": 13369395,
"cover": "https://assets.example.com/images/cover.jpg",
"gender": "M",
"ia1": 0,
"equipment": {
"en": { "File": "none", "Link": "" },
"co": { "File": "SomeClass.swf", "Link": "rSomeClass" },
"he": { "File": "none", "Link": "" },
"Weapon": { "File": "SomeWeapon.swf", "Type": "Sword", "Link": "rSomeWeapon" },
"ba": { "File": "none", "Link": "" },
"pe": { "File": "none", "Link": "" },
"mi": { "File": "none", "Link": "" }
},
"hair": { "File": "hair/Hair_101.swf", "Name": "rHair101" },
"intColorSkin": 16777215,
"intColorHair": 8421504,
"intColorEye": 255
}
}Character Head/Avatar (type: "head"):
{
"type": "head",
"data": {
"url": "https://game.aq.com/game/gamefiles/",
"gender": "F",
"ia1": 0,
"equipment": {
"en": { "File": "none", "Link": "" },
"co": { "File": "SomeClass.swf", "Link": "rSomeClass" },
"he": { "File": "helms/Helm_3001.swf", "Link": "rHelm3001" },
"Weapon": { "File": "none", "Type": "", "Link": "" },
"ba": { "File": "none", "Link": "" },
"pe": { "File": "none", "Link": "" },
"mi": { "File": "none", "Link": "" }
},
"hair": { "File": "hair/Hair_102.swf", "Name": "rHair102" },
"intColorSkin": 16777215,
"intColorHair": 4210752,
"intColorEye": 65280
}
}Character Dialog (type: "dialog"):
{
"type": "dialog",
"data": {
"url": "https://game.aq.com/game/gamefiles/",
"gender": "M",
"ia1": 0,
"equipment": {
"en": { "File": "none", "Link": "" },
"co": { "File": "SomeClass.swf", "Link": "rSomeClass" },
"he": { "File": "none", "Link": "" },
"Weapon": { "File": "SomeWeapon.swf", "Type": "Sword", "Link": "rSomeWeapon" },
"ba": { "File": "none", "Link": "" },
"pe": { "File": "none", "Link": "" },
"mi": { "File": "none", "Link": "" }
},
"hair": { "File": "hair/Hair_101.swf", "Name": "rHair101" },
"intColorSkin": 16777215,
"intColorHair": 8421504,
"intColorEye": 255
}
}The application includes debug buttons for:
- Restart TCP: Restart the TCP server
- Clear Loader: Clear all loaded assets
- Show Children: List all display objects
The server responds with Base64-encoded PNG image data that can be decoded and displayed by the client application.
- Adobe Animate/Flash Professional or compatible IDE
- ActionScript 3.0 support
- Adobe AIR Runtime (required for TCP socket functionality)
- Adobe AIR SDK for compilation and packaging
# Using Adobe Animate
1. Open item-preview.fla
2. File > Publish Settings > Adobe AIR
3. Configure AIR application settings
4. PublishSet Main.DEBUG = true to enable verbose logging of:
- TCP connection events
- Asset loading progress
- Render pipeline execution
- Error stack traces
Contributions, issues, and feature requests are welcome! Feel free to fork the repo and submit pull requests.
This project is licensed under the MIT License.