<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David E Jones a web developer with a passion for problem solving</title>
	<atom:link href="http://davidejones.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidejones.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Wed, 28 Dec 2011 00:38:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>css3 onClick using :target</title>
		<link>http://davidejones.com/blog/1289-css3-onclick-psuedo-target-effects/</link>
		<comments>http://davidejones.com/blog/1289-css3-onclick-psuedo-target-effects/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 06:18:41 +0000</pubDate>
		<dc:creator>davidejones</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[website development]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://davidejones.com/?p=1289</guid>
		<description><![CDATA[If you haven&#8217;t come across the :target psuedo class yet you may have missed a trick, its a great piece of css that can give you a more active page without the need of javascript. The easiest way to imagine &#8230; <a href="http://davidejones.com/blog/1289-css3-onclick-psuedo-target-effects/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t come across the <a href="http://www.w3.org/TR/selectors/#target-pseudo" title=":target">:target psuedo class</a> yet you may have missed a trick, its a great piece of css that can give you a more active page without the need of javascript.</p>
<p>The easiest way to imagine this working is to actually think of click events in javascript. Lets say you have a href link with an onClick event attached to it. Clicking this triggers some javascript to show a div somewhere in the page. To do this in javascript you might have some code like this</p>
<pre class="prettyprint" rel="Html"><code>&lt;a href="#" onClick="document.getElementById('box1').style.display='block'"&gt;Click Me&lt;/a&gt;
&lt;div id="box1" style="display:none;"&gt;test test&lt;/div&gt;</code></pre>
<p>Well this very same functionality is available using just the :target css and to great effect. Take this code below as an example, here we can do exactly the same as the javascript but now just with css.</p>
<pre class="prettyprint" rel="Html"><code>&lt;style type="text/css"&gt;
	#box1 {
		display:none;
	}
	#box1:target {
		display:block;
	}
&lt;/style&gt;

