Monthly Archives: May 2005

Scaling Flex


There are many ways to scale a Flex server but there is only one technique that is foolproof, scalable, and will not crash under load.&

Answer: Deploy Flex apps as static SWF files. :)

I am a big fan of MXML as a compiler technology but I have yet to embraced the big enterprise server model. In all my Flex apps, all my Web Service and Remoting calls use useProxy=”false”. I do not use the server services at all and actually avoid using them to allow for scalability. I am a fan of Flex but aspects of the model need improvement and are certainly not designed with me in mind, I am no Enterprise, yet. There are cases where the services add tremendous value to Flex but I do not fall within this realm, yet some of my clients do.

**NOTE – Flex licensing issues need to be discussed with Macromedia directly. I cannot answer these questions and frankly I do not want to. Also remember that uses of Flex are different and there are various licenses for OEM, ISV, and corporate use. This is a minefield that I do not want to enter. Talk to Macromedia.**

This is how I scale and deploy Flex:

1. Use one server CPU for development/staging (Flex Server Installed).
2. Use one server CPU for deployment (Flex Server NOT Installed).
3. Use one server CPU for my laptop. :)

I have a build script in Python that loads the following URL:

http://{devserver}/{flexpath}/{mxmldocument}.mxml.swf

This returns a SWF file from the MXML compiler. This file is then tested locally and deployed to production. On the production server, I have custom HTML/JS that supports custom Object/Embed tags providing History management and player detection.

Flex is an excellent development model but I am not convinced that the server services are for everyone. Although, that said, I will probably find some amazingly cool feature that requires the services and take back what I have said here. Until that time it is pure Flex SWF for me.

Cheers,

Ted :)

Flex Example – Accordion Repeater


Here is a simple example of the power of Flex. The example provides a dynamic Accordion based on the data within an XML document. It uses MX:Repeater, MX:Accordion, and MX:List. This took 10 minutes to build from scratch.&

Download XMLAccordionRepeater
Download XMLAccordionRepeater with JesterXL CSS

Thanks Jesse for the slick CSS work. :)

If you would like to see more of these types of examples.
Please leave a comment or send me an email.

Cheers,

Ted ;)

Embracing Flex and New Company


I have been working with Flex allot lately. It has been an amazing journey, 3 consulting projects are complete, rates have doubled, and I am starting a new company. I have embraced Flex.&

I initially resisted learning Flex because I misunderstood the product. I judged Flex based on a seemingly high price and thus I only tinkered with the features and tools. In building Flow, I looked deeper into Flex and built some sample applications to see what Macromedia was thinking. I was very shocked at just how deep Flex was and how robust the toolset is in practice. From the MXMLC compiler to the debugger, these tools are a generation ahead of anything on the market for delivering applications to the Flash Player. Somewhere about this time, I got my first Flex consulting project and that changed everything.

The client found me through my blog posts about V2 Components and ActionScript. They took a risk in choosing a green Flex developer and I am very grateful. I learned Flex by being dropped into a Flex project and scrambling to learn the tools and techniques. At first I struggled with MXML and AS integration but soon found myself making components and classes for Flex. I went from 0-100 MPH with a toolset I had rarely used, but strangely, I knew what I was doing. The advantage for me was that I am good at ActionScript and understand the Flash Player very well. Once I understood the Flex compiler model and what was going at compile-time and run-time, I haven’t looked back.

The key benefit in Flex is automation. Flex allows me to work about 500% faster than in Flash and allows me to reuse presentation/business logic on a much higher level. For RIA development, I can get to 90% completion in about 1/3 of the time using Flex compared to Flash. Flex allows me to separate application logic from the view cleanly and allows me to style an application with CSS/AS Skins. Flex has removed 100′s of mindless tasks that used to burden my development in Flash. Flex simply saves me time and allows me to work at a higher level.

One of the more interesting discoveries was that Flex MXML is highly reconfigurable. In development, I focus on functionality first and get something working quickly. It never looks good but it contains all the controls and logic needed. I then clean up the UI for the client presentation. On several occasions I sat down with the client and we would make edits in real-time via CSS and shifting XML blocks around. Since the Flex component namespace is flattened, you can shift controls around on screen and not break any of the UI logic. In practice I was able to effectively change an application UI late in the development cycle. This allowed me to focus on the requirements and allow the applications to support a rich UI that met client expectations.

The other thing that has stunned me is that my consulting rates have more than doubled. Companies who use Flex are willing to invest in software and infrastructure to do the job right. They are better clients and they pay better rates. I thought Flex projects would be shorter given Flex automation and higher rates, but rather, the scope of the projects is much larger and more ambitious. The void created by Flex automation is quickly filled with new requirements and larger scope. Flex didn’t automate me out of a job but rather allowed me to work on larger projects at better rates.

So what is next for me…..

I have started a new company focused on supporting business use of Flex and Flash. Over the next 3 years there will be massive adoption of Flash/Flex as an application medium as the Internet embraces the RIA. I have partnered with the best developers that anyone could imagine and there are great projects afoot. We are weeks away from a public beta of some revolutionary software that will change the way you learn, develop, and reuse software.

To jumpstart development, we licensed Flex for commercial use.

Here goes start-up #4 for me!

Cheers,

Ted ;)

MTASC Build v1 – A Python Build System for MTASC


It is important to make compilation a consistent, repetitive, and ‘brainless’ process via automation. I built this Python script for MTASC to compile projects in a consistent and cross platform manner.&

1. Download MTASCBUILD001.zip

2. Make sure you have Python installed.

3. Run build.py

The script compiles an AS class to SWF and launches the SWF for testing. If the build results in an error, the errors will be output to the console.

This script is very easy to modify and port to OSX or Linux. All paths are cross platform using Pythons’s ‘os’ library and all you need to change is the path to MTASC and the specifics of your class.

To make this simple, I included the latest build of MTASC for windows in the ZIP. If you have Python installed, simply run build.py and the compiled SWF will appear.

Hope this helps you get started using MTASC. Automation makes the world go round! ;)

Cheers,

ted ;)

Rubber Band Shooting 101


In high school I worked summers at an engineering firm in Austin, TX. Given the high number of rubber bands in the office for blueprints, there were lots of rubber band wars. Here is the secret to shooting a rubber band well.&

The key to shooting a rubber band well is unequal tension when it is fired. That sounds strange and counterintuitive but trust me, you will be able to shoot a rubber band 20ft and hit exactly what you want with practice.

Flash Video Training – Rubber Band Shooting 101

In the video, one side of the rubber band has more tension than the other. When released this forces the rubber band to rotate as it moves toward its target. The rotation lowers the drag and generally makes the band more aerodynamic. The rubber band will go almost 3x as far with a much higher level of accuracy.

It takes some practice to get the technique down, but in time you will be a jedi master of rubber band shooting in your office. Just make sure you use good rubber bands, the cheap ones will break and backfire using this technique.

Let the battle begin.

Happy Friday,

Ted ;)