{"id":207,"date":"2020-02-28T09:34:21","date_gmt":"2020-02-28T09:34:21","guid":{"rendered":"https:\/\/flashspeaksactionscript.com\/?p=207"},"modified":"2020-02-29T01:57:43","modified_gmt":"2020-02-29T01:57:43","slug":"flash-countdown-timer","status":"publish","type":"post","link":"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/","title":{"rendered":"Flash Countdown Timer"},"content":{"rendered":"\n

In this tutorial, you will learn how to create a timer in Adobe Flash that will count down the time to a given date in days, hours, minutes, and seconds. If you were looking for a great Flash tool for counting down holidays, birthdays, etc, this is the tutorial for you.<\/p>\n\n\n\n

Also, this Flash countdown timer tutorial allows you to preset any day of your choice with in AS2 and AS3. Have fun!<\/p>\n\n\n\n

Create the Flash Countdown Timer in AS2<\/h2>\n\n\n\n

This tutorial will go over the basics on constructing a Flash countdown timer within Actionscript 2.0.<\/p>\n\n\n\n

Step 1<\/strong>: Create a dynamic text field with the string value of \u201c00:00:00:00\u2033. Note:this is simply to get the text field to the size needed for the dynamic content.<\/em><\/p>\n\n\n\n

Step 2<\/strong>: Delete the string value of text field and name the text field \u201ctime_txt\u201d.<\/p>\n\n\n\n

Step 3<\/strong>: Create a new layer named \u201cactions\u201d and insert the following code in the first keyframe:<\/p>\n\n\n\n

Source File:<\/strong> REMOVED<\/p>\n\n\n\n

Update:<\/strong> Based on your feedback on this tutorial, I decided to create a hassle free CountdownTimer AS3 class that will assist in creating your very own flash countdown timer. Learn how to create a Flash Countdown in AS3 using this class.<\/a> <\/p><\/blockquote>\n\n\n\n

\/\/onEnterFrame allows for a function to be called every tick\nthis.onEnterFrame = function()\n{\n\t\/\/Stores the current date\n\tvar today:Date = new Date();\n\t\/\/Stores the Current Year\n\tvar currentYear = today.getFullYear();\n\t\/\/Stores the Current Time\n\tvar currentTime = today.getTime();\n\t\/\/Creates and stores the target date\n\tvar targetDate:Date = new Date(currentYear,11,25);\n\tvar targetTime = targetDate.getTime();\n\t\/\/Determines how much time is left.  Note: Leaves time in milliseconds\n\tvar timeLeft = targetTime - currentTime;\n\tvar sec = Math.floor(timeLeft\/1000);\n\tvar min = Math.floor(sec\/60);\n\tvar hours = Math.floor(min\/60);\n\tvar days = Math.floor(hours\/24);\n\t\/\/Takes results of var remaining value.  Also converts \"sec\" into a string\n\tsec = String(sec % 60);\n\t\/\/Once a string, you can check the values length and see whether it has been reduced below 2.\n\t\/\/If so, add a \"0\" for visual purposes.\n\tif(sec.length < 2){\n\t\tsec = \"0\" + sec;\n\t}\n\tmin = String(min % 60);\n\tif(min.length < 2){\n\t\tmin = \"0\" + min;\n\t}\n\thours = String(hours % 24);\n\tif(hours.length < 2){\n\t\thours = \"0\" + hours;\n\t}\n\tdays = String(days);\n\n\tif(timeLeft > 0 ){\n\t\t\/\/Joins all values into one string value\n\t\tvar counter:String = days + \":\" + hours + \":\" + min + \":\" + sec;\n\t\ttime_txt.text = counter;\n\t}else{\n\t\ttrace(\"TIME'S UP\");\n        var newTime:String = \"00:00:00:00\";\n        time_txt.text = newTime;\n        delete (this.onEnterFrame);\n\t}\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"

In this tutorial, you will learn how to create a timer in Adobe Flash that will count down the time to a given date in days, hours, minutes, and seconds. If you were looking for a great Flash tool for counting down holidays, birthdays, etc, this is the tutorial for you. Also, this Flash countdown […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[8,17,7,9,16,18,13,19,14,15,12],"yoast_head":"\r\nFlash Countdown Timer - Flash & Action Script<\/title>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/\" \/>\r\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"Flash Countdown Timer - Flash & Action Script\" \/>\r\n<meta property=\"og:description\" content=\"In this tutorial, you will learn how to create a timer in Adobe Flash that will count down the time to a given date in days, hours, minutes, and seconds. If you were looking for a great Flash tool for counting down holidays, birthdays, etc, this is the tutorial for you. Also, this Flash countdown […]\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/\" \/>\r\n<meta property=\"og:site_name\" content=\"Flash & Action Script\" \/>\r\n<meta property=\"article:published_time\" content=\"2020-02-28T09:34:21+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2020-02-29T01:57:43+00:00\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"romeo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/flashspeaksactionscript.com\/#organization\",\"name\":\"Flash Speaks Action Script\",\"url\":\"https:\/\/flashspeaksactionscript.com\/\",\"sameAs\":[],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/flashspeaksactionscript.com\/#logo\",\"inLanguage\":\"fr-FR\",\"url\":\"https:\/\/flashspeaksactionscript.com\/wp-content\/uploads\/2020\/02\/fsa_header.gif\",\"contentUrl\":\"https:\/\/flashspeaksactionscript.com\/wp-content\/uploads\/2020\/02\/fsa_header.gif\",\"width\":384,\"height\":97,\"caption\":\"Flash Speaks Action Script\"},\"image\":{\"@id\":\"https:\/\/flashspeaksactionscript.com\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/flashspeaksactionscript.com\/#website\",\"url\":\"https:\/\/flashspeaksactionscript.com\/\",\"name\":\"Flash Speaks Action Script\",\"description\":\"Flash Speaks Action Script\",\"publisher\":{\"@id\":\"https:\/\/flashspeaksactionscript.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/flashspeaksactionscript.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/#webpage\",\"url\":\"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/\",\"name\":\"Flash Countdown Timer - Flash & Action Script\",\"isPartOf\":{\"@id\":\"https:\/\/flashspeaksactionscript.com\/#website\"},\"datePublished\":\"2020-02-28T09:34:21+00:00\",\"dateModified\":\"2020-02-29T01:57:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/flashspeaksactionscript.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Flash Countdown Timer\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/#webpage\"},\"author\":{\"@id\":\"https:\/\/flashspeaksactionscript.com\/#\/schema\/person\/12465390cabdbd540e13c94722ba8016\"},\"headline\":\"Flash Countdown Timer\",\"datePublished\":\"2020-02-28T09:34:21+00:00\",\"dateModified\":\"2020-02-29T01:57:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/#webpage\"},\"wordCount\":210,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/flashspeaksactionscript.com\/#organization\"},\"keywords\":[\"Adobe Flash\",\"Air Game\",\"AS2\",\"AS3\",\"Collada\",\"Debugger\",\"FlashCamp\",\"FlashPaper\",\"Innovative Flash Content\",\"QuickTime\",\"SWFObject\"],\"articleSection\":[\"Article\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/flashspeaksactionscript.com\/#\/schema\/person\/12465390cabdbd540e13c94722ba8016\",\"name\":\"romeo\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/flashspeaksactionscript.com\/#personlogo\",\"inLanguage\":\"fr-FR\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b71d1e1ea443ac779fd59a57093d12fc?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b71d1e1ea443ac779fd59a57093d12fc?s=96&d=identicon&r=g\",\"caption\":\"romeo\"},\"url\":\"https:\/\/flashspeaksactionscript.com\/author\/romeo\/\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Flash Countdown Timer - Flash & Action Script","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/","og_locale":"fr_FR","og_type":"article","og_title":"Flash Countdown Timer - Flash & Action Script","og_description":"In this tutorial, you will learn how to create a timer in Adobe Flash that will count down the time to a given date in days, hours, minutes, and seconds. If you were looking for a great Flash tool for counting down holidays, birthdays, etc, this is the tutorial for you. Also, this Flash countdown […]","og_url":"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/","og_site_name":"Flash & Action Script","article_published_time":"2020-02-28T09:34:21+00:00","article_modified_time":"2020-02-29T01:57:43+00:00","twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"romeo","Dur\u00e9e de lecture estim\u00e9e":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/flashspeaksactionscript.com\/#organization","name":"Flash Speaks Action Script","url":"https:\/\/flashspeaksactionscript.com\/","sameAs":[],"logo":{"@type":"ImageObject","@id":"https:\/\/flashspeaksactionscript.com\/#logo","inLanguage":"fr-FR","url":"https:\/\/flashspeaksactionscript.com\/wp-content\/uploads\/2020\/02\/fsa_header.gif","contentUrl":"https:\/\/flashspeaksactionscript.com\/wp-content\/uploads\/2020\/02\/fsa_header.gif","width":384,"height":97,"caption":"Flash Speaks Action Script"},"image":{"@id":"https:\/\/flashspeaksactionscript.com\/#logo"}},{"@type":"WebSite","@id":"https:\/\/flashspeaksactionscript.com\/#website","url":"https:\/\/flashspeaksactionscript.com\/","name":"Flash Speaks Action Script","description":"Flash Speaks Action Script","publisher":{"@id":"https:\/\/flashspeaksactionscript.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/flashspeaksactionscript.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"fr-FR"},{"@type":"WebPage","@id":"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/#webpage","url":"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/","name":"Flash Countdown Timer - Flash & Action Script","isPartOf":{"@id":"https:\/\/flashspeaksactionscript.com\/#website"},"datePublished":"2020-02-28T09:34:21+00:00","dateModified":"2020-02-29T01:57:43+00:00","breadcrumb":{"@id":"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/flashspeaksactionscript.com\/"},{"@type":"ListItem","position":2,"name":"Flash Countdown Timer"}]},{"@type":"Article","@id":"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/#article","isPartOf":{"@id":"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/#webpage"},"author":{"@id":"https:\/\/flashspeaksactionscript.com\/#\/schema\/person\/12465390cabdbd540e13c94722ba8016"},"headline":"Flash Countdown Timer","datePublished":"2020-02-28T09:34:21+00:00","dateModified":"2020-02-29T01:57:43+00:00","mainEntityOfPage":{"@id":"https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/#webpage"},"wordCount":210,"commentCount":0,"publisher":{"@id":"https:\/\/flashspeaksactionscript.com\/#organization"},"keywords":["Adobe Flash","Air Game","AS2","AS3","Collada","Debugger","FlashCamp","FlashPaper","Innovative Flash Content","QuickTime","SWFObject"],"articleSection":["Article"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/flashspeaksactionscript.com\/flash-countdown-timer\/#respond"]}]},{"@type":"Person","@id":"https:\/\/flashspeaksactionscript.com\/#\/schema\/person\/12465390cabdbd540e13c94722ba8016","name":"romeo","image":{"@type":"ImageObject","@id":"https:\/\/flashspeaksactionscript.com\/#personlogo","inLanguage":"fr-FR","url":"https:\/\/secure.gravatar.com\/avatar\/b71d1e1ea443ac779fd59a57093d12fc?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b71d1e1ea443ac779fd59a57093d12fc?s=96&d=identicon&r=g","caption":"romeo"},"url":"https:\/\/flashspeaksactionscript.com\/author\/romeo\/"}]}},"_links":{"self":[{"href":"https:\/\/flashspeaksactionscript.com\/wp-json\/wp\/v2\/posts\/207"}],"collection":[{"href":"https:\/\/flashspeaksactionscript.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/flashspeaksactionscript.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/flashspeaksactionscript.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/flashspeaksactionscript.com\/wp-json\/wp\/v2\/comments?post=207"}],"version-history":[{"count":2,"href":"https:\/\/flashspeaksactionscript.com\/wp-json\/wp\/v2\/posts\/207\/revisions"}],"predecessor-version":[{"id":244,"href":"https:\/\/flashspeaksactionscript.com\/wp-json\/wp\/v2\/posts\/207\/revisions\/244"}],"wp:attachment":[{"href":"https:\/\/flashspeaksactionscript.com\/wp-json\/wp\/v2\/media?parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/flashspeaksactionscript.com\/wp-json\/wp\/v2\/categories?post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/flashspeaksactionscript.com\/wp-json\/wp\/v2\/tags?post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}