DevelopPHP
home gear home donate
Search Results For
in:

Libraries book

HTML Library CSS Library JavaScript Library PHP Library

Videosbook

PHP and MySQL JavaScript HTML and CSS Vector and 3D Flash Actionscript Android Dev Miscellaneous

Resourcesbook

Website Hosting Developer Q+A

Download Source Files

<iframe width="560" height="315" src="http://www.youtube.com/embed/nuMpkcLChXM" frameborder="0" allowfullscreen></iframe>
You can embed this video on your blog or web page by copying the video embed code above and pasting it into the source code of your page. Adjust the width and height to specify the size you would like it to display.
Thumb Countdown to Specific Date and Time
Embed Source - http://www.youtube.com/watch?v=nuMpkcLChXM
Publish Date - Nov 03, 2008     Author - Adam Khoury
Countdown to Specific Date and Time
In this Flash AS3 tutorial Adam Khoury shows how to create a countdown to whatever specific date and time you want. In the example he chose Christmas due to its popularity in the United States. Countdown to any year, date, hour, minute, and exact second. Instead of implementing a timer he simply used two frames to accomplish the same functionality that a complex timer would. Have fun. He shows how to rig a countdown to 2012 near the end of the video.
Lesson Code
//Create a date object for Christmas Morning
var christmas:Date = new Date(2012, 11, 25, 0, 0, 0, 0);
//Current date object
var now:Date = new Date();
// Conditional to snap to frame 3 if it is xmas or past xmas
if (now >= christmas) {
gotoAndStop(3);
}
// Set the difference between the two date and times in milliseconds
var timeDiff:Number = christmas.getTime() - now.getTime();
//Convert the timeDiff(which is in milliseconds) into regular seconds-minutes-hours-days
//The Math.floor is the closest rounded integer that is less than or equal to the decimal number
var seconds:Number = Math.floor(timeDiff / 1000);
var minutes:Number = Math.floor(seconds / 60);
var hours:Number = Math.floor(minutes / 60);
var days:Number = Math.floor(hours / 24);
// Set the remainder of the division vars above
hours %= 24;
minutes %= 60;
seconds %= 60;
// String all vars together for display
var timeRemaining:String = "Days= " + days + " Hours= " + hours + " Minutes= " + minutes + " Seconds= " + seconds;
// Display everything in their dynamic text fileds
timeString.text = timeRemaining;
now_txt.text = "Now = " + now;
xmas_txt.text = "Xmas = " + christmas;

Home   •   Terms of Use   •   T-Shirts   •   RSS   •   Testimonials   •   Subscribe   •   Classroom Chalkboard   •   Developer Q+A   •   Donate   •   Top ↑
Popular In PHP / MySQL E-Commerce Store Production
Social Network Website Building
Image Upload / Photo Processing
CMS Software Programming
Mass Email Systems
Magic XML Data
Search Programming
Popular In JavaScript JSON Programming
Ajax Programming
Animating Elements
WYSIWYG Programming
Date/Time Programming
DOM Scripting
Object Reference
Popular In HTML Canvas Element
New Form Elements
Audio Element
Video Element
Drag and Drop
Event Handling
Element Grouping
Popular In CSS Custom Font Embedding
Dynamic Fit Backgrounds
Theatre Mode
Box Overlays
CSS Level 1 Properties
CSS Level 2 Properties
CSS Level 3 Properties
DevelopPHP.com is a growing educational system packed with video and written material that you can access 24/7 100% free. The focus here in 2013 is spread between five technologies: HTML, CSS, JavaScript, PHP and MySQL. Learn programming theory, database interaction, web design, animation, graphics editing, vector art, 3D modeling, and much more. The educational experience here is a hybrid one offering both high quality video tutorials and code libraries that grow more robust every day. The code libraries are being assembled so that developers can discover all of the building blocks of their favorite languages. The libraries coupled with high quality video tutorials will take you deep down the rabbit hole very quickly. You can also ask questions and get free advice at WebIntersect.com.
HTML5