Difference between revisions of "Actionscript"

From Chumby Wiki
Jump to: navigation, search
Line 1: Line 1:
'''NOTE - firmware 1.7 requires the use of Ocaml 3.12, whcih has not yet been released, but can be built from CVS.  However, apparently there's been a change to the language which is no longer compatible with MTASC.  Until either OCaml or MTASC is made compatible with the other, we cannot provide a MTASC for firmware 1.7'''
+
'''NOTE - firmware 1.7 requires the use of Ocaml 3.12, which has not yet been released, but can be built from CVS.  However, apparently there's been a change to the language which is no longer compatible with MTASC.  Until either OCaml or MTASC is made compatible with the other, we cannot provide a MTASC for firmware 1.7'''
 +
 
  
 
[http://www.mtasc.org MTASC] is an Open Source Actionscript 2 compiler that is used by several third-party Flash development systems, including FlashDevelop.
 
[http://www.mtasc.org MTASC] is an Open Source Actionscript 2 compiler that is used by several third-party Flash development systems, including FlashDevelop.

Revision as of 09:25, 25 May 2009

NOTE - firmware 1.7 requires the use of Ocaml 3.12, which has not yet been released, but can be built from CVS. However, apparently there's been a change to the language which is no longer compatible with MTASC. Until either OCaml or MTASC is made compatible with the other, we cannot provide a MTASC for firmware 1.7


MTASC is an Open Source Actionscript 2 compiler that is used by several third-party Flash development systems, including FlashDevelop.

This tool is now available natively for the chumby device.

Download it from here, unpack to a USB dongle. You should end up with the mtasc binary, and two directories, std and std8.

Insert the dongle into the back of the chumby, then SSH into the device.

Here's a simple Actionscript program, shamelessly swiped and modified from the MTASC site:

class Tuto {

	static var app : Tuto;

	function Tuto() {
		// creates a 'tf' TextField size 320x240 at pos 0,0
		_root.createTextField("tf",0,0,0,320,240);
		// write some text into it
		_root.tf.text = "Hello world !";
	}

	// entry point
	static function main(mc) {
		app = new Tuto();
	}
}

Put this on the dongle as "Tuto.as", then compile it with:

# cd /mnt/usb
# ./mtasc -swf tuto.swf -main -header 320:240:12 Tuto.as

This will produce the SWF file tuto.swf. You can run this SWF file on your chumby using the command:

# chumbyflashplayer.x -i tuto.swf

This should result in the text "Hello world!" being displayed on the upper left corner of the screen.

(You might have to shut down the Control Panel in order to do this, type stop_control_panel to kill it).