Aspire UI Components (Flash ActionScript 3.0) Docs

Excluding Skin Assets

NOTE:

As of Version 1.3.0+, you may compress skin assets into a single binary file. By using the packing tool, “Amber”, provided in the Aspire UI distribution, you can easily exclude skin assets when packing the theme.

See Packing Skin Assets


It is important to note that all the skin assets defined in the “rules.xml” file will be (pre)loaded, regardless of whether they will be used or not in your application. If your application does not use all the skin assets in the theme, you may want to exclude the unused assets from the “rules.xml” file when the application is ready for deployment, especially if you are deploying online.

To prevent a skin asset from being loaded into your application (even if it exists in the theme folder), simply remove its entry in the “rules.xml” file.

For example, a simple application that uses only uiLabelButton and uiRadioButton instances may use a stripped down “rules.xml” file:

1: <rules theme="xp" css="text.css">
2:     <Button slices="up,over,emphasized_over,down,emphasized_down,selected_up,selected_over,selected_down,disabled,selected_disabled,emphasized" prefs="padding|3,6|focusPadding|3|displaceX|1|displaceY|1" />
3:     <CheckBox slices="up,over,down,selected_up,selected_over,selected_down,disabled,selected_disabled" />
4:     <FocusRect edge="1" repeat="xy" />
5:     <LabelButton clone="Button" />
6:     <RadioButton copy="CheckBox" />
7: </rules>

Be careful of “clone” and “copy” attributes when stripping the XML file. For example, in the above XML:

  • the “clone” attribute in the “LabelButton” node indicates that “LabelButton” skin is a clone/mirror of the “Button” skin - do not remove the “Button” node otherwise you won't have “Button” to clone from (“Button.png” will be loaded instead of “LabelButton.png” which does not exist).
  • the “copy” attribute in the “RadioButton” node indicates that it should copy all the attributes (rules) from the “CheckBox” node. In this case, you must not delete the “CheckBox” node without copying all the attributes over manually.

Since we don't want to load the “CheckBox” skin, we will strip it off as well after copying its attributes over to “RadioButton”:

1: <rules theme="xp" css="text.css">
2:     <Button slices="up,over,emphasized_over,down,emphasized_down,selected_up,selected_over,selected_down,disabled,selected_disabled,emphasized" prefs="padding|3,6|focusPadding|3|displaceX|1|displaceY|1" />
3:     <FocusRect edge="1" repeat="xy" />
4:     <LabelButton clone="Button" />
5:     <RadioButton slices="up,over,down,selected_up,selected_over,selected_down,disabled,selected_disabled" />
6: </rules>

NOTE: You would also want to retain the “FocusRect” asset as well - if you remove it, no focus rectangle will be drawn.


 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki