I’ve been using the FlashTextFormatter plugin for WordPress for some time now. It’s a great way to add color coding to Actionscript and other languages. Plus, the code box is a Flash component, so I feel like I’m eating my own dogfood. Thanks to the Internet Explorer Eolas change, some users need to click an extra time if they want to scroll the code. I had hoped to see a patch for this behavior, but I finally decided to write it myself. The plugin now uses Geoff Stearns’ SWFObject script to add the FTF component to my posts. Here’s an example:
[ftf h=”120″]function demoFunction(param:String):Void
{
trace(“Hi there!”);
}[/ftf]
You can view the source of this page to see what the plugin generates if you’d like.
It’s pretty standard SWFObject code. Most importantly, I had to be sure that multiple FTF components could appear on a page. The markup includes identifiers for the post and for each instance of the FTF component in a particular post. I had hoped to include support for displaying the code even when Flash isn’t available, but I’m not sure how to extract that data.
If you’d like to use my patched version of the plugin, I’ve made it available for download.
Great.
“I had hoped to include support for displaying the code even when Flash isn’t available”
Take a look at this URL.
If you want to continue improving it please contact me if you need help.
You wrote
>> I had hoped to include support for displaying the code even when Flash isn’t available, but I’m not sure how to extract that data.
Maybe it is possible to use XMLHTTPRequest to retrieve AS code from php script and write it inside your flash container div (“
Sorry, triangular bracket broke down the end of my post. I mean “… inside your flash container div (“<div id=”ftf-71-0” … )?