package com { import flash.display.*; import flash.events.*; import flash.net.*; import com.TweenNano; public class Main extends MovieClip { public function Main() { } public function startTheShow(e:Event = null){ stop(); border_mc.buttonMode = true; border_mc.addEventListener(MouseEvent.CLICK, expandPanel); text_1_mc.alpha = 0; text_2_mc.alpha = 0; text_3_mc.alpha = 0; text_4_mc.alpha = 0; overlay_mc.alpha = 0; logo_mc.alpha = 0; cta_mc.alpha = 0; setupTime(); frame01(); } public function frame01(){ TweenNano.to(text_1_mc, 0.50, {alpha:1.00}); TweenNano.to(border_mc, 3.00, {onComplete:frame02}); } public function frame02(){ TweenNano.to(text_1_mc, 0.50, {alpha:0.00}); TweenNano.to(text_2_mc, 0.50, {alpha:1.00, delay:0.75}); TweenNano.to(border_mc, 3.50, {onComplete:frame03}); } public function frame03(){ TweenNano.to(text_2_mc, 0.50, {alpha:0.00}); TweenNano.to(text_3_mc, 0.50, {alpha:1.00, delay:0.75}); TweenNano.to(border_mc, 3.00, {onComplete:frame04}); } public function frame04(){ TweenNano.killTweensOf(border_mc); TweenNano.to(text_1_mc, 0.50, {alpha:0.00}); TweenNano.to(text_2_mc, 0.50, {alpha:0.00}); TweenNano.to(text_3_mc, 0.50, {alpha:0.00}); TweenNano.to(text_4_mc, 0.50, {alpha:1.00}); TweenNano.to(overlay_mc, 0.50, {alpha:0.85}); TweenNano.to(logo_mc, 0.50, {alpha:1.00}); TweenNano.to(cta_mc, 0.50, {alpha:1.00}); } public function setupTime(){ var numObj:Object = text_1_mc.time_mc.numbers_mc; var mydate = new Date(); var amPos:Number = 0; var pmPos:Number = -20; var hoursNum:Number = mydate.getHours(); var hoursText:String; var minutesText:String = mydate.getMinutes() < 10 ? "0" + mydate.getMinutes():mydate.getMinutes(); if(hoursNum > 12){ hoursNum = hoursNum-12; numObj.aPm_mc.y = pmPos; }else if(hoursNum == 0){ hoursNum = 12; }else if(hoursNum == 12){ numObj.aPm_mc.y = pmPos; } if(hoursNum >= 10){ numObj.x = 38; hoursText = String(hoursNum); }else if(hoursNum < 10){ numObj.x = 25; hoursText = "0" + hoursNum; numObj.number_1_mc.alpha = 0; } numObj.number_1_mc.y = Number(hoursText.substr(0, 1))*-20; numObj.number_2_mc.y = Number(hoursText.substr(1, 2))*-20; numObj.number_3_mc.y = Number(minutesText.substr(0, 1))*-20; numObj.number_4_mc.y = Number(minutesText.substr(1, 2))*-20; } public function expandPanel(e:Event) { EB.Clickthrough(); } } }