Alpha
You can set the transparency of any UI element using the alpha attribute.
SMXML
<!DOCTYPE composer SYSTEM "http://dtd.samplemath.com/smxml.dtd">
<composer>
<box id="background" width="100%" height="100%" alpha=".1" rounded="24"/>
<box id="leftBox" width="200" height="40" x="200" y="40" alpha=".25"/>
<box id="rightBox" width="100" height="80" x="350" y="40" alpha=".75"/>
</composer>
<composer>
<box id="background" width="100%" height="100%" alpha=".1" rounded="24"/>
<box id="leftBox" width="200" height="40" x="200" y="40" alpha=".25"/>
<box id="rightBox" width="100" height="80" x="350" y="40" alpha=".75"/>
</composer>
AS3
leftBox.alpha = .25;
rightBox.alpha = .75;
rightBox.alpha = .75;
OUTPUT
Visibility
To specify whether a UI element gets rendered on screen set the visible property. SMXML accepts both true/false or 0/1. In AS3 please use Boolean values.
SMXML
<!DOCTYPE composer SYSTEM "http://dtd.samplemath.com/smxml.dtd">
<composer>
<box id="background" width="100%" height="100%" alpha=".1" rounded="24"/>
<box id="leftBox" width="33%" height="40" x="20" y="20" visible="1"/>
<box id="rightBox" width="33%" height="80" right="2" y="40" visible="false"/>
</composer>
<composer>
<box id="background" width="100%" height="100%" alpha=".1" rounded="24"/>
<box id="leftBox" width="33%" height="40" x="20" y="20" visible="1"/>
<box id="rightBox" width="33%" height="80" right="2" y="40" visible="false"/>
</composer>
AS3
leftBox.visible = true;
rightBox.visible = false;
rightBox.visible = false;
OUTPUT
Unique component identifier
Each UI element can have its own unique ID set using the id attribute. This attribute is not mandatory but strongly recommended if the UI element is involved in some implementation. If an id is set, the component gets registered upon being rendered by the parent composer. It will then become globally available through its unique ID in Registry. In the example below only the box on the right is conveniently available for any implementation.
SMXML
<!DOCTYPE composer SYSTEM "http://dtd.samplemath.com/smxml.dtd">
<composer>
<box id="background" width="100%" height="100%" alpha=".1" rounded="24"/>
<box width="33%" height="40" x="20" y="20"/>
<box id="rightBox" width="33%" height="80" right="2" y="40"/>
</composer>
<composer>
<box id="background" width="100%" height="100%" alpha=".1" rounded="24"/>
<box width="33%" height="40" x="20" y="20"/>
<box id="rightBox" width="33%" height="80" right="2" y="40"/>
</composer>
Component specific attributes
Each concrete UI component may implement its own set of attibutes that you may also control from SMXML. Please read about Components and visit the SMAF Reference for more details.
There are no comments on this page. [Add comment]