New Media Fun

Having fun in an online world

Archive for August, 2009

Just Made Me Laugh

Posted by admin under Fun

Just a quick tip for those in ActionScript 3 who need to convert a color stored as a uint variable.

Today, I was working with a variable that was storing a Hexadecimal color in a uint format. That is great for applying color throughout flash. But I wanted to apply the color to a TextField that was being styled by CSS. CSS needs to read a string in Hexadecimal format.

The color is:

var myColor:uint = 14540253;

To convert to a HEX String value:

var myHEXColor:String = "#" + myColor.toString(16);
//myHEXColor = #dddddd

Pretty easy eh! Now you can plug that right into a CSS TextField.

The students at NorQuest College are getting free email this September. They will have their accounts hosted by Google and by default, their birthdays are the passwords to initially access the Gmail accounts.

Now, I for one find it confusing which birthday format to use; is it “MMDDYY”, “DDMMYY” or “YYMMDD”. It really could be endless.

So this is where jQuery steps in. My task was to create a simple AJAX application that will let the user select their birthday from drop down menus and the password will be dynamically generated for the user to copy and paste for Gmail access.

To use the code create a DIV that will hold the password generator:

<div id="passDate">Password Generator Here</div>

Use jQuery to run the code:

$(document).ready(function(){
   $('#passDate').datePassword();
});

The end result is like this:
Birthday Password Generator

Birthday Password Generator

Birthday Password Generator 3

Birthday Password Generator 4

You can see a working version of this at My NorQuest

The Date Password plug in can be downloaded here

jQuery datePassword plug in

Any comments or suggestions for the datePassword plug-in, I would love to hear from you. :)

Every day I find new reasons why I love the open source community so much. Yesterday, I stumbled upon Makerbot.com, a small company that has created an open source hardware device that will print out 3D images with the equivalent of using a hot glue gun. The device is called Cupcake CNC. Check out the Google talk video, it is really neat to think of what the possibilities could be with this device.

httpvh://www.youtube.com/watch?v=zirHL_rRBu0

Now, all I have to do is save $1000.