Posted
on May 11, 2012, 4:16 am,
by Daniel,
under
Hardware.
There is nothing like turning and turning your USB plugs around trying to jam them in without any success. The problem is that the socket is symmetrical but the inner plug workings aren't. Living in an age where we are surrounded by products with good industrial design, when things like this have obvious flaws it can be frustrating.
When the mini and micro versions of the plug were designed, this issue was taken into consideration.


The problem with this design is although it is no longer symmetrical on 2 axes, it still requires the plug to be inserted with a particular orientation.
The most obvious solution is to make the rotation of the plug inconsequential by duplicating and rotating the inner parts of the plug.

Now you can plug your USB in any without worrying about the orientation of the plug or the socket.
This would most likely slightly increase the manufacturing costs of each plug and socket but as a person regularly frustrated by this I would be happy to pay a little extra.
The same method can be applied to plugs that need a unique footprint (i.e. the micro and mini versions).

Posted
on May 10, 2012, 4:28 pm,
by Daniel,
under
News.
Well it has been over a year since my last post, and in that time a great deal has changed. I moved countries, changed jobs, had a baby boy and bought a house!
Also during the last year my work focus has broadened away from being a Flash and ActionScript specialist. As Digital Director of The Kingdom I now manage all web projects covering a broad range of technology. This means that the posts I've been inspired to write are not really relevant to the existing content of this blog: "ActionScript Scraps". I have decided to continue blogging here, but will change the tone of the blog with new posts.
From now on I hope to be blogging on a wider variety of topics including all web technologies. Going along with this change I feel it is time for a design refresh which will be happening over the next few weeks.
Posted
on April 16, 2011, 5:43 pm,
by Daniel,
under
Uncategorized.
I recently came across this problem with a small AR project I was working on. Sometimes the webcam would work, but other times the SWF would seem to freeze when the Webcam Flash Player Settings window would come up. I could still "tab" around the settings window but I couldn't select the "Allow" button to enable my webcam. This was pretty frustrating until I came across this helpful post on stackoverflow:
http://stackoverflow.com/questions/3003724/cant-click-allow-button-in-flash-on-firefox
It seems that it is a bug within the Flash Player Settings that occurs when the window width isn't a whole pixel, and the CSS for the window is set to margin auto. With a bit of javascript trickery you can make sure that you won't have this problem again.
Posted
on January 17, 2011, 2:40 pm,
by Daniel,
under
actionscript.

This project was another fantastic visualisation for David McCandless of informationisbeautiful.
http://www.informationisbeautiful.net/
It is the second visualisation we have worked on, and it was even more fun than the first.
The data is coming in live (as a CSV) from a Google Docs Spreadsheet http://bit.ly/tonsofcarbon.
The application is built in Flash using ActionScript 3.0 and the PureMVC framework, with SWFAddress and a small amount of XML.
You can read more about this project on David's great blog here:
http://www.informationisbeautiful.net/2011/how-much-carbon/
link
Posted
on October 7, 2010, 12:31 am,
by Daniel,
under
actionscript.
Recently I had to install the Subversive plug-in in Flash Builder 4, but was unable to due to consistent errors during installation.
FlashBuilder -> Help -> Install new Software
http://download.eclipse.org/technology/subversive/0.7/update-site/
I'm not sure if this is a bug in FlashBuilder 4, but this link just was just giving me errors during installation. If you are also having this problem, you can try another location that worked for me:
http://download.eclipse.org/releases/galileo/

thanks to http://www.flex-tutorial.fr/2010/03/30/flash-builder-4-installation-de-subversive-et-connecteurs-svn/ for the tip
Posted
on September 7, 2010, 1:54 pm,
by Daniel,
under
Uncategorized.
I have now made the UK Postcode Mapper Firefox extension open source, after a user suggestion on this blog. I initially decided to create this extension as a way to learn more about Firefox and javascript. Since the first build I have updated it twice, but don't have time to maintain it anymore, so making it open-source makes perfect sense.
The source can be access on github at this location:
http://github.com/danjp/ukpostcodemapper
The license info is in the README file.
If you would like to get involved in publishing / updating this project at mozilla.org, please email me and I will add you as a new Author.
Posted
on September 1, 2010, 1:15 pm,
by Daniel,
under
actionscript.
Recently a FlashBuilder project I was working on just stopped compiling using the debugger. The program would just hang with the build progress stuck on 57%. I tried many things to fix this, including uninstalling and reinstalling the debug versions of the Flash player without any luck. Eventually I found that the player that was launching was not the Debug player but the Release build. I discovered that once I changed the file preferences for SWF files it would debug again.
To do this on a Mac, select "Open with...", choose "Other...", select the Debug player and check the "Always Open With" checkbox.
There is another method document on StackOverflow that I haven't tried.
Mac OSX / FlashBuilder 4
Posted
on August 23, 2010, 8:03 am,
by Daniel,
under
actionscript.
There are many ways to arrange objects in a grid using ActionScript and some ways of doing this are easier than others. The following way I have found is the easiest.
If you loop through all of your objects using a for(var i...) loop or something similar, you can set the x and y position of each one using only one line of code:
// inside a for(var i:int...) loop
gridObj.x = START_X + (i % COLUMNS) * (PAD_X + gridObj.width);
gridObj.y = START_Y + Math.floor(i / COLUMNS) * (PAD_Y + gridObj.height);
(COLUMNS is the number of required columns, PAD_X and PAD_Y are padding between objects along each axis.)
This uses the modulo (%) operator to determine the remainder of the division of the iterator and the number of columns. This is used for the X position of each object. The y position is calculated the other way, using Math.floor to get the highest exact number of divisions these two numbers will produce.
Note: int() can also be used instead of Math.floor().
Posted
on August 3, 2010, 8:56 am,
by Daniel,
under
actionscript.
Here is a handy class to display a simple spinning load indicator / preload animation while your content is loading or transitioning. This demo uses the bit101 minimalcomps to show how flexible and configurable this class is.

Use this demo to set up the style for your project, then hit the "copy" button to copy the configuration to your clipboard.
click to launch
Usage:
// create
_loadInd = new LoadIndicator(this, 75, 75);
// remove
_loadInd.destroy();
download LoadIndicator.as
Posted
on July 28, 2010, 3:15 am,
by Daniel,
under
actionscript.
This was a very quick build and a steep learning curve with the Facebook Graph API integration. The site is PureMVC, AS3 and XML driven. Also it integrates with a Renault server for saving information about each user and their betting scores for the competition.
An interesting campaign with some great prizes available, but be quick as this is only for 9 more days.

link