Thanks for stopping by. I am a freelance web developer working and living in the UK. I specialise in Flash and rich internet applications using open source technologies. I am currently available for hire.

Latest development ramblings below ...


Flash AS3 image panorama

panorama1.jpgI had a client recently ask for a flash virtual tour for a project I am working on. Perfect opportunity to do a little class to use the ‘flashvars’ parameter to pass a photo location and a caption to the SWF.

Scrolling and panning is handled internally by the class which constrains movement based on loaded image size.

To use it, simply add the ‘flashvars’ tag to your object/embed code:

<param name=”flashVars” value=”photo=VancouverSunset.lg.jpg&caption=What a lovely panorama” />

If using SWF object, pass these values in a varaibles.

In AS3 we can then use these parameters by using the loaderInfo.parameters method. In this instance we would use loaderInfo.parameters.photo to reference the passed variable.

See it in action here

FPS counter for AS3

The guys over at squidder have made this great little flash MC to watch your FPS count. Useful on processor intensive apps. Just a single contained MC, copy and drop it where you need to monitor performance.

The above movie is published at 30FPS.

Get it from Google code: http://code.google.com/p/squidder/

Redbull Flight Lab

rb.jpgI don’t normally blog about cool sites but every now and again something really impressive arrives.

Check this out

http://www.redbull.com/flightlab/ 

Papervision has taken us to a whole new dimension…

uTube Smarty Plugin

icon-utube.gifI was playing around last night and came up with a plugin for Smarty to allow uTube videos to be displayed with relative ease and avoid a chunk of nasty unclean embed code in your templates. This is the first version offered and takes simple parameters for configuration.

Remeber that the the uTube video player is a NO_SCALE swf in that it will display to a maximum size without stretching so 800×25 will just show a thumbnail not a massive long banner. The width/height attributes are optional and if not set will default to the uTube standard dimensions.

With that in mind, here’s the plugin:

  1. <?php
  2.  
  3. /*
  4. * Smarty plugin
  5. * -------------------------------------------------------------
  6. * Author: Chris Underhill (www.chris-underhill.com)
  7. * File: function.utube.php
  8. * Type: function
  9. * Name: utube
  10. * Purpose: outputs a utube video in the standard format
  11. * Usage : {utube video='1796OXXdVzs' width='800' height='800'} width/height are optional and will default to standard 425x373
  12. * -------------------------------------------------------------
  13. */
  14.  
  15. function smarty_function_utube($params, &$smarty)
  16. {
  17. //var for our movie identifier
  18. $tagCode = '';
  19.  
  20. //width / height default values
  21. $setWidth = 425;
  22. $setHeight = 373;
  23.  
  24. //param loop
  25. foreach($params as $_key => $_val) {
  26. switch ($_key){
  27. case "video": $tagCode = $_val;
  28. case "width": $setWidth = $_val;
  29. case "height": $setHeight = $_val;
  30. }
  31. }
  32.  
  33. //swf code output
  34. $swfCode = '<object width="' . $setWidth . '" height="' . $setHeight . '"><param name="movie" value="http://www.youtube.com/v/' . $tagCode . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' . $tagCode . '" type="application/x-shockwave-flash" wmode="transparent" width="' . $setWidth . '" height="' . $setHeight . '"></embed></object>';
  35.  
  36. //return utube embed code
  37. return $swfCode;
  38.  
  39. }
  40.  
  41. /* {utube video='1796OXXdVzs' width='?' height='?'} */
  42.  
  43. ?>

To use it, copy the above code and paste it into a new file called “function.utube.php”. Save this in your smarty/plugins folder on your webserver.

To show a uTube video in your page simply use the following: {utube video=’1796OXXdVzs’}