HariesDesign.com How to create time and date in same place with flash? I will explain it, you can see like this :
Please follow step below : Step 1 Create new document, from properties use dimensions 200 px X 50 px
Step 2
Create some layer
Step 3
Start form bg layer, create background with Fill Tool, and transparent line color 
Step 4
Set center position from align panel
Step 5
From Color panel, use Linear type 
Step 6
From time layer, create text to showing a clocks, change with Dynamic text , write instance name with clock_txt. 
From date layer, as same as with time layer,create text to showing date, insert variable with myDate 
Step 7
From action time, action date layer, all action insert this script code: Action time :
time=new Date(); // time object var seconds = time.getSeconds() var minutes = time.getMinutes() var hours = time.getHours() if (hours<12) { ampm = "AM"; } else{ ampm = "PM"; } while(hours >12){ hours = hours - 12; } if(hours<10) { hours = "0" + hours; } if(minutes<10) { minutes = "0" + minutes; }// author: haries // www.hariesdesign.com if(seconds<10) { seconds = "0" + seconds; } clock_txt.text = hours + ":" + minutes + ":" + seconds +" "+ ampm;
action date
myDate = new Date(); weekday = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); month = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
// author: haries
// www.e-howdowedo.com myDate = (weekday[myDate.getDay()]+" "+myDate.getDate()+" "+month[myDate.getMonth()]+" "+myDate.getFullYear()); all action
gotoAndPlay(1); Now you have : 
Test with Ctrl+Enter Done..
Trackback(0)
|