&lt;a href="#box1"&gt;Click Me&lt;/a&gt;
&lt;div id="box1"&gt;test test&lt;/div&gt;</code></pre>
<p>Of course there are the usual browser limitations but consider combining this with javascript as a fallback and you can have a more future proof native version of your code. Combine this with some of the css animation effects and you can have something that would easily fool others into thinking its made with javascript when in fact its css.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidejones.com/blog/1289-css3-onclick-psuedo-target-effects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alternativa3d 8 physics bowling pin</title>
		<link>http://davidejones.com/blog/1274-alternativa3d-8-physics-bowling-pin/</link>
		<comments>http://davidejones.com/blog/1274-alternativa3d-8-physics-bowling-pin/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 22:49:03 +0000</pubDate>
		<dc:creator>davidejones</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[website development]]></category>
		<category><![CDATA[alternativa3d]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://davidejones.com/?p=1274</guid>
		<description><![CDATA[Alternativa3d have just released their own physics library to go hand in hand with their already excellent flash 3d framework. I thought I would give it a quick try to see what its like. The physics engine has its own &#8230; <a href="http://davidejones.com/blog/1274-alternativa3d-8-physics-bowling-pin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Alternativa3d have just released their own physics library to go hand in hand with their already excellent flash 3d framework. I thought I would give it a quick try to see what its like.</p>
<p><a href="http://davidejones.com/labs/bowling-pin-alternativa3d8-physics/" target="_blank"><img src="http://davidejones.com/wp-content/uploads/2011/12/bowling-pin-alternativa3d-8-physics.jpg" alt="" title="bowling-pin-alternativa3d-8-physics" class="alignnone size-full wp-image-1275" /></a></p>
<p>The physics engine has its own set of classes that seem to integrate or extend alternativa3D 8. This means that all the scene and camera creation is already done and you can just override the setScene() and then  concentrate on handling of the physics and the rest of the code. Its setup is familiar to me and reminds me of the jiglib flash libraries so its quite easy to get up and running with.</p>
<p>The examples that come with the physics engine don&#8217;t actually show the loading of a 3d model and then applying physics to it but it is very simple task. Just load the .3ds file or .a3d file as you would as per the examples from the alternativa3d 8 library. Once its all loaded you setup a transform, a physical object and a collision area then add it to the scene.</p>
<pre class="prettyprint" rel="Actionscript"><code>override protected function setScene():void
{
	//add fps
	addChild(camera.diagram);

	//create and add light source
	var light:Light3D;
	light = new OmniLight(0xFFFFFF, 1, 7000);
	light.x = 0;
	light.y = 200;
	light.z = 1000;
	light.intensity = 0.8;
	addObject3D(light);
	light = new AmbientLight(0xFFFFFF);
	light.intensity = 0.2;
	addObject3D(light);

	//create a loader to load the pin
	var loader3DS:URLLoader = new URLLoader();
	loader3DS.dataFormat = URLLoaderDataFormat.BINARY;
	loader3DS.load(new URLRequest("pin.3ds"));
	loader3DS.addEventListener(Event.COMPLETE, on3DSLoad);
}

private function on3DSLoad(e:Event):void
{
	var parser:Parser3DS = new Parser3DS();
	parser.parse((e.target as URLLoader).data);
	var mesh:Mesh;
	for each (var object:Object3D in parser.objects) {
		if (object.name == "Mesh.007") {
			mesh = object as Mesh;
			break;
		}
	}
	uploadResources(mesh.getResources(false, Geometry));

	// Setup materials
	var textures:Vector.<ExternalTextureResource> = new Vector.<ExternalTextureResource>();
	for (var i:int = 0; i < mesh.numSurfaces; i++) {
		var surface:Surface = mesh.getSurface(i);
		var material:ParserMaterial = surface.material as ParserMaterial;
		if (material != null) {
			var diffuse:ExternalTextureResource = material.textures["diffuse"];
			if (diffuse != null) {
				diffuse.url = "" + diffuse.url;
				textures.push(diffuse);
				surface.material = new TextureMaterial(diffuse);
			}
		}
	}

	// Loading of textures
	var texturesLoader:TexturesLoader = new TexturesLoader(stage3d.context3D);
	texturesLoader.loadResources(textures);

	// setup loaded model in this case bowling pin
	var transform:Matrix4 = new Matrix4();
	transform.setPositionXYZ(0, 0, 1);
	var pin1:PhysicalSimObject = new DynamicObject(transform, new Vector3(0, 0, 2));
	pin1.addPhysicsPrimitive(
		new PhysicsPrimitive(new CollisionTriangleMesh(MeshUtils.createGeometryMeshFromMesh3d(mesh), CollisionType.DYNAMIC), 1)
	);
	pin1.addAppearanceComponent(mesh);
	addSimObject(pin1);
}

private function uploadResources(resources:Vector.<Resource>):void {
	for each (var resource:Resource in resources) {
		resource.upload(stage3d.context3D);
	}
}</code></pre>
<p>The boundaries for the collision are taken from the actual mesh this time instead of using a rectangle or other primitive shape. To do this we use the CollisionTriangleMesh and the meshutility to convert the mesh class to the accepted parameter class geometrymesh.</p>
<pre class="prettyprint" rel="Actionscript"><code>pin1.addPhysicsPrimitive(
	new PhysicsPrimitive(new CollisionTriangleMesh(MeshUtils.createGeometryMeshFromMesh3d(mesh), CollisionType.DYNAMIC), 1)
);</code></pre>
<p>While this did work I had some issues with the bowling pins sinking through the floor I created. Its like the origin point for the mesh had changed once it was run through the meshutility. So to get the effect i wanted I switched it around and used a cone shape for collision.</p>
<pre class="prettyprint" rel="Actionscript"><code>pin1.addPhysicsPrimitive(
	new PhysicsPrimitive(new CollisionCone(0.1, 0.3, 3, CollisionType.DYNAMIC), 0.5)
);</code></pre>
<p>You can <a href='http://davidejones.com/wp-content/uploads/2011/12/alternativa3d8-physics-bowling.zip'>download the files here</a> or view it on the <a href="http://davidejones.com/labs/bowling-pin-alternativa3d8-physics/" target="_blank">demo page here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidejones.com/blog/1274-alternativa3d-8-physics-bowling-pin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>creating a 3 image slider with css</title>
		<link>http://davidejones.com/blog/1206-creating-3-image-slider-css/</link>
		<comments>http://davidejones.com/blog/1206-creating-3-image-slider-css/#comments</comments>
		<pubDate>Sun, 18 Dec 2011 01:08:46 +0000</pubDate>
		<dc:creator>davidejones</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[website development]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://davidejones.com/?p=1206</guid>
		<description><![CDATA[I&#8217;ve been dabbling with css animations and transitions with the goal of trying to convert an old flash file I created almost 3 or 4 years ago into a animated css example. It wasn&#8217;t quite as easy as I had &#8230; <a href="http://davidejones.com/blog/1206-creating-3-image-slider-css/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been dabbling with css animations and transitions with the goal of trying to convert an old flash file I created almost 3 or 4 years ago into a animated css example. It wasn&#8217;t quite as easy as I had anticipated and unfortunately only appears to work in Firefox 4 as this browser has support for animations on psuedo elements but its a nice little example and starting point for me.</p>
<p><strong>Original Intentions</strong><br />
The best way to explain the effect I was intending to recreate is to show you the original flash file. Which you can see as the last example on the <a href="http://davidejones.com/labs/image-slider-reveal/">demo page here</a>. I have swapped the images out with a few of my own as I&#8217;m sure the original client wouldn&#8217;t be happy with me using her images here.</p>
<p>Each image when mousing over it will expand and contract the other regions to reveal more or less of the images in a fluid motion.</p>
<p><a href="http://davidejones.com/labs/image-slider-reveal/" target="_blank"><img src="http://davidejones.com/wp-content/uploads/2011/12/css-animated-slider-jquery.jpg" alt="" title="css-animated-slider-jquery" width="493" height="308" class="alignnone size-full wp-image-1221" /></a></p>
<p><strong>Stick to what you know</strong><br />
I&#8217;m a programmer at heart and much prefer working with something I can dig my teeth into like a programming language rather than a few animation options on a style sheet. So I decided i&#8217;d first create a jquery version of my slider as it would be a nice alternative if needed and a good way to get into the right mindset for me to work.</p>
<p>The second example on the <a href="http://davidejones.com/labs/image-slider-reveal/" target="_blank">demo page</a> shows the results of this jquery animation.</p>
<p>I built this code straight into a jquery plugin, it is still basic and is setup to work with just 3 images however it a good base to expand on if needed. The code essentially uses the jquery animate function to resize and position links with the background images. This turned out quite well and was fairly fluid for me. There is no easing like my flash version but that can be added with the jquery easing plugin if needed but I was quite satisfied with it.</p>
<p>You can get the <a href="https://github.com/davidejones/jqueryreveal">jquery plugin here</a> or rip it from the <a href="http://davidejones.com/labs/image-slider-reveal/" target="_blank">demo page</a> it also needs the following css and html setup to function</p>
<pre class="prettyprint" rel="html"><code>&lt;div id="slider"&gt;
	&lt;img src="img/4.jpg" alt="" /&gt;
	&lt;img src="img/5.jpg" alt="" /&gt;
	&lt;img src="img/6.jpg" alt="" /&gt;
&lt;/div&gt;</code></pre>
<pre class="prettyprint" rel="css"><code>#slider {
	overflow:hidden;
	width:493px;
	height:308px;
	position:relative;
}</code></pre>
<pre class="prettyprint" rel="javascript"><code>$(document).ready(function(){
	$('#slider').imageReveal();
});</code></pre>
<p><strong>The css animation</strong><br />
Now on to the css. To make this work I decided to layer on top of each other the 3 images absolutely as again background images on links and then set their z-index. This created the starting position of the 3 images as I wanted.</p>
<p>The animation was the hardest part of this for me ashovering over an image but targeting the adjacent images to also move I found very tricky. This is easy when you hover over the first image as the other 2 images are adjacent to this but when you say hover over the last image you cannot select previous adjacent siblings. I couldn&#8217;t think of a particularly good solution to this so my work around was I used the pseudo selector ::after to insert the middle image again and animate this too. Again this doesn&#8217;t come with ease as animating created elements in css only works in firefox 4 and above.</p>
<p>So the final result works in firefox but is still quite buggy at best. Infact the css version without animation works better but obviously doesn&#8217;t have the nice fluidity of the other examples.</p>
<p>Here is the code for the css animated version</p>
<pre class="prettyprint" rel="css"><code>#cssslider {
	width:493px;
	height:308px;
	position:relative;
}

#cssslider a {
	position:absolute;
	display:block;
	width:164px;
	height:308px;
}

#cssslider a:nth-child(1) {
	left:0px;
	z-index:0;
}

#cssslider a:nth-child(2) {
	left:164px;
	z-index:1;
}

#cssslider a:nth-child(3) {
	left:328px;
	z-index:2;
}

/* First mouseover */
#cssslider a:nth-child(1):hover {
	z-index:3;
	animation: myfirst 1s;
	-moz-animation: myfirst 1s; /* Firefox */
	-webkit-animation: myfirst 1s; /* Safari and Chrome */
	-webkit-animation-fill-mode: forwards;
	-moz-animation-fill-mode: forwards;
}

#cssslider a:nth-child(1):hover ~ a:nth-child(2) {
	z-index:4;
	animation: myfirst2 1s;
	-moz-animation: myfirst2 1s; /* Firefox */
	-webkit-animation: myfirst2 1s; /* Safari and Chrome */
	-webkit-animation-fill-mode: forwards;
	-moz-animation-fill-mode: forwards;
}

/* second mouseover */
#cssslider a:nth-child(2):hover {
	z-index:3;
	animation: mysecond 1s;
	-moz-animation: mysecond 1s; /* Firefox */
	-webkit-animation: mysecond 1s; /* Safari and Chrome */
	-webkit-animation-fill-mode: forwards;
	-moz-animation-fill-mode: forwards;
}

/* third mouseover */
#cssslider a:nth-child(3):hover {
	z-index:3;
	animation: mythird 1s;
	-moz-animation: mythird 1s; /* Firefox */
	-webkit-animation: mythird 1s; /* Safari and Chrome */
	-webkit-animation-fill-mode: forwards;
	-moz-animation-fill-mode: forwards;
}

