Note: Aspire UI Components Version 1.3.0+ is required.
This article explains how to embed skin assets into your SWF.
Step I: Packing Skin Assets Into A Single Theme File
First, you must pack your skin assets into a single binary file using “Amber”. Please see Packing Skin Assets for instructions.
Step II: Embedding The Packed Theme File Into SWF
Once you have the packaged theme file, you can embed this file into your SWF using the [Embed] tag:
[Embed(source="../bin/assets/skins/xpbin/assets.bin", mimeType="application/octet-stream")] private static const assetsbin:Class; // embed file as class
In the code above, change ”../bin/assets/skins/xpbin/assets.bin” to wherever your packaged theme file is stored.
Step III: Using Embedded Theme File In Application
To use the embedded theme in your application, you must instantiate the data as a ByteArray object and pass it to the uiSkins.initialize() method:
uiSkins.initialize(null, null, new assetsbin() as ByteArray); // using embedded theme data in-lieu of external assets
Note: If you did not remove the “css” directive from your “rules.xml”, the uiSkins manager will proceed to attempt to load the “text.css” CSS file from the external theme folder. In the example above, the application will look for “text.css” in the “assets/skins/default” folder.