Archive for the ‘tech’ Category

danrichardson.net

Wednesday, October 14th, 2009

Over the last few weeks I have been re-designing this site and plan to add a new “code” section. Along with that I have a fair bit of freelance work on-the-go, so things are on the go-slow.

I’m really liking my new design (if I may say so myself!), and I cannot wait to get it marked up and online. It’s not going to be fully active right away as I plan to learn and re-program it all in Ruby (on rails).

The most exciting part of this overhaul is the new “code” section. In my day-to-day job with Skylight Media, I come across lots of instances where I need/WANT to learn new/better/faster ways of doing things. I will be mainly focusing the code section on jQuery though as i absolutely love this library and constantly find myself writing a wide range of small and big plugins to make my everyday job easier.
One of my first posts on the new site will be of an image plugin I recently made for a Skylight Media client Rachel Ellen. Not another I hear you say, but this one I believe is pretty unique and is pretty scalable, best of all it rocks! :p

Keep your eyes peeled as hopefully something will be online soon! :)

Dan

Moved to WordPress!

Tuesday, February 10th, 2009

Well it’s been far too long and i haven’t had a chance to create an admin backend to my site. So i have decided to just use wordpress as it does just what i need. So expect more post’s, as it’s no longet a chore to get a post in! :)

Ruby On Rails

Tuesday, December 16th, 2008

After a bit of umming and arring last week, i finally decided to take another look at Ruby and Rails.

So far i’m quite liking what I see and some of it’s in-built functionality looks pretty darn sweet. I’m very much liking the scaffold command to do a quick & dirty table manipulation setup.

I’m reading a really nice simple beginner’s guide on sitepoint (which can be found here) which set’s a good understanding to the basics of Ruby On Rails.

Will probably be playing more with Ruby On Rails over the christmas period (or at least until my xbox comes back from Microsoft after its RRoD :( ), so will keep an update on here as to how I’m getting on with it.

Dynamic getURL in flash

Tuesday, July 29th, 2008

Today i got asked to add links to a flash animation that i have done recently. The flash animation in question has dynamic title’s and content based on two movie clips, which are built from an array of data pulled in from XML.

Knowing i needed to add a “getUrl()” function and “onRelease” event handler for the dynamic movie clips, I thought to myself “what would be the easiest was to do this…”

With the clips being made inside a simple for loop, i hoped the data being pulled from the array would be retained and correct for when the event handler was eventually triggered (optimistic i know!). If you hadn’t already guessed this didn’t work, so off i went thinking how i can have the right data when the event handler fires.

After a little while and tinkering with my code i finally figured out a solution. When attaching the movieClip you can store the instance in a variable and then set a variable inside the movie clip. When the event handler is triggered it simply calls “this.linkTo” (”this”, referring to the movieClip, and “linkTo” refferring to the variable) as the getURL() address parameter

The code snippet for this is:

// Create new instance of the Section_Title movie clip
var SectionTitle = attachMovie("Section_Title", Sections[ii][0], ii, { _x:-230, _y:_yPos });

// Set a variable for this movie clip for the navigate link
SectionTitle.linkTo = Sections[ii][2];

// Create event handler for the click release
SectionTitle.onRelease = function(){
// Goto page save in thje movie clip linkTo variable
getURL(this.linkTo);
}