Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 8th, 2003, 12:19 PM
bradbrevet bradbrevet is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 276 bradbrevet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 6 h 6 m 3 sec
Reputation Power: 6
Countdown

I want to create a countdown .swf file that countsdown to a certain date show days, hours, minutes, and seconds and does all this by accessing a .txt file with the date information.

I have no idea where to start, but I did attach a .fla I got off of Flash Kit that resembles what I want to do, but does not have the date in it and does not connect to a .txt file.

Can anyone help me out with this?
Attached Files
File Type: zip countdownfla.zip (16.4 KB, 495 views)

Reply With Quote
  #2  
Old August 11th, 2003, 03:27 PM
jamieB jamieB is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2002
Posts: 592 jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 1 h 56 m 16 sec
Reputation Power: 17
I dunno about the fla you have but if you have a textfile that looks like:
Code:
&deadline=25/12/2003

you can load it up and display how lonmg is left like this:
Code:
date_lv = new LoadVars();
date_lv.onLoad = parsedate;
date_lv.load("date.txt");
msInDay = 86400000;
msInHour = 3600000;
msInMinute = 60000;

function parseDate(success) {
if(success) {
var d = this.deadline.split("/");//change this according to the format your "date" is in
var deadline = new Date(d[2],d[1],d[0]);
deadline = deadline.getTime();
//trace("deadline:"+deadline);
var now = new Date();
var t = deadline - now;//ms between then and now
//trace("t:"+t);
var daysTilThen = Math.floor(t/msInDay);
var remainder = t-(daysTilThen*msInDay);
//trace("remainder:"+remainder)
var hoursLeftOver = Math.floor(remainder/msInHour);
remainder = remainder-(hoursLeftOver*msInHour);
var minutesLeftOver = Math.floor(remainder/msInMinute);
// then display the results somehow....
trace("Time left til "+this.deadline+": "+daysTilThen+" days, "+hoursLeftOver+" hours, "+minutesLeftOver+" minutes.")
} else {
trace("problems loading date!");
}
}


Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Countdown


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway