# Days Countdown w/ xml

**URL:** <https://forum.kirupa.com/t/days-countdown-w-xml/216680>\
**Category:** flash\
**Created:** [February 19, 2007, 5:46pm UTC](https://forum.kirupa.com/t/days-countdown-w-xml/216680 "2007-02-19T17:46:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![faubus42](https://avatars.discourse-cdn.com/v4/letter/f/f08c70/32.png) [@faubus42](https://forum.kirupa.com/u/faubus42)\
**Post date:** [February 19, 2007, 5:46pm UTC](https://forum.kirupa.com/t/days-countdown-w-xml/216680/1 "2007-02-19T17:46:56Z")

</div>

Hi all I found this code in this forum for a countdown to days:

```auto

[COLOR=#000000] **var** [/COLOR] end_date = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000FF]Date[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000080]2007[/COLOR], [COLOR=#000080]11[/COLOR], [COLOR=#000080]7[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000] **var** [/COLOR] tmp_date = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000FF]Date[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000] **var** [/COLOR] now_date = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000FF]Date[/COLOR][COLOR=#000000]([/COLOR]tmp_date.[COLOR=#0000FF]getFullYear[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR], tmp_date.[COLOR=#0000FF]getMonth[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR], tmp_date.[COLOR=#0000FF]getDate[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000] **var** [/COLOR] difference = end_date.[COLOR=#0000FF]getTime[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]-now_date.[COLOR=#0000FF]getTime[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000] **var** [/COLOR] daysleft = difference/[COLOR=#000080]1000[/COLOR]/[COLOR=#000080]60[/COLOR]/[COLOR=#000080]60[/COLOR]/[COLOR=#000080]24[/COLOR];
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]createTextField[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]"daysleft_txt"[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]0[/COLOR][COLOR=#000000])[/COLOR];
daysleft_txt.[COLOR=#0000FF]autoSize[/COLOR] = [COLOR=#FF0000]"left"[/COLOR];
daysleft_txt.[COLOR=#0000FF]text[/COLOR] = !daysleft ? [COLOR=#FF0000]"Tonight!"[/COLOR] : daysleft+[COLOR=#000000]([/COLOR]daysleft>[COLOR=#000080]1[/COLOR] ? [COLOR=#FF0000]" Days!"[/COLOR] : [COLOR=#FF0000]" Day!"[/COLOR][COLOR=#000000])[/COLOR];
daysleft_txt.[COLOR=#0000FF]setTextFormat[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000] **new** [/COLOR] [COLOR=#0000FF]TextFormat[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]"Verdana"[/COLOR], [COLOR=#000080]10[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];

```

It works excellent i was wondering if there was a way to do something like this but have it access an xml file for the new Date(); Basically i want the ability to change the date without having to go into the FLA everytime. Any direction would be greatly appreciated.

thanks,  
faubus
