Difference between revisions of "Actionscript"

From Chumby Wiki
Jump to: navigation, search
(Flash Utilities)
 
Line 45: Line 45:
 
This dongle has built versions of many Open and Free Flash utilities: MTASC, Flasm, swfmill, swftools, and various GIF and JPEG utilities.
 
This dongle has built versions of many Open and Free Flash utilities: MTASC, Flasm, swfmill, swftools, and various GIF and JPEG utilities.
  
Download from [url=http://files.chumby.com/languages/actionscript/osflash_chumby1.7.tar.gz osflash_chumby1.7.tar.gz], unpack.  For some utilities, you may have to set the library path to /mnt/usb/lib.
+
Download from [http://files.chumby.com/languages/actionscript/osflash_chumby1.7.tar.gz osflash_chumby1.7.tar.gz], unpack.  For some utilities, you may have to set the library path to /mnt/usb/lib.

Latest revision as of 15:19, 1 June 2009

MTASC

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).

Flash Utilities

This dongle has built versions of many Open and Free Flash utilities: MTASC, Flasm, swfmill, swftools, and various GIF and JPEG utilities.

Download from osflash_chumby1.7.tar.gz, unpack. For some utilities, you may have to set the library path to /mnt/usb/lib.