UPDATE (February 16, 2009):
SyntaxHighlighter 2.0 has been released and I have updated my AS3 extension to be compatible.
SyntaxHighlighter 2.0 has been released and I have updated my AS3 extension to be compatible.
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:
- Download the latest SyntaxHighlighter source.
- Download my AS3 extension.
- Place the compressed script in SyntaxHighlighter’s Scripts directory.
- Replace the css file in SyntaxHighlighter’s Styles directory if you like my version of the code block more than the default.
- Upload the SyntaxHighlighter directory to your server.
-
At the minimum, add the following to your head tag (pointing to wherever you have placed your js, css and flash files):
12345678910<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>
-
Create a pre block similar to the following:
123<pre name="code" class="actionscript">... some code here ...</pre>
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`s for your information.
Awesome!! Thanks so much, this is exactly what I needed 🙂
I love the sample! It really is looking great. Though one thing that annoys me is the copy/paste-part. I get the “#” for every line when I paste the code somewhere else – and I would like tab-indents instead of spaces in the code – but that might be others who prefers spacing instead.
But you have done a great job, it looks really smashing!
# public static function add( v1:Vector, v2:Vector ):Vector
# {
# return new Vector( v1.x + v2.x, v1.y + v2.y );
# }