Move FLA files to external folder
diff --git a/frameworks/themes/AeonGraphical.fla b/frameworks/themes/AeonGraphical.fla
new file mode 100644
index 0000000..457ce36
--- /dev/null
+++ b/frameworks/themes/AeonGraphical.fla
Binary files differ
diff --git a/frameworks/themes/README b/frameworks/themes/README
new file mode 100644
index 0000000..dadb551
--- /dev/null
+++ b/frameworks/themes/README
@@ -0,0 +1,3 @@
+This folder contains FLA files used to generate FXG files for the samples/themes.  Before using these files to re-generate the FXG files make sure nobody has otherwise modified the FXG files otherwise you will overwrite their changes.
+
+To generate FXG files, place all library symbols you want to export on the stage, select all, then choose Export Selection and generate one big FXG file.  Then use FXGRefactor app (from the utilities folder) to cut the FXG file into many small FXG files.
\ No newline at end of file
diff --git a/utilities/FXGRefactor/FXGRefactor-app.xml b/utilities/FXGRefactor/FXGRefactor-app.xml
new file mode 100644
index 0000000..c4c02af
--- /dev/null
+++ b/utilities/FXGRefactor/FXGRefactor-app.xml
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->

+<application xmlns="http://ns.adobe.com/air/application/3.1">

+

+<!-- Adobe AIR Application Descriptor File Template.
+
+	Specifies parameters for identifying, installing, and launching AIR applications.
+
+	xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/2.6
+			The last segment of the namespace specifies the version 
+			of the AIR runtime required for this application to run.
+			
+	minimumPatchLevel - The minimum patch level of the AIR runtime required to run 
+			the application. Optional.
+-->

+

+	<!-- A universally unique application identifier. Must be unique across all AIR applications.
+	Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->

+	<id>FXGRefactor</id>

+

+	<!-- Used as the filename for the application. Required. -->

+	<filename>FXGRefactor</filename>

+

+	<!-- The name that is displayed in the AIR application installer. 
+	May have multiple values for each language. See samples or xsd schema file. Optional. -->

+	<name>FXGRefactor</name>

+	

+	<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade. 
+	Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
+	An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5 . -->

+	<versionNumber>1.0.0</versionNumber>

+		         

+	<!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->

+	<!-- <versionLabel></versionLabel> -->

+

+	<!-- Description, displayed in the AIR application installer.
+	May have multiple values for each language. See samples or xsd schema file. Optional. -->

+	<!-- <description></description> -->

+

+	<!-- Copyright information. Optional -->

+	<!-- <copyright></copyright> -->

+

+	<!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->

+	<!-- <publisherID></publisherID> -->

+

+	<!-- Settings for the application's initial window. Required. -->

+	<initialWindow>

+		<!-- The main SWF or HTML file of the application. Required. -->

+		<!-- Note: In Flash Builder, the SWF reference is set automatically. -->

+		<content>FXGRefactor.swf</content>

+		

+		<!-- The title of the main window. Optional. -->

+		<!-- <title></title> -->

+

+		<!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->

+		<!-- <systemChrome></systemChrome> -->

+

+		<!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->

+		<!-- <transparent></transparent> -->

+

+		<!-- Whether the window is initially visible. Optional. Default false. -->

+		<!-- <visible></visible> -->

+

+		<!-- Whether the user can minimize the window. Optional. Default true. -->

+		<!-- <minimizable></minimizable> -->

+

+		<!-- Whether the user can maximize the window. Optional. Default true. -->

+		<!-- <maximizable></maximizable> -->

+

+		<!-- Whether the user can resize the window. Optional. Default true. -->

+		<!-- <resizable></resizable> -->

+

+		<!-- The window's initial width in pixels. Optional. -->

+		<!-- <width></width> -->

+

+		<!-- The window's initial height in pixels. Optional. -->

+		<!-- <height></height> -->

+

+		<!-- The window's initial x position. Optional. -->

+		<!-- <x></x> -->

+

+		<!-- The window's initial y position. Optional. -->

+		<!-- <y></y> -->

+

+		<!-- The window's minimum size, specified as a width/height pair in pixels, such as "400 200". Optional. -->

+		<!-- <minSize></minSize> -->

+

+		<!-- The window's initial maximum size, specified as a width/height pair in pixels, such as "1600 1200". Optional. -->

+		<!-- <maxSize></maxSize> -->

