Sep
03
2008
Time And Date in Flash PDF Print E-mail

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

date and time in flash animation

Step 2

Create some layer

date and time in flash animation 

 

Step 3

Start form bg layer, create background with Fill Tool, and transparent line color

date and time in flash animation date and time in flash animation

 

Step 4

Set center position from align panel

date and time in flash animation 

 

Step 5

From Color panel, use Linear type

date and time in flash animation  date and time in flash animation

 

date and time in flash animation 

 

Step 6

From time layer, create text to showing a clocks, change with Dynamic text , write instance name with clock_txt.

date and time in flash animation

 

From date layer, as same as with time layer,create text to showing date, insert variable with myDate

date and time in flash animation

 

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 :

date and time in flash animation

 

Test with Ctrl+Enter

 

Done..

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Trackback(0)
Comments (0)Add Comment

Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

security code
Write the displayed characters


busy
 
< Prev   Next >

Gallery Photography

Login

Sponsors


Get Chitika Premium