AS3 Syntax Highlighting (with SyntaxHighlighter)
I spent a little free time and added AS3 support to SyntaxHighlighter.
According to Alex Gorbatchev (the creator of SyntaxHighlighter) it should be added to the next release. But until then, you can download the source here.
It's pretty straight forward to use, but just in case:
1) Download the latest SyntaxHighlighter source.
2) Download my AS3 extension.
3) Place the compressed script in SyntaxHighlighter's Scripts directory.
4) Replace the css file in SyntaxHighlighter's Styles directory if you like my version of the code block more than the default.
5) Upload the SyntaxHighlighter directory to your server.
6) At the minimum, add the following to your head tag (pointing to wherever you have placed your js, css and flash files):
<link type="text/css" rel="stylesheet" href="css/SyntaxHighlighter.css"></link>
<script language="javascript" src="js/shCore.js"></script>
<script language="javascript" src="js/shBrushAS3.js"></script>
<script language="javascript" src="js/shBrushXml.js"></script>
<script language="javascript">
window.onload = function () {
dp.SyntaxHighlighter.ClipboardSwf = 'flash/clipboard.swf';
dp.SyntaxHighlighter.HighlightAll('code');
}
</script>
7) Create a pre block similar to the following:
<pre name="code" class="actionscript">
... some code here ...
</pre>
As you can see, I'm not actually using SyntaxHighlighter with Movable Type yet, but once I get that figured out, I'll let you know.
Thank you, man! Great idea.
Thank you!
BTW, shoud I over-write "SyntaxHighlighter.css" ??
Hi,
that is great! THX.
Unfortunately the "copy to clipboard" does not work well, seems to be a bug from SyntaxHighlighter....
Great work. Thanks! I am planning on using this with Movable Type as well. This is a big help.
Great! I'm gonna use this.
Thanx a lot!!
Shigeru: Don't overwrite the SyntaxHighlighter.css .. just add the shBrushAS3.js to the js/ folder of syntaxhighlighter.
thank you
very gooooooood
very nic