Specifications
67ADOBE FLEX 3
Building and Deploying Adobe Flex 3 Applications
<?xml version="1.0"?>
<!-- optimize/UnusedClasses.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="checkChildType()">
<mx:Script><![CDATA[
import mx.controls.Button;
public function checkChildType():void {
var child:DisplayObject = getChildAt(0);
var childIsButton:Boolean = child is mx.controls.Button;
trace("child is mx.controls.Button: " + childIsButton); // False.
}
]]></mx:Script>
<!-- This control is here so that the getChildAt() method succeeds. -->
<mx:DataGrid/>
</mx:Application>
You can use the getQualifiedClassName() method to accomplish the same task as the previous example. This
method returns a String that you can compare to the name of a class without causing that class to be linked into
the SWF.
The following example does not create a linker dependency on the Button control:
<?xml version="1.0"?>
<!-- optimize/GetQualifiedClassNameExample.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="checkChildType()">
<mx:Script><![CDATA[
public function checkChildType():void {
var child:DisplayObject = getChildAt(0);
var childClassName:String = getQualifiedClassName(child);
var childIsButton:Boolean = childClassName == "mx.controls::Button"
trace("child class name = Button " + childIsButton);
}
]]></mx:Script>
<!-- This control is here so that the getChildAt() method succeeds. -->
<mx:DataGrid/>
</mx:Application>
Externalizing assets
There are various methods of externalizing assets used by your Flex applications; these include:
• Using modules










