/redtamarin-examples

simple demos of some of the basics of redtamarin

Primary LanguageActionScript

redtamarin examples

this project aims to provide short, helpful examples of actionscript for the redtamarin shell.

please see the individual examples for example-specific details.

pre-requisites

  • java: the actionscript compiler used by redtamarin is an executable jar

  • redtamarin: download and install redtamarin for your machine. there are great instructions at the project homepage

  • ant: the examples can all be built via the main build file if you have a recent version of ant installed. The default task lists all the build targets (just type ant).

compiling on the command line

all the examples are compiled with asc.jar.

a common pattern is:

$ java -jar asc.jar [options] [abc imports] [projector shell] yourfile.as
Tip

this can get rather tedious to type, and the only part that changes much is the source file on the end, so you might create an alias:

nix (e.g. .profile for bash)
export ASC_HOME=/opt/redtamarin/tools/bin/
ASC_OPTS="-AS3 -strict -optimize"
ASC_IMPS="-import $ASC_HOME/builtin.abc -import $ASC_HOME/toplevel.abc"
ASC_SHELL="-exe $ASC_HOME/redshell"
alias asce="java -jar $ASC_HOME/asc.jar $ASC_OPTS $ASC_IMPS $ASC_SHELL"

or

win (e.g. commandprompt portable for cmd.exe)
SET ASC_HOME=C:\redtamarin\redtamarin-tools\bin
SET PATH=%ASC_HOME%;%PATH%
SET ASC_OPTS=-AS3 -strict -optimize
SET ASC_IMPS=-import %ASC_HOME%\builtin.abc -import %ASC_HOME%\toplevel.abc
SET ASC_SHELL=-exe %ASC_HOME%\redshell.exe
@DOSKEY asce=java -jar %ASC_HOME%\asc.jar %ASC_OPTS% %ASC_IMPS% %ASC_SHELL% $*

so you can simply type:

$ asce yourfile.as