Category: Code

markdown :(

My Markdown plugin is not processing on the homepage and archives.

ActionScript 3 Menu class

If you build just about any Flash application you will need a menu that will manage button states and let you know when something has been clicked. This class will do that and can be implemented in projects big and small. Below is a very basic example on how it can be used, on the Mall World page it is implemented six times. Can you guess where?

A very basic implementation

[/embed]

Creating a Menu Object can be as simple as this

var menu = new Menu(); menu.addItem({clip: buttonOne, id: 1}); menu.addItem({clip: buttonTwo, id: 2}); menu.addEventListener(MenuEvent.NAVIGATE, this.menuNavigateHandler);

This code is released under the MIT License with just one request. If you improve it in some way that could benefit other users leave a comment.

Download the code & example files

edt-Embed

edt-Embed is a WordPress plugin for embedding content into your posts. As of right now it only supports SWF content using Geoff Stearns’ SWFObject, but I hope to extend it to also embed QuickTime, WMV and any other media that may need to be embeded into a post.

The original concept and code for the plugin came from Ross Gerbasi’s plugin for embeding Google Video. After looking at the code that ended up being embeded on every page, I decided to make my own version that would be a little cleaner and easier on your bandwidth. Ross has a newer version of his plugin that is worth checking it out as an alternative to this.

Download edt-Embed

Syntax

You can embed content with just a src attribute based on what the content is. swf, flv, smil, mp3, yt (YouTube), gv (Google Video) and gmv (GameVideos.com). The flv, smil and mp3 file types require a swf on your server with it’s constant set in the plugin ready to accept a variable of the same name (flv=”myFlv.flv”). Example files coming soon.

YouTube

[embed youTube=“YouTubeVideo.swf”][/embed]

Google Video

[embed googleVideo=“GoolgeVideo.swf”][/embed]

GameVideos.com

[embed gameVideo=“GameVideos.com.swf”][/embed]

FLV

[embed flv=“MyFLV.flv”][/embed]

MP3

[embed mp3=“MyFLV.flv”][/embed]

Or you can add any or all the attributes of the video.

[embed yt=“YouTubeVideo.swf” width=“320” height=“240” version=“9”][/embed] [embed yt=“YouTubeVideo.swf” version=“9”][/embed]

Constants

You need to edit the plugin’s constants to set default width, height and version numbers for all the content types. I have some defaults set already for YourTube, Google Video and GameVideos.com. Also, if you are doing an FLV, MP3, or SMIL player, you need to have the variables set in the plugin for the swf path to those players.

Bugs, issues and future development

  • Closing tag for CDATA is being encoded to “// ]]&gt”;
  • Add admin panel to edit constants like FLVPLAYER, SMILPLAYER etc
  • Embed javascript file automatically?
  • Category/archive view not displaying the videos.

Version Info

1.2

  • Added support for a new syntax for embedding Google Video, You Tube and GameVideos.com