Highlighted

## HOW CAN I MAKE THIS A WORKING CLOCK

Community Beginner ,
May 23, 2019

Copied

import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
import flash.events.MouseEvent;

{
var mytweensec:Tween=new Tween(Sec,"rotation",None.easeNone,0,360,60,true);
var mytweenmin:Tween=new Tween(Min,"rotation",None.easeNone,0,360,60*60,true);
var mytweenhr:Tween=new Tween(Hr,"rotation",None.easeNone,0,360,60*60*12,true);

}

function onfinish(event:TweenEvent){
event.target.start();
}

create 3 movieclips of the hour, minute and second hand.  orient them all to point up or north.  you can then use:

var d:Date;

function frameF(e:Event):void{

d=new Date();

hr.rotation = 30*(d.hours%12)+d.minutes/5;

min.rotation = 6*d.minutes;

sec.rotation = 6*d.seconds;

}

TOPICS
Discussions

Views

102

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

## HOW CAN I MAKE THIS A WORKING CLOCK

Community Beginner ,
May 23, 2019

Copied

import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
import flash.events.MouseEvent;

{
var mytweensec:Tween=new Tween(Sec,"rotation",None.easeNone,0,360,60,true);
var mytweenmin:Tween=new Tween(Min,"rotation",None.easeNone,0,360,60*60,true);
var mytweenhr:Tween=new Tween(Hr,"rotation",None.easeNone,0,360,60*60*12,true);

}

function onfinish(event:TweenEvent){
event.target.start();
}

create 3 movieclips of the hour, minute and second hand.  orient them all to point up or north.  you can then use:

var d:Date;

function frameF(e:Event):void{

d=new Date();

hr.rotation = 30*(d.hours%12)+d.minutes/5;

min.rotation = 6*d.minutes;

sec.rotation = 6*d.seconds;

}

TOPICS
Discussions

Views

103

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 23, 2019 0
5 Replies 5
May 23, 2019

Copied

what do you mean by a 'working clock?  do you want to display the current time based on the user's system clock?

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 23, 2019 0
Community Beginner ,
May 23, 2019

Copied

yes I do

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 23, 2019 0
May 23, 2019

Copied

create 3 movieclips of the hour, minute and second hand.  orient them all to point up or north.  you can then use:

var d:Date;

function frameF(e:Event):void{

d=new Date();

hr.rotation = 30*(d.hours%12)+d.minutes/5;

min.rotation = 6*d.minutes;

sec.rotation = 6*d.seconds;

}

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 23, 2019 0
Community Beginner ,
May 23, 2019

Copied

will that work with the tweens in above code?

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 23, 2019 0
LATEST
May 23, 2019