Label

  • ActionScript 2
  • AD Player 2
  • Algorithm 2
  • AS3 16
  • Audio 1
  • Audio Description Player 1
  • Bitmap 1
  • BitmapData 1
  • Browser 1
  • C# Experience 4
  • Chart 1
  • Flash 10
  • Game 1
  • Geometry 1
  • JavaScript 2
  • Mathematics 6
  • Music Online 1
  • MVC 1
  • Performance 1
  • PureMVC 1
  • Slide 1
  • Talks 1
  • Tool 1
  • Tool Player 1
Toggle Side
Home   »   Flash   »   How old are you?

How old are you?

Not long ago, a friend asked my age, I assured her that I had reached the age Y but she insisted that I just reached the age of X, said that of her I have not reached the age of Y.

How can demonstrated their age to another friend, this is simple, if you use MS Excel you can calculate the right amount of time that you went through, you can also find a web site that calculates age by clicking on the sample form, but I find a way to personal the ActionScript is adapted from JavaScript.

Usage:
var date:DateUtilities = new DateUtilities();
var currentTime:Number = Date.UTC(2011, 11, 05, 12, 12, 12, 12);
var birthDate:Number = Date.UTC(1985, 01, 01, 06, 30, 12, 12);
var old:String = date.qryHowOld(currentTime, birthDate);
//result: 26 years 9 months 2 weeks 3 days 5 hours

I try to create examples to avoid falling into oblivion, at least I am using this code, welcome everybody :)

Demo:








Source:

DateUtilities.as
Dater.as


Labels: AS3 ,  Flash   at:  7:19 AM     Email This BlogThis! Share to X Share to Facebook

0 comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments ( Atom)
© Hung Le 2007-2016. Powered by Blogger