Hi all.
This is something I’ve started some time ago, but, finally, today I’ve managed to compile a working version!
Main concepts.
The set of components that use MXML language and are based on MXMLC compiler features, yet don’t utilize the entire mx framework. It relies only on a few classes from it essentially needed to:
- embed resources.
- binding.
- some other compiler features like appending frames to the SWF, generating AS files from MXML etc.
The components should act as independent units, don’t create cross dependencies, thus allowing you to use groups of components rather then forcing you into importing the entire set all at once.
The project is in very early stage, and isn’t ready for production use, it is just a proof of concept. There must be bugs, not enough features etc, etc.
The project home is here:
http://code.google.com/p/e4xu/
Here’s an example code for a project:
http://e4xu.googlecode.com/files/framework.swc
This is a patched framework.swc from SDK 3.2.
It is different from the one you may download with the respective SDK in this:
- ObjectUtils doesn’t depend on IUIComponent.
- ICollectionView doesn’t depend on Sort (thus, doesn’t depend on SystemManager).
- StyleManager and ServerConfig are completely replaced.
- It doesn’t contain assets, styles and all the visual components / data utilities etc.
The example project is here:
http://e4xu.googlecode.com/files/frameworkless.zip
(completed using FlashDevelop, regretfully, right for now I have issues reproducing it in Flex Builder, but those are some tech. issues I may solve in a near future).
In order to compile it you’ll have to:
- compile against the patched SWC.
- compile with “-defaults-css-url empty.css” additional compiler argument, where “empty.css” would be an empty CSS file (this is needed to not include styles, which the project doesn’t use anyway).
I will be happy to hear your feedback in case this interests you.
Some additional info about the project.
Total classes compiled: 27
Size (debug): 14.8 K
Size (release): 10.4 K
The project consists of 2 frames, first is a “preloader”, second is an “application”.
You may edit both frames using MXML.
Here’re the MXML files:
“FirstFrame.mxml”
<?xml version="1.0" encoding="utf-8"?>
<e4xu:FrameOne
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:e4xu="http://e4xu.googlecode.com"
frameTwoAlias="view.SecondFrame"
width="800"
height="600"
>
<mx:Script>
<![CDATA[
private function test(a:String, b:String, c:String, d:String):void
{
trace(arguments);
}
]]>
</mx:Script>
<e4xu:preloader>
<e4xu:Preloader
id="testPreloader"
width="800"
height="600"
complete="testInvoker.call()"
/>
</e4xu:preloader>
<e4xu:Invoker id="testInvoker">
<e4xu:callbacks>
<e4xu:CallBack method="{test}">
<e4xu:parameters>
<mx:String>This</mx:String>
<mx:String>is</mx:String>
<mx:String>test</mx:String>
<mx:String>method</mx:String>
</e4xu:parameters>
</e4xu:CallBack>
</e4xu:callbacks>
</e4xu:Invoker>
</e4xu:FrameOne>
“SecondFrame.mxml”
<?xml version="1.0" encoding="utf-8"?>
<e4xu:FrameTwo
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:e4xu="http://e4xu.googlecode.com"
width="800"
height="600"
backgroundColor="0x3E2F1B"
initialized="testMe()"
>
<mx:Metadata>
[SWF(width="800", height="600", scriptTimeLimit="15", frameRate="30", backgroundColor="0x3E2F1B")]
[Frame(factoryClass="view.FirstFrame")]
[Frame(extraFrame="view.FirstFrame")]
[Mixin]
</mx:Metadata>
<mx:Script>
<![CDATA[
import mx.messaging.config.ServerConfig
private function testMe():void
{
trace("testMe()");
trace(ServerConfig.xml);
}
]]>
</mx:Script>
<e4xu:Input
id="testInput"
text="Test text"
align="center"
background="true"
backgroundColor="#FF8811"
width="700"
height="25"
x="50"
y="20"
/>
</e4xu:FrameTwo>
PPS. this project also assumes you compile with -services “services-config.xml”, but if you don’t, the last trace() (i.e. trace(ServerConfig.xml); will trace null)