Thursday, April 15, 2010

MXML without Flex

Yesterday while working in Paris a co-worker seamed to be a bit surprised that it's possible to use MXML whithout extensive dependencies on the Adobe Flex Framework. So I made a tiny example app. Of course it's smaller than 20kb.

Surprisingly most people are more interested in using the component framework without MXML than the oposite. Maybe they haven't mentioned the advantages of declarative language features in the right development environment for tasks like composition, skinning and configuration. Don't get me wrong - most of the things I'm developing are programmed in Actionscript!

In this case the [DefaultProperty] and [ArrayElementType] Metatags are essential. Just have a look!

source


The next step is to focus a bit more on the Databinding feature.

source

In a real world application no one would use a code block inside of his MXML file by choice. Instead of this e.g. a Presentation Model or Presenter Pattern can be applied.

If you use the additional compiler argument -keep you will mention that several classes of the mx.core.* and mx.bindings.* package are imported in the generated code. but hey! do we really care about this hand full of kb?

Thursday, November 5, 2009

AMF3 remote procedure call and class mapping without Flex / mx.rpc package

If you want to avoid dependencies to the mx.rpc package and got problems with AMF3 remote procedure calls and class mapping here's a small example.

example application, source

AMFPHP

Friday, October 16, 2009

Thursday, October 15, 2009

Constantin Film - Pandorum

While the kids were playing in the sun I've developed another project using the PureMVC micro architecture and my favorite IoC container SpringActionscript. It's the microsite for Constantin Film's new Scifi-Horror movie Padorum. I used Papervision3D for the background animations, gallery etc. check out the fullscreen mode - looks nice!

Additionally we created a Flash module that also runs on the Pandorum Facebook page called Psychotest. While the user has to pass a shocking test including tiny games his image is captured. At the end he's able to post his more or less crazy images on his Facebook page and share thoughts about the movie.

Project, Facebook App

Client

PureMVC, SpringActionscript, Papervision3D

Tetra Pak - Umwelt

A project i developed this summer using the micro architechture framework PureMVC and the IoC container SpringActionscript. The 3D Designer used Away3D to implement the model.
I like the concept of a realtime animated 3D avatar answering questions, his lips are synchrone to the voice of the speaker.

Project

Client

PureMVC, SpringActionscript, Away3D

Monday, April 20, 2009

Styling text within Flash TextField using ActionScript3 & external CSS file

I've made an example for styling text in an ActionScript3 project without using any Flex classes.
I embedded font, css & xml-files - feel free to load these at runtime.

source

Embed your fonts, styles & data
[Embed(source="/assets/font/Verdana.ttf", fontFamily="embeddedFont", mimeType="application/x-font-truetype")]
private static const embeddedFont:Class;
[Embed(source="/assets/font/Verdana Bold.ttf", fontFamily="embeddedFontBold", fontWeight="bold", mimeType="application/x-font-truetype")]
private static const embeddedFontBold:Class;
[Embed(source="/assets/css/textFieldStyles.css", mimeType="application/octet-stream")]
public static const styleSheet:Class;
[Embed(source="/assets/xml/data.xml", mimeType="application/octet-stream")]
public static const xmlData:Class;
Register fonts
public function Application() {
Font.registerFont(embeddedFont);
Font.registerFont(embeddedFontBold);
createTextField();
}
Create TextField, assign StyleSheet and data
private function createTextField():void {
var textField:TextField = new TextField();
addChild(textField);

textField.width = 500;
textField.multiline = true;
textField.wordWrap = true;
textField.autoSize = TextFieldAutoSize.LEFT;
textField.embedFonts = true;
textField.antiAliasType = AntiAliasType.ADVANCED;

textField.styleSheet =
StyleSheetUtil.forClassDefinition(styleSheet);
textField.htmlText = new XML(new xmlData());
}

Friday, April 17, 2009

Styling text within Flex 3 TextArea using external CSS file

If you ever wondered how to use external style-sheets within a Flex 3 TextArea control to format text here's a nice solution.

example application
source

Embed your textfield styles in flex-applications css file
Application {
fontFamily: embeddedFont;
styleSheet: Embed(source="textFieldStyles.css", mimeType="application/octet-stream");
}
Create StyleSheet from style-definition and assign it and your data to the TextArea instance
private function applicationComplete():void {
textArea.styleSheet =
StyleSheetUtil.forClassDefinition(getStyle("styleSheet"));
textArea.htmlText = data;
}