#cssslider a:nth-child(3):after {
	position:absolute;
	top:0px;
	left:-164px;
	bottom:0px;
	right:0px;
	border:0px solid red;
	content:" ";
	z-index:9999;
	background:url(img/5.jpg);
	width:164px;
	display:none;
}

#cssslider a:nth-child(3):hover:after {
	display:block;
	animation: mythird2 1s;
	-moz-animation: mythird2 1s; /* Firefox */
	-webkit-animation: mythird2 1s; /* Safari and Chrome */
	-webkit-animation-fill-mode: forwards;
	-moz-animation-fill-mode: forwards;
}

/* Animations */
@keyframes myfirst
{
	from { width:164px; }
	to { width:328px; }
}

@-moz-keyframes myfirst /* Firefox */
{
	from { width:164px; }
	to { width:328px; }
}

@-webkit-keyframes myfirst /* Safari and Chrome */
{
	from { width:164px; }
	to { width:328px; }
}

@keyframes myfirst2
{
	from { width:164px; left:164px; }
	to { width:82px; left:328px; }
}

@-moz-keyframes myfirst2 /* Firefox */
{
	from { width:164px; left:164px; }
	to { width:82px; left:328px; }
}

@-webkit-keyframes myfirst2 /* Safari and Chrome */
{
	from { width:164px; left:164px; }
	to { width:82px; left:328px; }
}

@keyframes mysecond
{
	from { width:164px; left:164px;}
	to { width:328px; left:82px; }
}

@-moz-keyframes mysecond /* Firefox */
{
	from { width:164px; left:164px;}
	to { width:328px; left:82px; }
}

@-webkit-keyframes mysecond /* Safari and Chrome */
{
	from { width:164px; left:164px;}
	to { width:328px; left:82px; }
}

@keyframes mythird
{
	from { width:164px; left:328px;}
	to { width:328px; left:164px; }
}

@-moz-keyframes mythird /* Firefox */
{
	from { width:164px; left:328px;}
	to { width:328px; left:164px; }
}

@-webkit-keyframes mythird /* Safari and Chrome */
{
	from { width:164px; left:328px;}
	to { width:328px; left:164px; }
}

@keyframes mythird2
{
	from { width:164px; left:-164px;}
	to { width:82px; left:-82px; }
}

@-moz-keyframes mythird2 /* Firefox */
{
	from { width:164px; left:-164px;}
	to { width:82px; left:-82px; }
}

@-webkit-keyframes mythird2 /* Safari and Chrome */
{
	from { width:164px; left:-164px;}
	to { width:82px; left:-82px; }
}</code></pre>
<p>and the html</p>
<pre class="prettyprint" rel="html"><code>&lt;div id="cssslider"&gt;
	&lt;a href="#" style="background:url(img/4.jpg);"&gt;&lt;/a&gt;
	&lt;a href="#" style="background:url(img/5.jpg);"&gt;&lt;/a&gt;
	&lt;a href="#" style="background:url(img/6.jpg);"&gt;&lt;/a&gt;
