AS3 Syntax Highlighting (with SyntaxHighlighter-Plus)
As you have probably seen on a few of my posts I have syntax highlighted code. I previously was using a brush from http://www.digitalflipbook.com but the switch to Flash 10 left me wanting more. I updated the brush entirely and have the colors set to the default used in FlashDevelop. You can download the compressed and uncompressed version below. In order to use it on your WordPress blog:
Update: Fixed the RegEx’s regex so it wouldn’t highlight single line comments 1/27/09
Update2: Updated to version 1.0b2 of SyntaxHighlighter-Plus and with the upgrade to the SyntaxHighlighter 2 engine my brush is broken. Here is a link to the new version and old version. Also included in the new version is a CSS theme for the FlashDevelop syntax colors. 2/13/09
- Download and install SyntaxHighlighter-Plus
- Download my extension: Brush for v0.18 Brush for v1.0B2
- Place the compressed script in SyntaxHighlighter’s Scripts directory.
- To use this brush you will have to edit syntaxhighlighter.php and add the brush as an available brush to use. Navigate to around line 111, and add this line to the array:
'AS3' => array('as', 'actionscript', 'ActionScript', 'as3', 'AS3'), - Use [ code language="as3"] … [ /code] to have your code highlighted (Spaces inserted into tags so SyntaxHighlighter doesn’t try to highlight them)
6 Comments to AS3 Syntax Highlighting (with SyntaxHighlighter-Plus)
I’m trying to use your brush, and have added the line the php file. When I set the code to jscript it works as it should, but when I use as3 or as or AS3, the javascript spits out “Cant find brush for as3″ and the Javascript cosole says: SyntaxHighlighter.brushes.AS3 is undefined. Any thoughts?
March 15, 2009
Update to my last comment. On a whim, I substituted the your uncompressed version for the compressed one and it worked. Then just to make sure, I switched it back. And IT worked. Grrr. Anyway, it works. Thanks for the brush.
October 1, 2009
Hi, not sure what you mean with the Update2 above. But the newest version of SyntaxHighlighter supports ActionScript out of the box. Is it your brush that was included? Because on my overview of available brushes for SyntaxHighlighter I accredited Peter Atoria, which is perhaps incorrect. You can comment on that page if you feel yours should be included as alternative brush or if I have the credits incorrect, please let me know.
I’m working on a similar list for themes. Is it ok if I include the theme that you’ve added in this download?
– Abel –
PS: are you aware that this comment system works a bit funny? Ctrl-BS does not work, and if I type the equal sign I get a plus sign (which is shift-equal sign on my keyboard). Odd.
October 1, 2009
mm, and newlines are apparently not kept ;-)
October 1, 2009
My comment system is a bit funny becuase it’s built out of Flash as to hinder spam commentors and has worked remarkably well. As for the brush, there was already an AS3 brush available before mine. The big difference is that it doesn’t support Flash 10 API. I also didn’t like the color scheme so i matched it to a popular AS3 Editor’s default (FlashDevelop). So I think you’re probably correct in crediting Peter, but mine (I think) is more up to date with AS3.
October 1, 2009
Also didn’t see you question about the theme. By all means, share and share alike. And i’ll look into that newline bug =p
March 15, 2009