WP – Add class name to first paragraph in blog post

When re-designing my blog I wanted to display the first paragraph of each blog post in bold text. A CSS3 selector could have been used, but wouldn’t work in older browsers such as IE6.

Instead I decided to write a very simple function to add a class name to the first paragraph by filtering the content, then setting the styles accordingly in my theme CSS file. Continue reading “WP – Add class name to first paragraph in blog post”

A Taste of Something Different…

It’s been a while since writing my last blog post back in June, but I’m pleased to be getting back into it again.

One of the main reasons for for the lack of updates is due to the stack of work I’ve been attempting to get through and my attempts at redesigning the layout of my blog.

I had a couple of different concepts for the redesign, but this is the design I eventually went with. Continue reading “A Taste of Something Different…”

New Fubra World (Flash + Isometric)

Over the past few months I have been working alongside Nick to produce a more exciting presentation of the sites owned and operated by Fubra Limited, in the form of Fubra World.

We first saw a glimpse of Fubra World at the end of 2007, after Nick put together a simple flash animation of a small town that he had sketched and added some interaction to.

At the end of 2008 it was decided that we would give it a bit of a facelift. The process involved nick re-drawing the town in isometric and myself learning ActionScript 3 to allow for a more interactive presentation. Continue reading “New Fubra World (Flash + Isometric)”

Robin Hood Film Set Visit

A couple of weeks ago my friend Harry dragged me along to the film set of the new Robin Hood film due for release in 2010.

Directed by Ridley Scott this film portrays the story of an archer fighting against the Norman invaders who becomes the legend known as Robin Hood, played by Russell Crowe.

The film is being partly filmed in Lower Bourne, the same location for the opening scene of Gladiator featuring the battle with the Germanians.

Continue reading “Robin Hood Film Set Visit”

Google Maps API default control look-and-feel

Although I haven’t managed to do any work with the Google Maps API for a few months now, I do try and frequent the Google Geo Developers Blog every once in a while.

On my last visit I noticed a post mentioning new functionality that allows you to include the standard user interface elements you get on the main Google Maps site, plus the standard behaviour of keyboard and mouse handling.

Continue reading “Google Maps API default control look-and-feel”

Simple jQuery string padding function

I’ve written a very simple jQuery function to return a string padded to a specified length, similar to the php equivalent str_pad.

$.strPad = function(i,l,s) {
	var o = i.toString();
	if (!s) { s = '0'; }
	while (o.length < l) {
		o = s + o;
	return o;

Example Usage:

$.strPad(12, 5); // returns 00012
$.strPad('abc', 6, '#'); // returns ###abc

This version only supports left padding, which is why it is labelled as only a simple version :).

AS3: Stop all sounds from playing

If you ever need to stop all the sounds playing in flash using ActionScript3, you can do so using the following method.

First include the SoundMixer class:

import flash.media.SoundMixer;

Then to stop the sounds call the stopAll method: