Quinthar

HelloWorld.swf

One thing I was surprised to learn is how easy it is to program in ActionScript. It's pretty much just like a compiled version of JavaScript, with a few slight improvements. One thing to keep in mind, however, is the output is a SWF file rather than an EXE, and the "application" is very graphically oriented: I'm not even sure if you can make an ActionScript application that has no GUI. So, our basic HelloWorld application is as follows:


package {
import flash.display.Sprite;
public class HelloWorld extends Sprite {
public function HelloWorld( ) {
graphics.beginFill( 0xFFCC00 );
graphics.drawCircle( 40, 40, 40 );
}
}
}


Save that into a file named "HelloWorld.as", and then run "mxmlc.exe HelloWorld.as". It'll spit out HelloWorld.swf. Drag that into a FireFox window (or run SAFlashPlayer.exe HelloWorld.as -- it's supplied with the Flex SDK) and Tah Dah! Your very first Flash component, compiled from scratch.

- Jan 2014 (1) - Mar 2012 (1) - Nov 2011 (1) - Oct 2011 (1) - Apr 2011 (1) - Mar 2011 (3) - Feb 2011 (2) - Jan 2011 (9) - Nov 2010 (1) - May 2010 (1) - Mar 2010 (1) - Feb 2010 (1) - Jan 2010 (1) - Dec 2009 (1) - Nov 2009 (1) - Oct 2009 (1) - Sep 2009 (1) - Aug 2009 (2) - Jul 2009 (1) - Jun 2009 (4) - May 2009 (3) - Apr 2009 (3) - Mar 2009 (10) - Feb 2009 (5) - Jan 2009 (3) - Dec 2008 (5) - Nov 2008 (5) - Oct 2008 (5) - Sep 2008 (4) - Aug 2008 (5) - Jul 2008 (11) - Jun 2008 (8) - Feb 2008 (1) - Aug 2007 (1) -