+	<!-- Whether or not to pan when a soft keyboard is raised or lowered (either "pan" or "none").  Optional.  Defaults "pan." -->

+		<!-- <softKeyboardBehavior></softKeyboardBehavior> -->

+	</initialWindow>

+

+	<!-- We recommend omitting the supportedProfiles element, -->

+	<!-- which in turn permits your application to be deployed to all -->

+	<!-- devices supported by AIR. If you wish to restrict deployment -->

+	<!-- (i.e., to only mobile devices) then add this element and list -->

+	<!-- only the profiles which your application does support. -->

+	<!-- <supportedProfiles>desktop extendedDesktop mobileDevice extendedMobileDevice</supportedProfiles> -->

+

+	<!-- The subpath of the standard default installation location to use. Optional. -->

+	<!-- <installFolder></installFolder> -->

+

+	<!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. -->

+	<!-- <programMenuFolder></programMenuFolder> -->

+

+	<!-- The icon the system uses for the application. For at least one resolution,
+	specify the path to a PNG file included in the AIR package. Optional. -->

+	<!-- <icon>
+		<image16x16></image16x16>
+		<image32x32></image32x32>
+		<image36x36></image36x36>
+		<image48x48></image48x48>
+		<image72x72></image72x72>
+		<image114x114></image114x114>
+		<image128x128></image128x128>
+	</icon> -->

+

+	<!-- Whether the application handles the update when a user double-clicks an update version
+	of the AIR file (true), or the default AIR application installer handles the update (false).
+	Optional. Default false. -->

+	<!-- <customUpdateUI></customUpdateUI> -->

+	

+	<!-- Whether the application can be launched when the user clicks a link in a web browser.
+	Optional. Default false. -->

+	<!-- <allowBrowserInvocation></allowBrowserInvocation> -->

+

+	<!-- Listing of file types for which the application can register. Optional. -->

+	<!-- <fileTypes> -->

+

+		<!-- Defines one file type. Optional. -->

+		<!-- <fileType> -->

+

+			<!-- The name that the system displays for the registered file type. Required. -->

+			<!-- <name></name> -->

+

+			<!-- The extension to register. Required. -->

+			<!-- <extension></extension> -->

+			

+			<!-- The description of the file type. Optional. -->

+			<!-- <description></description> -->

+			

+			<!-- The MIME content type. -->

+			<!-- <contentType></contentType> -->

+			

+			<!-- The icon to display for the file type. Optional. -->

+			<!-- <icon>
+				<image16x16></image16x16>
+				<image32x32></image32x32>
+				<image48x48></image48x48>
+				<image128x128></image128x128>
+			</icon> -->

+			

+		<!-- </fileType> -->

+	<!-- </fileTypes> -->

+

+    <!-- iOS specific capabilities -->

+	<!-- <iPhone> -->

+		<!-- A list of plist key/value pairs to be added to the application Info.plist -->

+		<!-- <InfoAdditions>
+            <![CDATA[
+                <key>UIDeviceFamily</key>
+                <array>
+                    <string>1</string>
+                    <string>2</string>
+                </array>
+                <key>UIStatusBarStyle</key>
+                <string>UIStatusBarStyleBlackOpaque</string>
+                <key>UIRequiresPersistentWiFi</key>
+                <string>YES</string>
+            ]]>
+        </InfoAdditions> -->

+        <!-- <requestedDisplayResolution></requestedDisplayResolution> -->

+	<!-- </iPhone> -->

+

+	<!-- Specify Android specific tags that get passed to AndroidManifest.xml file. -->

+	<!--<android> 
+		<manifestAdditions>
+		<![CDATA[
+			<manifest android:installLocation="auto">
+				<uses-permission android:name="android.permission.INTERNET"/>
+				<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+				<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
+				<uses-configuration android:reqFiveWayNav="true"/>
+				<supports-screens android:normalScreens="true"/>
+				<uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
+				<application android:enabled="true">
+					<activity android:excludeFromRecents="false">
+						<intent-filter>
+							<action android:name="android.intent.action.MAIN"/>
+							<category android:name="android.intent.category.LAUNCHER"/>
+						</intent-filter>
+					</activity>
+				</application>
+			</manifest>
+		]]>
+		</manifestAdditions> 
+	</android> -->

+	<!-- End of the schema for adding the android specific tags in AndroidManifest.xml file -->

