<?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>Haastek</title>
	<atom:link href="http://haastek.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://haastek.co.uk</link>
	<description>the blog of Luke Haas, focused on design and web-development</description>
	<lastBuildDate>Mon, 22 Feb 2010 19:28:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Build an interactive Polaroid Gallery with Actionscript 3 and the Flickr API</title>
		<link>http://haastek.co.uk/2010/02/build-an-interactive-polaroid-gallery-with-actionscript-3-and-the-flickr-api/</link>
		<comments>http://haastek.co.uk/2010/02/build-an-interactive-polaroid-gallery-with-actionscript-3-and-the-flickr-api/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 12:48:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript]]></category>

		<guid isPermaLink="false">http://haastek.co.uk/?p=51</guid>
		<description><![CDATA[
In this tutorial I explain how to create a Polaroid style Flickr gallery using the Flickr API and then how to apply user actions such as dragging and resizing and to those images.

Get SourceSee Demo
Step 1: Getting Started
To begin with, open Flash and create a new Actionscript 3.0 Flash file.


Set the stage to 800&#215;500 and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://haastek.co.uk/2010/02/build-an-interactive-polaroid-gallery-with-actionscript-3-and-the-flickr-api/"><img src="http://haastek.co.uk/wp-content/uploads/2010/02/prev2.jpg" alt="preview" width="580" height="155" /></a><br />
In this tutorial I explain how to create a Polaroid style Flickr gallery using the Flickr API and then how to apply user actions such as dragging and resizing and to those images.</p>
<p><span id="more-51"></span></p>
<p><a href="http://haastek.co.uk/wp-content/uploads/2010/02/flickrgallery.zip" class="linkgs">Get Source</a><a href="http://haastek.co.uk/gallery/flickrgallery.html" class="linkgs">See Demo</a></p>
<h2>Step 1: Getting Started</h2>
<p>To begin with, open Flash and create a new Actionscript 3.0 Flash file.
<p>
<img src="http://haastek.co.uk/wp-content/uploads/2010/02/1.jpg" alt="pic1" width="206" height="188" /></p>
<p>Set the stage to 800&#215;500 and then create a new Actionscript file.</p>
<h2>Step 2: The Libraries</h2>
<p>In this tutorial we&#8217;ll be using the as3flickrlib library to interface with the Flickr API. You can download it <a href=”http://code.google.com/p/as3flickrlib/”>here</a> and you&#8217;ll also need the as3corelib library as as3flickrlib is dependent on that. You can download that <a href=”http://code.google.com/p/as3corelib/”>here</a></p>
<h2>Step 3: Setting Up</h2>
<p>Once you&#8217;ve downloaded the libraries, you&#8217;ll need to make them accessible to Flash. To do this, go into preferences and then click on the Actionscript category and then Actionscript 3.0 settings. Here you&#8217;ll be able to add a new source path which you&#8217;ll need to set the location of the libraries you&#8217;ve just downloaded. </p>
<h2>Step 4: Begin Coding</h2>
<p>Start a package and begin by importing the following classes. </p>
<pre class="brush: js">
package
{
  import flash.display.*;
  import flash.events.*;
  import flash.net.URLRequest;
  import flash.filters.DropShadowFilter;
  import flash.geom.Point;
  import flash.system.Security;
  import com.adobe.webapis.flickr.*;
  import com.adobe.webapis.flickr.events.*;
</pre>
<h2>Step 5: The Class</h2>
<p>Start a class that extends Sprite and name it something like FlickrGallery, make sure to give the Actionscript file the same name when you save it. </p>
<pre class="brush: js">
public class FlickrGallery extends Sprite
{
</pre>
<h2>Step 6: The Variables</h2>
<p>Some of these variables can be changed at your discretion such as the minScale and maxScale variables, the maxWidth and maxHeight variables. </p>
<pre class="brush: js">
var xPosition:int = 0; //The X position of an image
	var yPosition:int = 0; //The Y position of an image
	var prevHeight:int; //Store the height of the last image to be loaded
	var imageCounter:int = 0; //Iterate each time an image is added
	var minScale:Number = 0.3; //The minimum scale boundary for images
	var maxScale:Number = 2.5; //The maximum scale boundary for images
	var totalResults:int = 15; //The number of results you want to be pulled from Flickr
	var api_key:String = &quot;&quot;; //your Flickr API key
	var searchQuery:String = &quot;paris&quot;; //the search criteria, change this to what you want
	var user:String = &quot;&quot;; //optional, the NSID of a particular Flickr user
	var photoCollection:PagedPhotoList; //the collected images
	var imageIndex:int = 0; //the image index for the array
	var displayPic:Bitmap = null; //the bitmap that the images will be assigned to
	var dShadow:DropShadowFilter = new DropShadowFilter(); //the shadow that will be applied to the images
	var targetImage:DisplayObject; //the target image for scaling
	var maxWidth:int = 150; //the maximum width that the images will be initialy displayed at
	var maxHeight:int = 200; //the maximum height that the images will be initially displayed at
	var xyPoints:Point; //the x and y points of an image when scaling
	var xyDistance:Number; //the distant between the x and y points and the mouse
	var imagesReturned:int = 0; // the number of images returned
</pre>
<h2>Step 7: Policy Files</h2>
<p>You&#8217;ll need to load Flickr&#8217;s cross domain policy files to enable you to load the images from Flickr in your own domain. </p>
<pre class="brush: js">
	Security.loadPolicyFile(&quot;http://farm1.static.flickr.com/crossdomain.xml&quot;);
   	Security.loadPolicyFile(&quot;http://farm2.static.flickr.com/crossdomain.xml&quot;);
   	Security.loadPolicyFile(&quot;http://farm3.static.flickr.com/crossdomain.xml&quot;);
   	Security.loadPolicyFile(&quot;http://farm4.static.flickr.com/crossdomain.xml&quot;);
	Security.loadPolicyFile(&quot;http://farm5.static.flickr.com/crossdomain.xml&quot;);
</pre>
<h2>Step 8: The Constructor</h2>
<p>Here we&#8217;ll declare the constructor; it will need to be named the same as the class. In this case FlickrGallery. </p>
<pre class="brush: js">
	public function FlickrGallery() {
	  dShadow.distance = 5;
	  dShadow.angle = 90;
	  dShadow.alpha = 0.5;
	  var service:FlickrService = new FlickrService(api_key);
      	  service.addEventListener(FlickrResultEvent.PHOTOS_SEARCH, handleResults);
          service.photos.search(user, searchQuery, &quot;any&quot;, &quot;&quot;, null, null, null, null, -1, &quot;&quot;, totalResults, 1);
    }
</pre>
<p>It starts by setting the distance, angle and alpha of the drop shadow that will be applied to the images. After that a new instance of the FlickrService class is created and then an event listener is attached to the Flickr search which will call the handleResults function when Flickr returns the search results. </p>
<h2>Step 9: Handle the Results</h2>
<p>Following on from the Flickr search in the constructor, the handleResults function starts by using an if statement to check if the search was successful. If it was, then the returned photos are placed in the photoCollection array, the number of images is assigned to the imagesReturned variable and the loadImages function is called. </p>
<pre class="brush: js">
	private function handleResults(event:FlickrResultEvent):void {
		if(event.success) {
			photoCollection = event.data.photos;
			imagesReturned = photoCollection.photos.length;
			loadImages();
	  } else {
		  trace(&quot;Failed to load images.&quot;);
	  }
    }
</pre>
<h2>Step 10: Load the Images</h2>
<p>The loadImages function starts by forming the URL of image to be loaded and then loading it using the URLReequest object and a Loader object. An event listener is then attached to the Loader and is set to call the displayImages function when it completes. </p>
<pre class="brush: js">
	private function loadImages() {
		var picURL:String = &quot;http://static.flickr.com/&quot; + photoCollection.photos[imageIndex].server + &quot;/&quot;
+ photoCollection.photos[imageIndex].id + &quot;_&quot; + photoCollection.photos[imageIndex].secret + &quot;.jpg&quot;;
		imageIndex++;
		var imageRequest:URLRequest = new URLRequest(picURL);
		var loader:Loader = new Loader();
		loader.contentLoaderInfo.addEventListener(Event.COMPLETE,displayImages);
		loader.load(imageRequest);
	}
</pre>
<h2>Step 11: Display the Images</h2>
<p>The displayImages function is large and will be broken up across then next few steps. It starts by assigning the content of the event target, i.e. the loaded image, to the displayPic variable which we declared earlier as a Bitmap. </p>
<pre class="brush: js">
	private function displayImages(event:Event):void {
		displayPic = event.currentTarget.content
		if(displayPic.width&gt;maxWidth) {
			displayPic.height = (displayPic.height/100)*((maxWidth/displayPic.width) * 100);
			displayPic.width = maxWidth;
		}
		if(displayPic.height&gt;maxHeight) {
			displayPic.width = (displayPic.width/100)*((maxHeight/displayPic.height) * 100);
			displayPic.height = maxHeight;
		}
</pre>
<p>After that the width and height of the image is checked against the maxHeight and maxWidth variables to see if the image size is within the required boundaries. If it&#8217;s not, then scaling is performed on the image by assigning the maxWidth or maxHeight to it and then working out the change as a percentage and applying that to the dimension that wasn&#8217;t changed. </p>
<h2>Step 12: Create the Image Holder</h2>
<p>We now need to create the holder for the image which in this case will be a Sprite. First, we create a new Sprite object and apply a colour fill of white to it. Then we draw it as a rectangle with its width and height slightly larger than the image it will be holding. </p>
<pre class="brush: js">
		var holder:Sprite = new Sprite();
		holder.graphics.beginFill(0xFFFFFF);
		holder.graphics.drawRect(0,0,displayPic.width+10,displayPic.height+30);
		holder.graphics.endFill();
		holder.rotation = (Math.round(Math.random() * (1+4-1)) + 1)*-1;
		holder.name = &quot;im&quot; + imageIndex;
		holder.filters = [dShadow];
</pre>
<p>Next, a slight rotation is applied to the holder to give the gallery a kind of rough scattered style a Polaroid gallery needs. Here, its minimum rotation is 1 and its maximum is 4 but you can alter these if you like. The holder is then named according to the imageIndex and then a drop shadow filter is applied to it which we set up in the constructor at the beginning. </p>
<h2>Step 13: Create the Scale Tab</h2>
<p>In this section we create the little tab that goes in the bottom-right corner of the holder, this is what the user drags to resize the image. </p>
<pre class="brush: js">
		var scaler:Sprite = new Sprite();
		scaler.graphics.beginFill(0xBBBBBB);
		scaler.graphics.drawRect(0,0,10,10);
		scaler.graphics.endFill();
		scaler.buttonMode = true;
		scaler.useHandCursor = true;
		scaler.x = displayPic.width - 2;
		scaler.y = displayPic.height + 17;
</pre>
<p>Once again we create a new Sprite object and this time fill it with a light grey colour, but you can use whichever colour you like. We then draw it as a rectangle and set its width and height to 10, we apply buttonMode and useHandCursor so that the cursor turns to a hand when a user hovers over it. We then set its x and y positions based on the width and height of the image associated with it. For the purpose of this tutorial I&#8217;ve kept this part simple and just used a grey square to represent a resize tab but you could use a more meaningful symbol or graphic. </p>
<h2>Step 14: Position the images</h2>
<p>Still working within the displayImages function, we now need to set the position that the current image will appear on the stage at. The first image is positioned at 0,0 or the top left corner of the screen, after that the next image is given the same x coordinate but the y coordinate is calculated based on the previous images height and generated randomly somewhere between 90% and 100% of the previous images height. This further adds to the random scattered style of the gallery. Also, the images are currently organized into columns of 3 but you can alter this if you desire. Just change the number where it says if(imageCounter==3). </p>
<pre class="brush: js">
		if(imageIndex&lt;2) {
			xPosition = 0;
			yPosition = 0;
		} else {
			yPosition = Math.round(Math.random() *
(1+(prevHeight+yPosition)-((prevHeight+yPosition)*0.9)) + ((prevHeight+yPosition)*0.9));
			if(imageCounter==3) {
				xPosition = displayPic.width + xPosition;
				yPosition = 0;
				imageCounter = 0;
			}
		}
		imageCounter++;
		prevHeight = displayPic.height;
		displayPic.x = 5;
		displayPic.y = 5;
		holder.x = xPosition;
		holder.y = yPosition;
</pre>
<p>After the image positions have been calculated we store the image height in the prevHeight variable for use with the next image and then set the x and y coordinates of the image within the holder, in this case 5,5. </p>
<h2>Step 15: Add to Stage</h2>
<p>In this section we add the displayPic and scaler to the holder and add the holder to the stage using the addChild method. Event listeners then need to be added to the holder and scaler, targeting the startImageDrag, stopImageDrag and scaleImage functions. </p>
<pre class="brush: js">
		holder.addChild(displayPic);
		holder.addChild(scaler);
		stage.addChild(holder);
		holder.addEventListener(MouseEvent.MOUSE_DOWN, startImageDrag);
		holder.addEventListener(MouseEvent.MOUSE_UP, stopImageDrag);
		scaler.addEventListener(MouseEvent.MOUSE_DOWN, scaleImage);
		if(imageIndex&lt;imagesReturned) {
			loadImages();
		}
	}
</pre>
<p>And finally ending the displayImages function with a call to the loadImages function to load the next image, if the imageIndex is less than the imagesReturned. </p>
<h2>Step 16: Dragg&#8230;</h2>
<p>The startImageDrag function is called when a mouse down event is detected on the image holder sprite. It brings the target to the forefront of the display list using the setChildIndex method and then invokes the built-in startDrag method on the target. </p>
<pre class="brush: js">
	private function startImageDrag(evt:MouseEvent) {
		stage.setChildIndex(stage.getChildByName(evt.target.name),stage.numChildren-1);
		evt.target.startDrag();
	}
</pre>
<h2>Step 17: And Drop</h2>
<p>The simplest function of all, stopImageDrag is triggered when a mouse up event is detected on the image holder and invokes the stopDrag method on the target. </p>
<pre class="brush: js">
	private function stopImageDrag(evt:MouseEvent) {
		evt.target.stopDrag();
	}
</pre>
<h2>Step 18: Prepare for Scaling</h2>
<p>The scaleImage function is called when a mouse down event is detected on the scaler sprite. It assigns the target parent, i.e. the image holder, to the targetImage variable and then removes the mouse down event listener from it. </p>
<pre class="brush: js">
	private function scaleImage(evt:MouseEvent) {
		targetImage = evt.target.parent;
		targetImage.removeEventListener(MouseEvent.MOUSE_DOWN, startImageDrag);
		stage.addEventListener(MouseEvent.MOUSE_MOVE,startImageScale);
		stage.addEventListener(MouseEvent.MOUSE_UP, stopImageScale);
		xyPoints = new Point(targetImage.x,targetImage.y);
		xyDistance = (Point.distance(new Point(mouseX, mouseY),xyPoints))/targetImage.scaleX;
	}
</pre>
<p>Event listeners are then added to the stage for detecting the starting and stopping of the image resize, these call the startImageScal and stopImageScale functions. After that, the coordinates of the image holder’s position is assigned to the xyPoints point object and the distance between that and the x and y position of the mouse is calculated and assigned to the xyDistance variable. This will be used in the subsequent functions for calculating the resizing of the image. </p>
<h2>Step 19: Scale Image</h2>
<p>The startImageScale is called when the mouse moves, it calculates a new distance between the mouse x and y positions and the x and y position of the image holder. It then scales the image holder, and thus the image, according to the change in distance calculated by dividing the newDistance variable by the initial xyDistance variable. Checks are then made to see if the scaleX or scaleY of the target are greater than the maxScale or less than the MinScale variables and if they are then those variables are assign to the scaleX and scaleY to stop the image from being expanded or shrunk past the boundaries. </p>
<pre class="brush: js">
	private function startImageScale(evt:MouseEvent) {
		var newDistance = Point.distance(new Point(mouseX, mouseY), xyPoints);
		targetImage.scaleX = targetImage.scaleY = newDistance/xyDistance;
		if(targetImage.scaleX&gt;maxScale) {
			targetImage.scaleX = targetImage.scaleY = maxScale;
		} else if(targetImage.scaleX&lt;minScale) {
			targetImage.scaleX = targetImage.scaleY = minScale;
		}
	}
</pre>
<h2>Step 20: Stop Scaling</h2>
<p>The final function of this project is stopImageScale, it&#8217;s called when a mouse up event is triggered from the stage and starts by removing the event listeners on the stage that relate to scaling. It then adds the mouse down event back to the image holder that has just been resized. </p>
<pre class="brush: js">
	private function stopImageScale(evt:MouseEvent) {
		stage.removeEventListener(MouseEvent.MOUSE_MOVE,startImageScale);
		stage.removeEventListener(MouseEvent.MOUSE_UP,stopImageScale);
		targetImage.addEventListener(MouseEvent.MOUSE_DOWN, startImageDrag);
	}
  }
}
</pre>
<p>The closing brackets for the class and package also need to be added here. </p>
<h2>Conclusion</h2>
<p>You can customize this however much you like; there are many things here that can be changed such as the search query, user NSID or the sizes of the images etc. </p>
<p>I hope you found this tutorial useful and thanks for reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://haastek.co.uk/2010/02/build-an-interactive-polaroid-gallery-with-actionscript-3-and-the-flickr-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7 Sites that Provide an Ambient User Experience</title>
		<link>http://haastek.co.uk/2010/01/7-sites-that-provide-an-ambient-user-experience/</link>
		<comments>http://haastek.co.uk/2010/01/7-sites-that-provide-an-ambient-user-experience/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 19:20:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[User Experience]]></category>

		<guid isPermaLink="false">http://haastek.co.uk/?p=38</guid>
		<description><![CDATA[Ambient user experience relates to the tone and personality of a site. It’s about shaping how users feel and influencing their perception. It’s something additional to a site that is unrelated to how the site functions, and providing it can have a powerful effect on users and their emotional connection with a site.
Here is a [...]]]></description>
			<content:encoded><![CDATA[<p>Ambient user experience relates to the tone and personality of a site. It’s about shaping how users feel and influencing their perception. It’s something additional to a site that is unrelated to how the site functions, and providing it can have a powerful effect on users and their emotional connection with a site.</p>
<p>Here is a list of 7 sites that provide an ambient user experience:</p>
<p><a href="http://www.vimeo.com" class="linktit">Vimeo</a><br />
Vimeo&#8217;s homepage features an informal and friendly welcome message as well as making use of sky and sun imagery in the background. These features give the site a warm, relaxed and friendly feel.</p>
<p><a href="http://www.vimeo.com"><img src="http://haastek.co.uk/wp-content/uploads/2010/01/vimeo2.jpg" alt="vimeo" width="580" height="320" /></a></p>
<p><span id="more-38"></span></p>
<p><a href="http://www.geekstorage.com/" class="linktit">Geek Storage</a><br />
It&#8217;s the cartoon illustrations and geek humour on this site that give it a friendly and appealing tone.
</p>
<p><a href="http://www.geekstorage.com/"><img src="http://haastek.co.uk/wp-content/uploads/2010/01/geekstorage2.jpg" alt="geekstorage" width="580" height="320" /></a></p>
<p><a href="http://www.getcodeslam.com/" class="linktit">CodeSlam</a><br />
CodeSlam with its messages like &#8220;Your email is safe in our galaxy too.&#8221; and playful visuals.
</p>
<p><a href="http://www.getcodeslam.com/"><img src="http://haastek.co.uk/wp-content/uploads/2010/01/codeslam2.jpg" alt="CodeSlam" width="580" height="320" /></a></p>
<p><a href="http://www.storenvy.com/" class="linktit">Storenvy</a><br />
Another example of playful imagery that gives the site a fun element.
</p>
<p><a href="http://www.storenvy.com/"><img src="http://haastek.co.uk/wp-content/uploads/2010/01/storenvy.jpg" alt="storenvy" width="580" height="320" /></a></p>
<p><a href="http://family.innocentdrinks.co.uk/" class="linktit">Innocent Drinks</a><br />
Innocent Drinks, particularly the family element of the site gives it a friendly appeal.
</p>
<p><a href="http://family.innocentdrinks.co.uk/"><img src="http://haastek.co.uk/wp-content/uploads/2010/01/innocent.jpg" alt="innocent" width="580" height="317" /></a></p>
<p><a href="www.flickr.com" class="linktit">Flickr</a><br />
Flickr with its quirky welcome messages.
</p>
<p><a href="www.flickr.com"><img src="http://haastek.co.uk/wp-content/uploads/2010/01/flickr.jpg" alt="flickr" width="580" height="320" /></a></p>
<p><a href="http://www.theshowmn.org/" class="linktit">The Show 09</a><br />
The informal text content and wacky illustrations give this site a welcoming and friendly feel.
</p>
<p><a href="http://www.theshowmn.org/"><img src="http://haastek.co.uk/wp-content/uploads/2010/01/theshow.jpg" alt="show" width="580" height="320" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://haastek.co.uk/2010/01/7-sites-that-provide-an-ambient-user-experience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set of Hand Drawn Social Media Icons</title>
		<link>http://haastek.co.uk/2010/01/set-of-hand-drawn-social-media-icons/</link>
		<comments>http://haastek.co.uk/2010/01/set-of-hand-drawn-social-media-icons/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 14:51:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Freebies]]></category>

		<guid isPermaLink="false">http://haastek.co.uk/?p=32</guid>
		<description><![CDATA[Here is a free set of 13 hand drawn social media icons. Including icons for YouTube, LastFM, Redit, Stumble Upon, Twitter, Yahoo, Blogger, Delicious, Design Float, Digg, Facebook, Feed and Flickr.


Download here955kb &#124; 14 x PNG &#124; 1 x JPG
]]></description>
			<content:encoded><![CDATA[<p><a href="http://haastek.co.uk/2010/01/set-of-hand-drawn-social-media-icons/"><img src="http://haastek.co.uk/wp-content/uploads/2010/01/prev.jpg" alt="icons" title="prev" width="580" height="156" /></a><br />Here is a free set of 13 hand drawn social media icons. Including icons for YouTube, LastFM, Redit, Stumble Upon, Twitter, Yahoo, Blogger, Delicious, Design Float, Digg, Facebook, Feed and Flickr.
<p><span id="more-32"></span></p>
<p><img src="http://haastek.co.uk/wp-content/uploads/2010/01/group1.jpg" alt="icon group" title="group" width="580" height="575" /></p>
<p><a href="http://haastek.co.uk/wp-content/uploads/2010/01/Haastek_Social_media.zip">Download here<br />955kb | 14 x PNG | 1 x JPG</a></p>
]]></content:encoded>
			<wfw:commentRss>http://haastek.co.uk/2010/01/set-of-hand-drawn-social-media-icons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inspiring Images &#8211; Collection 1</title>
		<link>http://haastek.co.uk/2009/12/inspiring-images-collection-1/</link>
		<comments>http://haastek.co.uk/2009/12/inspiring-images-collection-1/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 12:57:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Inspiration]]></category>

		<guid isPermaLink="false">http://haastek.co.uk/?p=26</guid>
		<description><![CDATA[This is part of a series of posts that showcase examples of inspirational graphic design.

















]]></description>
			<content:encoded><![CDATA[<p>This is part of a series of posts that showcase examples of inspirational graphic design.</p>
<p><a href="http://www.designfriendship.com/uploads/design-pretty-green-2.jpg"><img src="http://www.designfriendship.com/uploads/design-pretty-green-2.jpg" width="429" height="429" alt="Inspire1"/></a></p>
<p><span id="more-26"></span></p>
<p><a href="http://www.juliaguther.de/wp-content/uploads/life_is_uncertain.jpg"><img src="http://www.juliaguther.de/wp-content/uploads/life_is_uncertain.jpg" width="450" height="471" alt="Inspire2"/></a></p>
<p><a href="http://1.bp.blogspot.com/_PRzQzazg504/SuTiuICysqI/AAAAAAAABos/b656e936IvY/HL_nyc.jpg"><img src="http://1.bp.blogspot.com/_PRzQzazg504/SuTiuICysqI/AAAAAAAABos/b656e936IvY/HL_nyc.jpg" width="500" height="382" alt="Inspire3"/></a></p>
<p><a href="http://behance.vo.llnwd.net/profiles/57625/projects/169822/576251232047655.jpg"><img src="http://behance.vo.llnwd.net/profiles/57625/projects/169822/576251232047655.jpg" width="400" height="570" alt="Inspire4"/></a></p>
<p><a href="http://img.ffffound.com/static-data/assets/6/7ec531183be20c0a40172245bd748f3a5dbcfcd8_m.jpg"><img src="http://img.ffffound.com/static-data/assets/6/7ec531183be20c0a40172245bd748f3a5dbcfcd8_m.jpg" width="480" height="333" alt="Inspire5"/></a></p>
<p><a href="http://pikaland.com/images/1875.jpg"><img src="http://pikaland.com/images/1875.jpg" width="440" height="440" alt="Inspire6"/></a></p>
<p><a href="http://farm3.static.flickr.com/2783/4196195083_56bacde5bd.jpg"><img src="http://farm3.static.flickr.com/2783/4196195083_56bacde5bd.jpg" width="428" height="428" alt="Inspire7"/></a></p>
<p><a href="http://noisydecentgraphics.typepad.com/design/images/2007/10/30/ffffound1.jpg"><img src="http://noisydecentgraphics.typepad.com/design/images/2007/10/30/ffffound1.jpg" width="400" height="400" alt="Inspire8"/></a></p>
<p><a href="http://www.pixelcreation.fr/fileadmin/img/sas_image/galerie/graphisme/lesgraphiquants/08_les_graphiquants.jpg"><img src="http://www.pixelcreation.fr/fileadmin/img/sas_image/galerie/graphisme/lesgraphiquants/08_les_graphiquants.jpg" width="350" height="522" alt="Inspire9"/></a></p>
<p><a href="http://farm4.static.flickr.com/3131/2742663181_05aa0e23ec.jpg?v=0"><img src="http://farm4.static.flickr.com/3131/2742663181_05aa0e23ec.jpg?v=0" width="400" height="316" alt="Inspire10"/></a></p>
<p><a href="http://www.robertsamuelhanson.com/media/26358/mon-retail-3.png"><img src="http://www.robertsamuelhanson.com/media/26358/mon-retail-3.png" width="400" height="575" alt="Inspire11"/></a></p>
<p><a href="http://lovelypackage.com/wp-content/uploads/2009/11/jackiesmith1.jpg"><img src="http://lovelypackage.com/wp-content/uploads/2009/11/jackiesmith1.jpg" width="538" height="385" alt="Inspire12"/></a></p>
<p><a href="http://www.twigandthistle.com/blog/wp-content/uploads/2009/09/DIY_ice-cream_parlour_buffet_09.png"><img src="http://www.twigandthistle.com/blog/wp-content/uploads/2009/09/DIY_ice-cream_parlour_buffet_09.png" width="400" height="533" alt="Inspire13"/></a></p>
<p><a href="http://www.unplggd.com/uimages/unplggd/012209_sz_love.jpg"><img src="http://www.unplggd.com/uimages/unplggd/012209_sz_love.jpg" width="540" height="355" alt="Inspire13"/></a></p>
<p><a href="http://lovelypackage.com/wp-content/uploads/2009/11/clearspring2.jpg"><img src="http://lovelypackage.com/wp-content/uploads/2009/11/clearspring2.jpg" width="480" height="502" alt="Inspire14"/></a></p>
<p><a href="http://behance.vo.llnwd.net/profiles/70318/projects/139813/703181224827904.jpg"><img src="http://behance.vo.llnwd.net/profiles/70318/projects/139813/703181224827904.jpg" width="340" height="494" alt=""/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://haastek.co.uk/2009/12/inspiring-images-collection-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to jQuery</title>
		<link>http://haastek.co.uk/2009/12/introduction-to-jquery/</link>
		<comments>http://haastek.co.uk/2009/12/introduction-to-jquery/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 19:00:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://haastek.co.uk/?p=19</guid>
		<description><![CDATA[
jQuery is a javascript framework, first released by John Resig in 2006. Today it is the most popular JavaScript framework in the world. jQuery appeals to a wide variety of JavaScript developers, from those just starting out, to seasoned experts. This is in no small part due to the elegance and simplicity of jQuery, with [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://haastek.co.uk/2009/12/introduction-to-jquery/"><img class="alignnone size-full wp-image-20" title="jquery" src="http://haastek.co.uk/wp-content/uploads/2009/12/jquery.jpg" alt="jquery" width="565" height="96" /></a><br />
jQuery is a javascript framework, first released by John Resig in 2006. Today it is the most popular JavaScript framework in the world. jQuery appeals to a wide variety of JavaScript developers, from those just starting out, to seasoned experts. This is in no small part due to the elegance and simplicity of jQuery, with just a few lines of clear and concise code you can create anything from complex animations to advanced ajax functionality.</p>
<p>In this tutorial I will start from the beginning and give you a brief introduction to some of jQuery&#8217;s core concepts such as element selection, manipulation and events.
<p><span id="more-19"></span></p>
<p>The first thing you&#8217;ll need to do is download the jQuery core library from <a href="http://jquery.com/">jquery.com</a> and add a reference to it in your html page.</p>
<p>Now we can start writing some code. As the majority of stuff you&#8217;re most likely to do with jQuery will involve the DOM in some way, we&#8217;ll need to start with the jQuery ready event. This is an event that gets triggered when the page has loaded and the DOM is ready to be accessed.</p>
<pre class="brush: js">
$(document).ready(function() {

});
</pre>
<p>From within this function we can select and manipulate DOM elements. If, for example, you wanted to select an element by it&#8217;s ID, or select a group of elements by their class name, you can do this by using CSS selectors. This is done like this:</p>
<pre class="brush: js">
$(&quot;#nav&quot;)
//this would select an element with the ID of nav
$(&quot;.title&quot;)
//this would select all elements with the class name title
$(&quot;p&quot;)
//this would select all paragraphs
</pre>
<p>Once you have selected an element, or a group of elements, you have a vast array of options when it comes to dealing with that selection. You could:</p>
<pre class="brush: js">
$(&quot;#nav&quot;).css({&#039;width&#039;:&#039;500px&#039;,&#039;height&#039;:&#039;200px&#039;});
//alter it&#039;s css properties
var cont = $(&quot;#nav&quot;).html();
//assign its contents to a variable
$(&quot;#nav&quot;).html(&quot;insert this text&quot;);
//assign content to it
$(&quot;#nav&quot;).hide();
//perform an animation on it
</pre>
<p>And much more, you can also apply events to the elements you have selected. Here are some examples:</p>
<pre class="brush: js">
$(&quot;.title&quot;).click(function() {
//this triggers on a mouse click
});

$(&quot;input&quot;).focus(function() {
//this triggers when an input field gets focus
});

$(&quot;input&quot;).blur(function() {
//this triggers when an input field loses focus
});

$(&quot;#nav&quot;).mouseenter(function() {
//this triggers when the mouse moves over the element
});

$(&quot;#nav&quot;).mouseleave(function() {
//this triggers when the mouse moves over the element
});
</pre>
<p>Now we can put this all togther and create a basic function that gets triggered when an element with the ID of &#8216;nav&#8217; gets clicked on, which then causes the text colour of all the paragraphs on the page to be set to red and their content to be set to the text &#8216;This is a paragraph&#8217;:</p>
<pre class="brush: js">
$(document).ready(function() {
	$(&quot;#nav&quot;).click(function() {
	$(&quot;p&quot;).css({&#039;color&#039;:&#039;#ff0000&#039;});
	$(&quot;p&quot;).html(&quot;This is a paragraph&quot;);
});
});
</pre>
<p>This has been a basic introduction to jQuery, showing you some of the core concepts and functionality. The amount you can do with jQuery is vast and to get a better idea of this, I suggest you have a read through the documentation on the <a href="http://jquery.com/">jQuery</a> site.  It&#8217;s very thorough and informative with lots of great examples and demonstrations. Other useful jQuery sites include <a href="http://jqueryfordesigners.com/">jQuery for Designers</a> and <a href="http://jquery-howto.blogspot.com/">jQuery Howto</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://haastek.co.uk/2009/12/introduction-to-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
