You know what it’s like. The years of frustration spending time with other languages, other IDEs…dealing with all the inadequacies, all the workarounds needed just to make your time together go a little smoother…
Then one day, you hear about this new one everybody’s talking about. At first glance you think it’s way out of your league while harboring a secret desire to just ‘jump in’ you wonder if you might not be man enough.
Then one day you get up the nerve and fire it up, and begin to play…and the first time is amazing. Never has it been so easy for you to communicate your ideas, never has it been this exciting to get something going. You’re in heaven, you can’t think of anything else; hours pass unnoticed as you spend your every waking moment just trying to take this relationship deeper, to understand better…
If you keep it on the surface and just go with the flow, everything will be easy, light; nothing too committed. But attempt to go a bit under the surface and you’ll soon learn about your current partner’s ‘issues’….
First that your new lady is bi-lingual. [Get your mind outta the gutter!] — Actionscript and MXML markup.
Actionscript 3 has broken it’s class domains a bit differently than AS2, and changed the way items are displayed. Coming from a Director background myself, the idea of ‘Sprites’ are new to Flash/Flex, but have been around for a long time, especially in the gaming industry. The messaging protocal has changed as well; and once understood, it’s much cleaner and helps with some ’scope’ issues of the past (pretty ladies like fresh breath).
Flex can be written in Actionscript 3 or the MXML nomenclature (xml documents that layout user interfaces extremely easy but can hold AS3 scripts within CDATA tags as well.
As I’m recoding the ScribeLive application in Flex, I’m breaking subsections into new Flex Components — and it’s possible to create Components in three different ways, each offering pros and cons:
• MXML: You can take an existing visual container component (ie ‘Canvas’, ‘UIComponent’, ‘Panel’ etc) and extend it as your own Component, and add other components just like a normal mxml application. You can then create the code you need to make the component self-inclusive within the normal .
• Actionscript: Actionscript classes can be created, and the fun here is that the normal mxml components can be pulled into the Actionscript class in very interesting ways — since there’s the new displayList, you simply addChild(new component) to get ui items as part of your new component. Course, as in any relationship, there are always some slight incongruities; for example, the new Panel component has the ability to embed a ControlBar within it for buttons, comboboxes, etc. In the mxml markup it’s simple. Doing it in Actionscript means you just have to add the controlBar as the last item in the Panel’s childList.
• Code-behind: Something new is a hybrid between the above two procedures, something called ‘code-behind’, using both mxml and .as documents to create one component. For example if you had something called ToolBox, you’d have the ToolBoxClass.as and the ToolBox.mxml. The mxml doc would be used for layout and function assignment of ui elements, but the .as file would be for the real meet of the code. Then when your ToolBox component is added to your new application, though it’s one call (ie I’ll be writing more about Flex and specific instances or problems I come across as I’m re-engineering this application. It’s going to be a very interesting project, as there’s Flex, ActionScript3, Ruby and Flash Media Server (still stuck in AS2), all communicating nicely with each other. I hope there won’t be any jealousy.
Garry Schafer is DLI-ScribeMedia’s head honcho of multimedia applications. He’s currently creating a rocking Web conferencing application so we can run live events of sites like this.