+

+</application>

diff --git a/utilities/FXGRefactor/FXGRefactor.mxml b/utilities/FXGRefactor/FXGRefactor.mxml
new file mode 100644
index 0000000..01bf3e6
--- /dev/null
+++ b/utilities/FXGRefactor/FXGRefactor.mxml
@@ -0,0 +1,284 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<s:WindowedApplication
+    xmlns:mx="library://ns.adobe.com/flex/mx"
+    xmlns:fx="http://ns.adobe.com/mxml/2009"
+    xmlns:s="library://ns.adobe.com/flex/spark"
+    width="100%" height="100%"
+    >
+    <fx:Script>
+        <![CDATA[
+			/**
+			 * Takes an FXG composed of many symbols and breaks each one up into its own FXG file.
+			 * The FXG compiler doesn't make library definitions public as symbols so splitting
+			 * into multiple files is required to put each symbol in its own file.
+			 */
+			
+			private var sourceFile:File = new File();
+			
+			private function browse():void
+			{
+				var fxgFilter:FileFilter = new FileFilter("FXG", "*.fxg");
+				sourceFile.browseForOpen("Select FXG file", [fxgFilter]);
+				sourceFile.addEventListener(Event.SELECT, fileSelected);
+			}
+			
+			private function fileSelected(event:Event):void
+			{
+				sourceFileTI.text = sourceFile.nativePath;
+			}
+			
+			private var sourcePath:String;
+			private var sourceDir:String;
+			private var slash:String;
+			private var sourceStream:FileStream;
+			private var sourceString:String;
+			private var sourceXML:XML;
+			
+			private var xml1:XML = <afx:foo xmlns:afx="http://ns.apache.org/flex/2012" />;
+			private var afxns:Namespace = xml1.namespace();
+			private var xml2:XML = <flm:foo xmlns:flm="http://ns.adobe.com/flame/2008" />;
+			private var flmns:Namespace = xml2.namespace();
+
+			private var fxgns:Namespace = new Namespace("http://ns.adobe.com/fxg/2008");
+			
+			private var originalNameQName:QName = new QName(flmns, "originalName");
+			
+			private function refactor():void
+			{
+				if (Capabilities.os.indexOf("Windows") != -1)
+					slash = "\\";
+				else
+					slash = "/";
+				
+				sourceFile.nativePath = sourceFileTI.text;	
+				sourcePath = sourceFile.nativePath;
+				var c:int = sourcePath.lastIndexOf(slash);
+				sourceDir = sourcePath.substring(0, c);
+				
+				sourceStream = new FileStream();
+				sourceStream.open(sourceFile, FileMode.READ);
+				sourceString = sourceStream.readUTFBytes(sourceStream.bytesAvailable);
+				
+				sourceXML = XML(sourceString);
+				callLater(makeFXGFiles);
+			}
+			
+			private var topTags:XMLList;
+			private var numTags:int;
+			private var curTag:int = 0;
+			
+			private var symbols:Object = {};
+			private var symbolList:Array = [];
+			
+			private function makeFXGFiles():void
+			{
+				default xml namespace = fxgns;
+				var topGroups:XMLList = sourceXML.Group;
+				if (topGroups.length() > 1)
+					errorLabel.text = "Unexpected: More than one top-level group";
+				topTags = topGroups.children();
+				numTags = topTags.length();
+				
+				var syms:XMLList = sourceXML.Library.children();
+				var n:int = syms.length();
+				for (var i:int = 0; i < n; i++)
+				{
+					var node:XML = syms[i];
+					symbols[node.@name] = node;
+				}
+				callLater(makeFXGFile);
+			}
+			
+			private function makeFXGFile():void
+			{
+				if (curTag == numTags)
+				{
+					callLater(makeMainClass);
+					return;
+				}
+				
+				var tag:XML = topTags[curTag++];
+				var tagName:String = tag.localName();
+				if (tagName == "Group")
+				{
+					callLater(makeFXGFile);
+					return;
+				}
+				if (tagName == "RichText")
+				{
+					callLater(makeFXGFile);
+					return;
+				}
+				if (tagName.indexOf("not_for_export") != -1)
+				{
+					callLater(makeFXGFile);
+					return;
+				}
+				var definitions:XMLList = sourceXML.Library.Definition.(@name == tagName);
+				if (definitions.length() != 1)
+				{
+					errorLabel.text = definitions.length().toString() + " definitions of " + tagName;
+					return;
+				}
+				var newName:String = tagName;
+				var definition:XML = definitions[0];
+				var originalNames:XMLList = definition.attribute(originalNameQName);
+				if (originalNames.length() == 1)
+				{
+					var originalName:String = originalNames.toString();
+					var c:int = originalName.lastIndexOf("/");
+					newName = originalName;
+					if (c != -1)
+						newName = originalName.substring(c + 1);
+				}
+			
+				var newFXG:XML = definition.copy();
+				// change name from 'Definition' to 'Graphic'
+				newFXG.setName("Graphic");
+				newFXG.addNamespace(afxns);
+				newFXG.addNamespace(flmns);
+				
+				// delete name attribute
+				delete newFXG.@name;
+				
+				// add version
+				newFXG.@version = "2.0";
+					
+				// add afx:className and baseclassName
+				newFXG.@afxns::className = newName;
+				newFXG.@afxns::baseClassName = "flash.display.Sprite";
+				
+				addLibrarySymbols(newFXG, newFXG);
+				
+				symbolList.push(newName);
+				
+				// write out file
+				var destFile:File = new File(sourceDir + slash + newName + ".fxg");
+				var writeStream:FileStream = new FileStream();
+				writeStream.open(destFile, FileMode.WRITE);
+				writeStream.writeUTFBytes(xmlheader);
+				writeStream.writeUTFBytes(newFXG.toXMLString());
+				writeStream.close();
+				
+				callLater(makeFXGFile);
+				errorLabel.text = "Wrote " + destFile.nativePath;
+			}
+
+			private function addLibrarySymbols(xml:XML, symbol:XML):void
+			{
+				// find dependent library entries
+				var allChildren:XMLList = symbol.descendants();
+				var n:int = allChildren.length();
+				for (var i:int = 0; i < n; i++)
+				{
+					var node:XML = allChildren[i];
+					var nodeName:String = node.localName();
+					if (symbols[nodeName])
+					{
+						if (xml.Library.length() == 0)
+							xml.insertChildBefore(xml.children()[0], <Library />);
+						var child:XML = symbols[nodeName];
+						if (xml.Library.children().length() == 0)
+							xml.Library.appendChild(child);
+						else if (xml.Library[nodeName].length() == 0)
+							xml.Library.insertChildBefore(xml.Library.children()[0], child);
+						addLibrarySymbols(xml, child);
+					}
+				}
+			}
+
+			private var firstPart:String = "package {\nimport flash.display.Sprite;\npublic class flex_skins extends Sprite\n{\n\tpublic function flex_skins(){}\n\nprivate var assets:Array = [\n";
+			private var secondPart:String = "];\n}\n}\n";
+			private function makeMainClass():void
+			{
+				// write out file
+				var destFile:File = new File(sourceDir + slash + "flex_skins.as");
+				var writeStream:FileStream = new FileStream();
+				writeStream.open(destFile, FileMode.WRITE);
+				writeStream.writeUTFBytes(asheader);
+				writeStream.writeUTFBytes(firstPart);
+				var n:int = symbolList.length - 1;
+				for (var i:int = 0; i < n; i++)
+				{
+					writeStream.writeUTFBytes(symbolList[i] + ",\n");					
+				}
+				writeStream.writeUTFBytes(symbolList[i] + "\n");					
+				writeStream.writeUTFBytes(secondPart);
+				writeStream.close();
+				errorLabel.text = "Wrote " + destFile.nativePath;				
+			}
+        ]]>
+    </fx:Script>
+    <fx:Declarations>
+		<fx:String id="xmlheader">
+<![CDATA[<?xml version="1.0" encoding="utf-8" ?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+]]>
+		</fx:String>
+		<fx:String id="asheader">
+<![CDATA[////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+]]>
+		</fx:String>
+    </fx:Declarations>
+	<s:VGroup width="100%" >
+	    <s:HGroup width="100%">
+	        <s:Label text="Source File:" />
+	        <s:TextInput id="sourceFileTI" width="100%" />
+		<s:Button label="Browse..." click="browse()" />
+		<s:Button label="Refactor" click="refactor()" />
+	    </s:HGroup>
+	    <s:Label id="errorLabel" />		
+	</s:VGroup>
+</s:WindowedApplication>