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
I 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
I 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
I 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.
- The identifier of the video (http://www.youtube.com/watch?v=ajjg3faIQ5A)
- The width of the video in pixels (optional)
- The height of the video in pixels (optional)
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:
<?php/** Smarty plugin* -------------------------------------------------------------* Author: Chris Underhill (www.chris-underhill.com)* File: function.utube.php* Type: function* Name: utube* Purpose: outputs a utube video in the standard format* Usage : {utube video='1796OXXdVzs' width='800' height='800'} width/height are optional and will default to standard 425x373* -------------------------------------------------------------*/function smarty_function_utube($params, &$smarty){//var for our movie identifier$tagCode = '';//width / height default values$setWidth = 425;$setHeight = 373;//param loopforeach($params as $_key => $_val) {switch ($_key){case "video": $tagCode = $_val;case "width": $setWidth = $_val;case "height": $setHeight = $_val;}}//swf code output$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>';//return utube embed codereturn $swfCode;}/* {utube video='1796OXXdVzs' width='?' height='?'} */?>- Download this code: utubeSmarty.txt
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’}