&lt;/div&gt;</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://davidejones.com/blog/1206-creating-3-image-slider-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>prefetching with html5</title>
		<link>http://davidejones.com/blog/1214-prefetching-with-html5/</link>
		<comments>http://davidejones.com/blog/1214-prefetching-with-html5/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 06:06:22 +0000</pubDate>
		<dc:creator>davidejones</dc:creator>
				<category><![CDATA[website development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[speed]]></category>

		<guid isPermaLink="false">http://davidejones.com/?p=1214</guid>
		<description><![CDATA[Web designers and developers are always striving to make their websites faster and there are a few cool techniques you can use to preload or prefetch items whilst viewing a website to increase the speed as you browse the site. &#8230; <a href="http://davidejones.com/blog/1214-prefetching-with-html5/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Web designers and developers are always striving to make their websites faster and there are a few cool techniques you can use to preload or prefetch items whilst viewing a website to increase the speed as you browse the site.</p>
<p><strong>Prefetching DNS</strong></p>
<p>If you aren&#8217;t familiar with dns this is the system in place that directs domain names to servers. All servers have an ip address and your domain points to an ip address. DNS keeps track of what ip address a domain points to before retrieving whatever it is.</p>
<p>When anything is loaded on a website your browser will actually take the domain name for example google.com and it will then do a dns lookup to find where this actually points to.</p>
<p>In html you can add in a meta tag that will actually prefetch the dns for a certain domain allowing you to speed up a follow on page that may make a call to that domain name.</p>
<p>You can do this like so</p>
<pre class="prettyprint" rel="html"><code>&lt;link rel="dns-prefetch" href="http://ajax.googleapis.com" /&gt;</code></pre>
<p>This will prefetch the dns for http://ajax.googleapis.com allowing this dns lookup to be skipped in subsequent calls to the url speeding up the loading of a page.</p>
<p><strong>Content Prefetching</strong></p>
<p>The next step up is content prefetching, this allows you to preload an entire page or element before it is actually needed.</p>
<p>For example this will preload my blog post on <a href="http://davidejones.com/blog/1151-html5-reversed-ordered-lists/">html5 reversed ordered lists</a> so that if you were to visit that page it would load considerably faster having it load from the cache instead.</p>
<pre class="prettyprint" rel="html"><code>
&lt;link rel="prefetch" href="http://davidejones.com/blog/1151-html5-reversed-ordered-lists/" /&gt;</code></pre>
<p>You can also load individual elements like images or stylesheets using the same syntax</p>
<pre class="prettyprint" rel="html"><code>
&lt;link rel="prefetch" href="http://davidejones.com/wp-content/themes/davidejones/img/logo.png" /&gt;
&lt;link rel="prefetch" href="http://davidejones.com/style.css" /&gt;</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://davidejones.com/blog/1214-prefetching-with-html5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>godaddy php5 access</title>
		<link>http://davidejones.com/blog/1196-godaddy-php5-access/</link>
		<comments>http://davidejones.com/blog/1196-godaddy-php5-access/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 18:34:24 +0000</pubDate>
		<dc:creator>davidejones</dc:creator>
				<category><![CDATA[servers]]></category>
		<category><![CDATA[website development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://davidejones.com/?p=1196</guid>
		<description><![CDATA[I just had to work on a website project where the site was hosted with godaddy, I&#8217;ll be honest I haven&#8217;t had a good experience with them in the past. I used their domain buying service where they approach a &#8230; <a href="http://davidejones.com/blog/1196-godaddy-php5-access/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I just had to work on a website project where the site was hosted with godaddy, I&#8217;ll be honest I haven&#8217;t had a good experience with them in the past. I used their domain buying service where they approach a domain holder on your behalf and try to purchase it from them, this turned out to be a huge rip off which I only discovered after I contacted the owner myself. Anyway I tend to avoid them if possible but in this case I had to use them.</p>
<p>So after playing around with the configuration and setting up a database I installed wordpress only to find that the hosting was running php4 and not 5 sigh&#8230;</p>
<p>I couldn&#8217;t see a way to switch the hosting to use php5 through the godaddy control panel it would be odd for godaddy not to support it though. So I read online a bit and discovered that both installations of php are on the server you just need to enable parsing of php5 in a .htaccess file.</p>
<p>So after adding the following to my html5 boilerplate htaccess file this allowed my wordpress installation to run the setup. Hopefully this will help you if you come across a similar situation with godaddy or another hosting provider.</p>
<pre class="prettyprint" rel="htaccess"><code>AddType application/x-httpd-php5 .htm .html .php
AddHandler x-httpd-php5  .htm .html .php</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://davidejones.com/blog/1196-godaddy-php5-access/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>html5 reversed ordered lists</title>
		<link>http://davidejones.com/blog/1151-html5-reversed-ordered-lists/</link>
		<comments>http://davidejones.com/blog/1151-html5-reversed-ordered-lists/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 06:16:10 +0000</pubDate>
		<dc:creator>davidejones</dc:creator>
				<category><![CDATA[website development]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://davidejones.com/?p=1151</guid>
		<description><![CDATA[We&#8217;ve all used ordered lists and unordered for that matter but did you know you can reverse the order of an ol with just one simple word? Well with html5 buzzing around I recently discovered there is a new boolean &#8230; <a href="http://davidejones.com/blog/1151-html5-reversed-ordered-lists/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve all used ordered lists and unordered for that matter but did you know you can reverse the order of an ol with just one simple word?</p>
<p>Well with html5 buzzing around I recently discovered there is a new boolean attribute for the ol tag called reversed. This attribute tells the browser that the numbering or iterations for the list should be shown in descending order rather than the default ascending.</p>
<p>After giving this a spin I discovered that it only reverses the count not the actual elements in the list. Which is fine but i was kinda hoping there would be attributes for both the keys and the values similar to how something like array_reverse() works in php.</p>
<p><a href="http://davidejones.com/labs/reverse-html5-list/" target="_blank"><img src="http://davidejones.com/wp-content/uploads/2011/12/orders.jpg" alt="" title="orders" class="alignnone size-full wp-image-1184" /></a></p>
<p>The new attribute is nice but I think I&#8217;d rather use some css over the html attribute in most instances. Here is how to do the same with css</p>
<pre class="prettyprint" rel="html"><code>&lt;ol&gt;
	&lt;li&gt;apples&lt;/li&gt;
	&lt;li&gt;bannanas&lt;/li&gt;
	&lt;li&gt;oranges&lt;/li&gt;
&lt;/ol&gt;</code></pre>
<pre class="prettyprint" rel="css"><code>ol {
    list-style-type:none;
    counter-reset:item 4;
}
ol > li {
    counter-increment:item -1;
}
ol > li:before {
    content:counter(item) ". ";
}
</code></pre>
<p>and if you are actually trying to reverse the elements not the numbers you might want to try some jquery something like this</p>
<pre class="prettyprint" rel="html"><code>&lt;ol class="reverse"&gt;
	&lt;li&gt;apples&lt;/li&gt;
	&lt;li&gt;bannanas&lt;/li&gt;
	&lt;li&gt;oranges&lt;/li&gt;
&lt;/ol&gt;</code></pre>
<pre class="prettyprint" rel="javascript"><code>$(function(){
	$(".reverse").append($(".reverse li").get().reverse());
});</code></pre>
<p><a href="http://davidejones.com/labs/reverse-html5-list/" target="_blank">Check out the demo page here</a></p>
<p>I&#8217;m not sure about the current browser support for the reversed feature but i do know there are some polyfills out there such as this one for modernizr <a href="https://github.com/impressivewebs/HTML5-Reverse-Ordered-Lists">https://github.com/impressivewebs/HTML5-Reverse-Ordered-Lists</a></p>
]]></content:encoded>
			<wfw:commentRss>http://davidejones.com/blog/1151-html5-reversed-ordered-lists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>creating a dynamic signature image using php</title>
		<link>http://davidejones.com/blog/1126-creating-dynamic-signature-image-php/</link>
		<comments>http://davidejones.com/blog/1126-creating-dynamic-signature-image-php/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 08:36:44 +0000</pubDate>
		<dc:creator>davidejones</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[website development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://davidejones.com/?p=1126</guid>
		<description><![CDATA[I&#8217;m a part of a few forums on the internet and usually I like to have a signature image when I post, something to reference me or my website or maybe some gaming screenshots and stats etc. It all depends &#8230; <a href="http://davidejones.com/blog/1126-creating-dynamic-signature-image-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a part of a few forums on the internet and usually I like to have a signature image when I post, something to reference me or my website or maybe some gaming screenshots and stats etc. It all depends on the forum I&#8217;m on and their conditions on signature images.</p>
<p>A common signature I use is to have a series of 5 or 6 images that just load randomly so i will have a different signature every time its loaded. To do this i create a php file called signature with the following code</p>
<pre class="prettyprint" rel="Php"><code>&lt;?php
//total number of images
$total = "5";
//image file extension
$file_type = ".png";
//folder relative to script that contains images
$image_folder = "images";
//images range from 1.png to 5.png so lets use 1
$start = "1";
//create a random number between 1 - 10
$random = mt_rand($start, $total);
//set image filename to the random image
$image_name = $random . $file_type;

//output header
header('Content-Type: image/png');
//output image
$image = imagecreatefrompng("$image_folder/$image_name");
imagepng($image);
imagedestroy($image);
?&gt;</code></pre>
<p>In the same folder as this script I create an images folder containing images numbered to 5 for example 1.png, 2.png, 3.png and so on.</p>
<p>With this done if you visit the php script in your browser it should just output a random image from that folder. </p>
<p>This works great but a unfortunately a lot of forums disallow php files and filenames in uploads and images for security reasons. One thing you can do to bypass this is to mask the php file to look like an image. This can be done using a .htaccess file to rewrite the image with the following code</p>
<pre class="prettyprint" rel="htaccess"><code>RewriteEngine On
RewriteRule ^signature.png$ signature.php</code></pre>
<p>This example I masked the signature.php file so that if you visit signature.png in your web browser it will infact show the output from the signature.php file. You can of course do the same with other image extensions just by switching the .png to .jpg for example. This is usually good enough to fool the forums into accepting your image.</p>
<p>Another possible workaround which I haven&#8217;t tried myself and wouldn&#8217;t recommend is to add the image type to be parsed by php. So you could rename your signature.php file to signature.png and then do something like this in a htaccess file</p>
<pre class="prettyprint" rel="htaccess"><code>AddType application/x-httpd-php .php .png</code></pre>
<p>Again this is at your own risk and you could be opening other files on your server to attack.</p>
<p>Ok so we have this setup but its still kinda boring, so something I like do with gaming signatures is add some statistics or images and text over the random image. Seen as we are using php this is a very simple task as long as you have the GD library installed with your php installation.</p>
<p>To add some info to our signature lets add a white bar with some text about ourself. So before the imagepng() line add the following php code</p>
<pre class="prettyprint" rel="Php"><code>//setup some colours
$white = imagecolorallocate($image, 255, 255, 255);
$whitesemi  = imagecolorallocatealpha($image, 255, 255, 255, 60);
$black = imagecolorallocate($image, 0, 0, 0);
$red = imagecolorallocate($image, 165,10,10);

//create our semi transparent white rectangle for text
imagefilledrectangle($image, 0, 0, 600, 20, $whitesemi);

//choose a default php font number 1 to 5
$font = 2;
//write out our text to the image using the font, colour and positions entered
imagestring($image, $font, 25, 4, 'Player Name: ', $black);
imagestring($image, $font, 100, 4, 'Invisible Man', $red);
imagestring($image, $font, 200, 4, 'Rank: ', $black);
imagestring($image, $font, 235, 4, '1', $red);
imagestring($image, $font, 260, 4, 'Points:', $black);
imagestring($image, $font, 305, 4, '999999',$red);
imagestring($image, $font, 360, 4, 'Kills:', $black);
imagestring($image, $font, 400, 4, '99999999999999', $red);
imagestring($image, $font, 500, 4, 'Deaths:', $black);
imagestring($image, $font, 550, 4, 'nevar!', $red);

//lets add an image over it too, create instance of image
$src = imagecreatefrompng('./images/flags/gb.png');
// Copy and merge images together
imagecopymerge($image, $src, 5, 5, 0, 0, 16, 11, 75);</code></pre>
<p>Ok so this will create a pallete of colours that we are using by defining the rgb values we then create our shape using the imagefilledrectangle and our defined colour and then lastly we write on the image and merge in any other images we want.</p>
<p>Here is a final example of my team fortress 2 signature, I actually also added another image the tf2 logo to the bottom left of the signature, the code for this is in the final version below.</p>
<p><img src="http://davidejones.com/wp-content/uploads/2011/11/signature.png" alt="" title="signature" class="alignnone size-full wp-image-1139" /></p>
<p>I tend to use a real live stats xml feed from hlstats or whatever game i like using the php library SimpleXMLElement to parse the data and put it into the text fields easily using code like $stats->kills. You can of course add all kinds of images change the text and use any feature of php to alter the signature however you desire.</p>
<p>Here is the full php code</p>
<pre class="prettyprint" rel="Php"><code>//total number of images
$total = "5";
//image file extension
$file_type = ".png";
//folder relative to script that contains images
$image_folder = "images";
//images range from 1.png to 5.png so lets use 1
$start = "1";
//create a random number between 1 - 10
$random = mt_rand($start, $total);
//set image filename to the random image
$image_name = $random . $file_type;

//output header
header('Content-Type: image/png');
//output image
$image = imagecreatefrompng("$image_folder/$image_name");

//setup some colours
$white = imagecolorallocate($image, 255, 255, 255);
$whitesemi  = imagecolorallocatealpha($image, 255, 255, 255, 60);
$black = imagecolorallocate($image, 0, 0, 0);
$red = imagecolorallocate($image, 165,10,10);

//create our semi transparent white rectangle for text
imagefilledrectangle($image, 0, 0, 600, 20, $whitesemi);

//choose a default php font number 1 to 5
$font = 2;
//write out our text to the image using the font, colour and positions entered
imagestring($image, $font, 25, 4, 'Player Name: ', $black);
imagestring($image, $font, 100, 4, 'Invisible Man', $red);
imagestring($image, $font, 200, 4, 'Rank: ', $black);
imagestring($image, $font, 235, 4, '1', $red);
imagestring($image, $font, 260, 4, 'Points:', $black);
imagestring($image, $font, 305, 4, '999999',$red);
imagestring($image, $font, 360, 4, 'Kills:', $black);
imagestring($image, $font, 400, 4, '99999999999999', $red);
imagestring($image, $font, 500, 4, 'Deaths:', $black);
imagestring($image, $font, 550, 4, 'nevar!', $red);

//lets add an image over it too, create instance of image
$src = imagecreatefrompng('./images/flags/gb.png');
// Copy and merge images together
imagecopymerge($image, $src, 5, 5, 0, 0, 16, 11, 75);

$src1 = imagecreatefrompng('./images/tf2.png');
imagecopymerge_alpha($image, $src1, 5, 280, 0, 0, 74, 15, 75);

imagepng($image);
imagedestroy($image);</code></pre>
<p>If you are having any issues with the file not doing what it should be try commenting out the header(&#8216;Content-Type: image/png&#8217;) to see any error outputs that may be causing problems.</p>
<p>Or if you are having issues visiting the image in your browser using an image extension like signature.png it may be that your webserver won&#8217;t allow the htaccess file to work.</p>
<p><a href='http://davidejones.com/wp-content/uploads/2011/11/signature.zip'>You can download the files from this example here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://davidejones.com/blog/1126-creating-dynamic-signature-image-php/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Minecraft Player updated for alternativa 8</title>
		<link>http://davidejones.com/blog/573-minecraft-player-updated-alternativa-8/</link>
		<comments>http://davidejones.com/blog/573-minecraft-player-updated-alternativa-8/#comments</comments>
		<pubDate>Sun, 20 Nov 2011 23:13:02 +0000</pubDate>
		<dc:creator>davidejones</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[website development]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[alternativa3d]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[minecraft]]></category>

		<guid isPermaLink="false">http://davidejones.com/?p=573</guid>
		<description><![CDATA[I haven&#8217;t had much time to experiment with the new updates coming from alternativa3d, what with moving to another country and the various projects i&#8217;m involved with i just haven&#8217;t had time. Now i&#8217;ve started to settle in, it seems &#8230; <a href="http://davidejones.com/blog/573-minecraft-player-updated-alternativa-8/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t had much time to experiment with the new updates coming from alternativa3d, what with moving to another country and the various projects i&#8217;m involved with i just haven&#8217;t had time. Now i&#8217;ve started to settle in, it seems like a good a time as any to get back on and try some things out.</p>
<p>First up i thought i would ease back in and just update my flash minecraft player to alternativa version 8.17 making use of the gpu support in flash player 11 and also trying out the new syntax and class changes. It turned out pretty well but I was a little disappointed at not being able to recreate the pixel like effect the textures have last time. For some reason in version 8 the textures are smoothed without a way to change it, perhaps its just a result of using the gpu I&#8217;m not sure, either way its still faster and using less resources than the previous version.</p>
<p><a href="http://davidejones.com/labs/minecraft-alternativa-8/" target="_blank"><img src="http://davidejones.com/wp-content/uploads/2011/11/minecraft-alternativa3d-8.17.jpg" alt="" title="minecraft-alternativa3d-8.17" class="alignnone size-full wp-image-1089" /></a></p>
<p>This time I separated the minecraft player into a separate &#8220;Player&#8221; class just so its a tiny bit cleaner. </p>
<p>Here is the Character.as class, note that the new version 8 is slightly different in that it calls upon the stage3d and uploads resources to it to make use of the gpu rendering i mentioned earlier.</p>
<pre class="prettyprint" rel="Actionscript"><code>package
{
	import alternativa.engine3d.controllers.SimpleObjectController;
	import alternativa.engine3d.core.Camera3D;
	import alternativa.engine3d.core.Object3D;
	import alternativa.engine3d.core.Resource;
	import alternativa.engine3d.resources.Geometry;
	import alternativa.engine3d.core.View;

	import flash.display.Stage3D;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.display.StageQuality;
	import flash.events.Event;
	import flash.events.ProgressEvent;
	import flash.display.BitmapData;
	import flash.geom.Point;
	import flash.geom.Rectangle;

	import Player;

	[SWF(backgroundColor="#000000", frameRate="30", width="800", height="600")]

	public class Character extends Sprite
	{
		[Embed(source="char.png")] static private const CharSkin2:Class;

		private var scene:Object3D = new Object3D();
		private var camera:Camera3D;
		private var controller:SimpleObjectController;
		private var stage3D:Stage3D;
		private var player:Player;

		public function Character():void
		{
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;

			camera = new Camera3D(1, 1000);
			camera.view = new View(stage.stageWidth, stage.stageHeight, false, 0, 0, 4);
			addChild(camera.view);
			addChild(camera.diagram);

			camera.rotationX = -90*Math.PI/180;
			camera.y = -60;
			camera.z = 8;
			controller = new SimpleObjectController(stage, camera, 50);
			scene.addChild(camera);

			stage3D = stage.stage3Ds[0];
			stage3D.addEventListener(Event.CONTEXT3D_CREATE, onContextCreate);
			stage3D.requestContext3D();
		}

		private function onContextCreate(e:Event):void
		{
			stage3D.removeEventListener(Event.CONTEXT3D_CREATE, onContextCreate);

			addPlayer();

			stage.addEventListener(Event.ENTER_FRAME, onEnterFrame);
			stage.addEventListener(Event.RESIZE, onResize);
		}

		private function addPlayer():void
		{
			player = new Player(new CharSkin2().bitmapData, stage3D);
			scene.addChild(player);
			uploadResources(player.getResources(true));

			/*
			for each (var resource:Resource in scene.getResources(true)) {
				resource.upload(stage3D.context3D);
			}
			*/
		}

		private function uploadResources(resources:Vector.<Resource>):void {
			for each (var resource:Resource in resources) {
				resource.upload(stage3D.context3D);
			}
		}

		private function onEnterFrame(e:Event = null):void {
			controller.update();
			player.rotationZ -= 0.05;
			camera.render(stage3D);
		}

		private function onResize(e:Event = null):void {
			camera.view.width = stage.stageWidth;
			camera.view.height = stage.stageHeight;
			onEnterFrame();
		}
	}
}</code></pre>
<p>Here is the Player.as class</p>
<pre class="prettyprint" rel="Actionscript"><code>package
{
	import alternativa.engine3d.core.Object3D;
	import alternativa.engine3d.objects.Surface;
	import alternativa.engine3d.primitives.Box;
	import alternativa.engine3d.materials.TextureMaterial;
	import alternativa.engine3d.materials.FillMaterial;
	import alternativa.engine3d.resources.BitmapTextureResource;

	import flash.display.Stage3D;
	import flash.display.BitmapData;
	import flash.geom.Point;
	import flash.geom.Rectangle;

	public class Player extends Object3D
	{
		private var stage3D:Stage3D;
		private var bmd:BitmapData;
		private var head:Box;
		private var headE:Box;
		private var body:Box;
		private var legL:Box;
		private var legR:Box;
		private var armL:Box;
		private var armR:Box;
		private var mat:FillMaterial = new FillMaterial(0xFF0000);

		public function Player(bmd:BitmapData,stage3D:Stage3D):void
		{
			this.bmd = bmd;
			this.stage3D = stage3D;

			// Create Head
			head = new Box(8, 8, 8, 1, 1, 1);
			head.z = 8;

			// Create Head Outer Box
			headE = new Box(8.9, 8.9, 8.9, 1, 1, 1);
			headE.z = 8;

			// Create Body
			body = new Box(8, 4, 12, 1, 1, 1);
			body.z = -2;

			// Create Left Leg
			legL = new Box(4, 4, 12, 1, 1, 1);
			legL.z = -14;
			legL.x = 2;

			// Create Right Leg
			legR = new Box(4, 4, 12, 1, 1, 1);
			legR.z = -14;
			legR.x = -2;

			// Create Left Arm
			armL = new Box(4, 4, 12, 1, 1, 1);
			armL.z = -2;
			armL.x = 6;

			// Create Right Arm
			armR = new Box(4, 4, 12, 1, 1, 1);
			armR.z = -2;
			armR.x = -6;

			//create, apply, upload textures
			createPlayerMaterials();

			// Add all body parts to the player object
			addChild(head);
			addChild(headE);
			addChild(body);
			addChild(legL);
			addChild(legR);
			addChild(armL);
			addChild(armR);
		}

		private function createPlayerMaterials():void
		{
			// HEAD

			var front_head_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(8, 8), 8, 8));
			var front_head:TextureMaterial = new TextureMaterial(front_head_res);
			head.addSurface(front_head, 12, 2);
			//head.geometry.upload(stage3D.context3D);
			//front_head_res.upload(stage3D.context3D);

			var back_head_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(24, 8), 8, 8));
			var back_head:TextureMaterial = new TextureMaterial(back_head_res);
			head.addSurface(back_head, 18, 2);

			var left_head_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(16, 8), 8, 8));
			var left_head:TextureMaterial = new TextureMaterial(left_head_res);
			head.addSurface(left_head, 24, 2);

			var right_head_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(0, 8), 8, 8));
			var right_head:TextureMaterial = new TextureMaterial(right_head_res);
			head.addSurface(right_head, 30, 2);

			var top_head_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(8, 0), 8, 8));
			var top_head:TextureMaterial = new TextureMaterial(top_head_res);
			head.addSurface(top_head, 6, 2);

			var bottom_head_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(16, 0), 8, 8));
			var bottom_head:TextureMaterial = new TextureMaterial(bottom_head_res);
			head.addSurface(bottom_head, 0, 2);

			// HEADE
			var front_heade_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(40, 8), 8, 8));
			var front_heade:TextureMaterial = new TextureMaterial(front_heade_res);
			headE.addSurface(front_head, 12, 2);

			var back_heade_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(56, 8), 8, 8));
			var back_heade:TextureMaterial = new TextureMaterial(back_heade_res);
			headE.addSurface(back_head, 18, 2);

			var left_heade_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(48, 8), 8, 8));
			var left_heade:TextureMaterial = new TextureMaterial(left_heade_res);
			headE.addSurface(left_head, 24, 2);

			var right_heade_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(32, 8), 8, 8));
			var right_heade:TextureMaterial = new TextureMaterial(right_heade_res);
			headE.addSurface(right_head, 30, 2);

			var top_heade_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(40, 0), 8, 8));
			var top_heade:TextureMaterial = new TextureMaterial(top_heade_res);
			headE.addSurface(top_head, 6, 2);

			var bottom_heade_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(48, 0), 8, 8));
			var bottom_heade:TextureMaterial = new TextureMaterial(bottom_heade_res);
			headE.addSurface(bottom_head, 0, 2);

			// BODY
			var front_body_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(20, 20), 8, 8)); //8 , 12
			var front_body:TextureMaterial = new TextureMaterial(front_body_res);
			body.addSurface(front_body, 12, 2);

			var back_body_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(32, 20), 8, 8)); // 8, 12
			var back_body:TextureMaterial = new TextureMaterial(back_body_res);
			body.addSurface(back_body, 18, 2);

			var left_body_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(29, 20), 4, 8)); // 4, 12
			var left_body:TextureMaterial = new TextureMaterial(left_body_res);
			body.addSurface(left_body, 24, 2);

			var right_body_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(16, 20), 4, 8)); // 4, 12
			var right_body:TextureMaterial = new TextureMaterial(right_body_res);
			body.addSurface(right_body, 30, 2);

			var top_body_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(20, 16), 8, 4)); // 8, 4
			var top_body:TextureMaterial = new TextureMaterial(top_body_res);
			body.addSurface(top_body, 6, 2);

			var bottom_body_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(28, 16), 8, 4)); // 8, 4
			var bottom_body:TextureMaterial = new TextureMaterial(bottom_body_res);
			body.addSurface(bottom_body, 0, 2);

			// LEGL
			var front_legL_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(4, 20), 4, 8)); //4,12
			var front_legL:TextureMaterial = new TextureMaterial(front_legL_res);
			legL.addSurface(front_legL, 12, 2);

			var back_legL_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(12, 20), 4, 8)); //4,12
			var back_legL:TextureMaterial = new TextureMaterial(back_legL_res);
			legL.addSurface(back_legL, 18, 2);

			var left_legL_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(8, 20), 4, 8)); //4,12
			var left_legL:TextureMaterial = new TextureMaterial(left_legL_res);
			legL.addSurface(left_legL, 24, 2);

			var right_legL_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(0, 20), 4, 8)); //4,12
			var right_legL:TextureMaterial = new TextureMaterial(right_legL_res);
			legL.addSurface(right_legL, 30, 2);

			var top_legL_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(4, 16), 4, 4)); //4,4
			var top_legL:TextureMaterial = new TextureMaterial(top_legL_res);
			legL.addSurface(top_legL, 6, 2);

			var bottom_legL_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(8, 16), 4, 4)); //4,4
			var bottom_legL:TextureMaterial = new TextureMaterial(bottom_legL_res);
			legL.addSurface(bottom_legL, 0, 2);

			// LEGR
			var front_legR_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(4, 20), 4, 8)); //4,12
			var front_legR:TextureMaterial = new TextureMaterial(front_legR_res);
			legR.addSurface(front_legR, 12, 2);

			var back_legR_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(12, 20), 4, 8)); //4,12
			var back_legR:TextureMaterial = new TextureMaterial(back_legR_res);
			legR.addSurface(back_legR, 18, 2);

			var left_legR_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(0, 20), 4, 8)); //4,12
			var left_legR:TextureMaterial = new TextureMaterial(left_legR_res);
			legR.addSurface(left_legR, 24, 2);

			var right_legR_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(0, 20), 4, 8)); //4,12
			var right_legR:TextureMaterial = new TextureMaterial(right_legR_res);
			legR.addSurface(right_legR, 30, 2);

			var top_legR_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(4, 16), 4, 4)); //4,4
			var top_legR:TextureMaterial = new TextureMaterial(top_legR_res);
			legR.addSurface(top_legR, 6, 2);

			var bottom_legR_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(8, 16), 4, 4)); //4,4
			var bottom_legR:TextureMaterial = new TextureMaterial(bottom_legR_res);
			legR.addSurface(bottom_legR, 0, 2);

			// ARML
			var front_armL_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(44, 20), 4, 8)); //4,12
			var front_armL:TextureMaterial = new TextureMaterial(front_armL_res);
			armL.addSurface(front_armL, 12, 2);

			var back_armL_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(52, 20), 4, 8)); //4,12
			var back_armL:TextureMaterial = new TextureMaterial(back_armL_res);
			armL.addSurface(back_armL, 18, 2);

			var left_armL_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(48, 20), 4, 8)); //4,12
			var left_armL:TextureMaterial = new TextureMaterial(left_armL_res);
			armL.addSurface(left_armL, 24, 2);

			var right_armL_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(40, 20), 4, 8)); //4,12
			var right_armL:TextureMaterial = new TextureMaterial(right_armL_res);
			armL.addSurface(right_armL, 30, 2);

			var top_armL_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(44, 16), 4, 4)); //4,4
			var top_armL:TextureMaterial = new TextureMaterial(top_armL_res);
			armL.addSurface(top_armL, 6, 2);

			var bottom_armL_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(48, 16), 4, 4)); //4,4
			var bottom_armL:TextureMaterial = new TextureMaterial(bottom_armL_res);
			armL.addSurface(bottom_armL, 0, 2);

			//ARMR
			var front_armR_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(44, 20), 4, 8)); //4,12
			var front_armR:TextureMaterial = new TextureMaterial(front_armR_res);
			armR.addSurface(front_armR, 12, 2);

			var back_armR_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(52, 20), 4, 8)); //4,12
			var back_armR:TextureMaterial = new TextureMaterial(back_armR_res);
			armR.addSurface(back_armR, 18, 2);

			var left_armR_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(40, 20), 4, 8)); //4,12
			var left_armR:TextureMaterial = new TextureMaterial(left_armR_res);
			armR.addSurface(left_armR, 24, 2);

			var right_armR_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(48, 20), 4, 8)); //4,12
			var right_armR:TextureMaterial = new TextureMaterial(right_armR_res);
			armR.addSurface(right_armR, 30, 2);

			var top_armR_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(44, 16), 4, 4)); //4,4
			var top_armR:TextureMaterial = new TextureMaterial(top_armR_res);
			armR.addSurface(top_armR, 6, 2);

			var bottom_armR_res:BitmapTextureResource = new BitmapTextureResource(cropBitmapData(bmd, new Point(48, 16), 4, 4)); //4,4
			var bottom_armR:TextureMaterial = new TextureMaterial(bottom_armR_res);
			armR.addSurface(bottom_armR, 0, 2);
		}

		private function cropBitmapData(sourceBitmapData:BitmapData, startPoint:Point, width:Number, height:Number):BitmapData
        {
            var croppedBD:BitmapData = new BitmapData(width, height, true);
            croppedBD.copyPixels(sourceBitmapData, new Rectangle(startPoint.x, startPoint.y, width, height), new Point(0, 0));
            return croppedBD.clone();
            croppedBD.dispose();
		}
	}
}</code></pre>
<p>You can download the files <a href='http://davidejones.com/wp-content/uploads/2011/11/alternativa-minecraft-v8.17.zip'>here</a>, or view the demo <a href="http://davidejones.com/labs/minecraft-alternativa-8/" target="_blank">here</a>.</p>
<p>Also make sure to download the alternativa3d 8.17.0 swc library from alternativaplatform.com to make use of the download files.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidejones.com/blog/573-minecraft-player-updated-alternativa-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>styling your scrollbars with css3</title>
		<link>http://davidejones.com/blog/628-styling-scrollbars-css3/</link>
		<comments>http://davidejones.com/blog/628-styling-scrollbars-css3/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 06:18:10 +0000</pubDate>
		<dc:creator>davidejones</dc:creator>
				<category><![CDATA[website development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://davidejones.com/?p=628</guid>
		<description><![CDATA[When I first entered into the world of websites styling the browsers scroll bar was quite a common thing one of the designers I worked with would do. On the odd occasion when he built a site he would change &#8230; <a href="http://davidejones.com/blog/628-styling-scrollbars-css3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I first entered into the world of websites styling the browsers scroll bar was quite a common thing one of the designers I worked with would do. On the odd occasion when he built a site he would change the view port scroll bar to match the theme of the website. At the time I was amazed by this, I was still very new to the industry and this seemed great that not only could you style the website but you could possibly change how the browser style is on that page. As time went on and I began to realize that only internet explorer supported this feature and that it really was not something that we needed to do so I abandoned it.</p>
<p>Could we do it? yes, but did we need to? definitely not.</p>
<p>Just a few days ago I discovered that webkit introduced the capability to style scroll bars back in around 2009. I wasn&#8217;t aware of this addition until recently but part of me thinks actually it&#8217;s a good thing that i didn&#8217;t know. The reason being that no one else is using it or at least i haven&#8217;t noticed it on any sites. Which brings me back to my point just because we can do it doesn&#8217;t mean we should.</p>
<p>At the very least if you are going to do it then i think you should have a good reason to do so. Why? because our browsers, its interface, its widgets and website buttons, links and other interactive features need to be intuitive we need to know that a scrollbar is a scrollbar and that a checkbox is a checkbox they need to be recognizable for the sake of usability. There is nothing wrong with changing these but there should be a good reason to do so and it shouldn&#8217;t compromise the users ability to use a website.</p>
<p>Here is how you can do it with webkit just don&#8217;t bring back the hellish colour schemes from the early internet explorer days for the sake of my eyes.</p>
<p><img src="http://davidejones.com/wp-content/uploads/2011/09/scroll.jpg" alt="" title="scroll" width="433" height="256" class="alignnone size-full wp-image-1068" /></p>
<p>To style the scrollbar in a webkit browser try using these webkit vendor prefixed selectors.</p>
<pre class="prettyprint" rel="css"><code>-webkit-scrollbar
-webkit-scrollbar-button
-webkit-scrollbar-track
-webkit-scrollbar-track-piece
-webkit-scrollbar-thumb
-webkit-scrollbar-corner
-webkit-resizer</code></pre>
<p>Heres a simple example of using these on the view port of a page (the main browser scrollbar)</p>
<pre class="prettyprint" rel="css"><code>::-webkit-scrollbar {
	background:#978139;
}
::-webkit-scrollbar-thumb {
	background:#473a0d;
	border-top:1px solid #dec470;
	border-bottom:1px solid #dec470;
}</code></pre>
<p><img src="http://davidejones.com/wp-content/uploads/2011/11/scroll1.jpg" alt="" title="scroll1" width="574" height="458" class="alignnone size-full wp-image-1069" /></p>
<p>If you are looking for more variety and different combinations take a look at <a href="http://trac.webkit.org/export/41842/trunk/LayoutTests/scrollbars/overflow-scrollbar-combinations.html">the webkit tracker</a> for some examples.</p>
<p>There are of course javascript implimentations to allow you to style your scrollbars in the browsers that don&#8217;t support this. Try taking a look at <a href="http://www.kelvinluck.com/projects/jscrollpane-custom-cross-browser-scrollbars/">jScrollPane</a> or some of <a href="http://www.net-kit.com/jquery-custom-scrollbar-plugins/">scrollbar plugins here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidejones.com/blog/628-styling-scrollbars-css3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Css3 Pie and making behaviours behave</title>
		<link>http://davidejones.com/blog/670-css3-pie-behaviour/</link>
		<comments>http://davidejones.com/blog/670-css3-pie-behaviour/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 20:37:59 +0000</pubDate>
		<dc:creator>davidejones</dc:creator>
				<category><![CDATA[website development]]></category>
		<category><![CDATA[behavior]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://davidejones.com/?p=670</guid>
		<description><![CDATA[I&#8217;ve always avoided behaviours in my css files because they have always seemed to cause me so many more problems than they solved. In the past its been referencing the path to the htc or differences when setting the website &#8230; <a href="http://davidejones.com/blog/670-css3-pie-behaviour/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always avoided behaviours in my css files because they have always seemed to cause me so many more problems than they solved. In the past its been referencing the path to the htc or differences when setting the website live that caused me all kinds of headaches. However after coming across the excellent <a href="http://css3pie.com">Css3 Pie</a> its hard not to use it for certain fixes.</p>
<p>So i thought I&#8217;d post a quick few tips to help you troubleshoot the problems and let you have your pie and eat it.</p>
<p><strong>No matter what PIE.htc has no effect in ie?</strong></p>
<p>First of all check that the file is even being downloaded, alright I&#8217;m sure this is pretty obvious but you&#8217;d be surprised how many times you can overlook the simple things. You can check its there by using the internet explorer developer tools. Hit F12 on your keyboard and a dialog box will open click the network tab and start capturing and then refresh the page you should see all the assets that the website downloads. Any that aren&#8217;t available should show up with a 404 marked in red. Check that PIE.htc is even listed and that its being downloaded and check the path its loading from.</p>
<p><img class="alignnone size-full wp-image-682" title="css3pie-not-loading-htc-ie" src="http://davidejones.com/wp-content/uploads/2011/09/css3pie-not-loading-htc-ie.jpg" alt="" width="573" height="156" /></p>
<p><strong>Its not being downloaded</strong></p>
<p>This one has always confused me but the url used in the behaviour is not relative to the css file its relative to the html document being loaded.</p>
<p>So for instance you might normally reference an image like this where you have your css in a folder and you want to go back a directory and then into the img directory to find the background.jpg.</p>
<pre class="prettyprint" rel="css"><code>#test {
   background-image:url(../img/background.jpg);
}</code></pre>
<p>However if you are using a behaviour doing something like above will not work. Instead I find it best to put the behaviour in the root of the website. So its located at http://www.mywebsite.com/PIE.htc and then tell the css url to be /PIE.htc or just PIE.htc</p>
<pre class="prettyprint" rel="css"><code>#test {
   behavior:url(/PIE.htc);
}

#test2 {
   behavior:url(PIE.htc);
}</code></pre>
<p><strong>Ok its there and being downloaded but still its having no effect</strong></p>
<p>If it is being loaded but still seems to be having no effect you might want to create a .htaccess file for your website with the following</p>
<pre class="prettyprint" rel="htaccess"><code>AddType text/x-component   htc</code></pre>
<p>Recently a web server i was using was requesting the PIE.htc file as text/html which caused it not to work. Adding the line above to a htaccess file forced the mimetype of the .htc file to be text/x-component which allows it to execute.</p>
<p>If for some reason this also does not work i believe css3 pie now also comes with a php file that will help serve the file up with the right headers. Check the download files for PIE.php and you should use it just like the htc file</p>
<pre class="prettyprint" rel="css"><code>#test {
   behavior:url(PIE.php);
}</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://davidejones.com/blog/670-css3-pie-behaviour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

