Using MTASC with the OSX Terminal Part 1

I’m attempting to clarify and document all the methods I intend to use to Compile and Publish to swf files.
The bare bones method would be to use the OSX Terminal.
The following is an abridged OSX specific version of the text in mtasc.org.

Tasks

1. Download MTASC see: mtasc.org

2. Place in applications folder.

3. Open the Terminal Application.

4. Add the path to the MTASC Application in the Terminal:

$ export PATH=$PATH:/Applications/mtasc-1.13-osx/

5. Test by tying MTASc in the Terminal:

$ mtasc

If the the app has been correctly downloaded and the path correctly set the output will be something like:

	 Usage : mtasc.exe [options] 
 Options :
  -pack  : compile all files in target package
  -cp  : add classpath
  -v : turn on verbose mode
  -strict : turn on strict mode
  -infer : turn on local variables inference
  -wimp : turn on warnings for unused imports
  -msvc : use MSVC style errors
  -mx : use precompiled mx package
  -swf  : swf file to update
  -out  : swf output file
  -keep : does not remove AS2 classes from input SWF
  -frame  : export into target frame (must exist in the swf)
  -main : enable main entry point
  -header  : specify header format 'width:height:fps'
  -group : group classes into a single clip
  -exclude  : exclude classes listed in file
  -version : change SWF version (6,7,8,...)
  -trace  : specify a TRACE function
  -help  Display this list of options
  --help  Display this list of options

Which lists all the MTASC Commands.

6. Create a folder to create project in.

$ mkdir tuto

7. Duplicate the Tuto.as Class from the mtasc.org page and save in folder:

class Tuto {

	static var app : Tuto;

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

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

8. make MTASC publish swf enter in the Terminal:

$ mtasc -swf tuto.swf -main -header 800:600:20 Tuto.as

This should create a tuto.swf file in the tuto folder.

———————————————-

9. The flags seen in the help output above can be added to the call launch MTASC for instance:

mtasc -v -swf tuto.swf -main -header 800:600:20 Tuto.as

Will produce a verbose output link which includes:

 as
Classpath : /Applications/mtasc-1.13-osx/std/;/Applications/mtasc-1.13-osx/;;/
Parsed /Applications/mtasc-1.13-osx/std/StdPresent.as
 --
 --
Parsed Tuto.as
Typing Tuto.Tuto
 --
Time spent : 0.004443

I’ll attempt to test further MTASC Commands in further posts, I’ve just found a MTASC forum.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s