The current version (1.0b2) of SyntaxHighlighter Plus doesn’t support ActionScript. Fortunately, you can easily import the needed AS3 brush yourself as this plugin uses the SyntaxHighlighter JavaScript package by Alex Gorbatchev.
- Download the latest version of SyntaxHighlighter here.
- Extract it, copy the file “shBrushAS3.js” (/scripts/) and paste it into the directory of your SyntaxHighlighter Plus plugin (plugins/syntaxhighlighter-plus/syntaxhighlighter/scripts/).
- Upload shBrushAS3.js
- Open syntaxhighlighter.php and add the following code in line 112:
'AS3' => array('as3'), - Your code should look like this now:
$this->aliases = apply_filters( 'agsyntaxhighlighter_aliases', array( 'AS3' => array('as3'), 'Bash' => array('bash', 'sh', 'shell'), 'Cpp' => array('cpp', 'c', 'c++'), 'CSharp' => array('c#', 'c-sharp', 'csharp'), 'Css' => array('css'), 'Delphi' => array('delphi', 'pascal'), 'Diff' => array('diff', 'patch'), 'Groovy' => array('groovy'), 'Java' => array('java'), 'JScript' => array('js', 'jscript', 'javascript'), 'Perl' => array('perl', 'pl'), 'Php' => array('php'), 'Plain' => array('', 'plain', 'text'), 'Python' => array('py', 'python'), 'Ruby' => array('rb', 'ruby', 'rails', 'ror'), 'Scala' => array('scala'), 'Sql' => array('sql'), 'Vb' => array('vb', 'vbnet', 'vb.net'), 'Xml' => array('xml', 'html', 'xhtml', 'xslt'), ) ); - Save and upload syntaxhighlighter.php.
Let’s test some sample AS3 code:
/**
* Utility.as in the example/alpha folder
*/
package example.alpha
{
import example.myInternal;
public class Utility
{
private static var _taskCounter:int = 0;
public static function someTask()
{
_taskCounter++;
}
myInternal static function get taskCounter():int
{
return _taskCounter;
}
}
}