Thursday, January 3, 2008

Flash Flex Actionscript SWF mxmlc compiler

I thought it was cool that you can compile .as files into SWF format without purchasing swf software. Thats cool!
I downloaded the Flex 2 SDK (you can download it here http://www.adobe.com/products/flex/downloads/)
I opened the readme and tried to understand it a little. Unfortunately it wasn't simple enough for me to understand, so I kind of gave up for a while.
However, using Google I found this site Beginners Guide to Getting Started with AS3 (Without Learning Flex).
Wow! that person explained it so well. He gives exapmles of .as files and how to compile them.
The simplest way that he says it is to drag your .as file over the mxmlc.exe file.
If there are errors in your actionscript code, you wont be able to see them

Quoting from his site, here is a simple example of an Actionscript file (.as)

package {
import flash.display.Sprite;
import flash.text.TextField;

public class HelloWorld extends Sprite {

public function HelloWorld() {
var display_txt:TextField = new TextField();
display_txt.text = "Hello World!";
addChild(display_txt);
}
}
}



No comments: