1277 posts
  • Bought between 50 and 99 items
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 6-7 years
  • Interviewed on the Envato Notes blog
  • Referred between 100 and 199 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+2 more
rondog says

I have a timer that turns a hand on a clock

Now the hand has to go the full 360 degrees which would be the start to finish.

How can I adjust the timer delay based off a number, say like 15 seconds?

This is as3..thanks guys

7208 posts
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 10 000 and 50 000 dollars
  • Envato Studio (Microlancer) Beta Tester
  • Beta Tester
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Author had a Free File of the Month
  • Bought between 50 and 99 items
  • Referred between 10 and 49 users
+1 more
doru says
1277 posts
  • Bought between 50 and 99 items
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 6-7 years
  • Interviewed on the Envato Notes blog
  • Referred between 100 and 199 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+2 more
rondog says

I know how to use the delay lol

I need to know how much of a delay to set

So say I need to move 360 degrees over 15 seconds. I need to figure out that delay. Say I need to move 360 degrees over 30 seconds.. I need to figure out that delay. I just don’t know the formula to get that delay.

341 posts
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
  • Europe
  • Has been a member for 6-7 years
  • Referred between 200 and 499 users
OXYLUS says

Make the delay 15000 / 360 and in the time handler, increment the rotation with 1. If you want to increment it by n, make the delay 15000 / (360 / n). You get the idea

7208 posts
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 10 000 and 50 000 dollars
  • Envato Studio (Microlancer) Beta Tester
  • Beta Tester
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Author had a Free File of the Month
  • Bought between 50 and 99 items
  • Referred between 10 and 49 users
+1 more
doru says

360 / 60 = 6 degree per second

360 degrees / time = how many degree to move per second

1277 posts
  • Bought between 50 and 99 items
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 6-7 years
  • Interviewed on the Envato Notes blog
  • Referred between 100 and 199 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+2 more
rondog says

Well it seems the higher my seconds are the more inaccurate it is. If I set it to 5 seconds, it seems pretty accurate. Setting it to 15 takes about 24 seconds to make that 360 degree rotation. Here is my class. Just open a new FLA and:

import StopWatch;
var sw:StopWatch = new StopWatch(15);
addChild(sw);

then click the stage to start the timer.

StopWatch.as: http://pastie.org/1376761

7208 posts
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 10 000 and 50 000 dollars
  • Envato Studio (Microlancer) Beta Tester
  • Beta Tester
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Author had a Free File of the Month
  • Bought between 50 and 99 items
  • Referred between 10 and 49 users
+1 more
doru says

you should search for accurate timer in as3, it is used mostly in games but you can apply it to your project. I had some links around, if you don’t find it on the net I would try to find those links (that I don’t know were they are now) :)

2485 posts Premium Scripts, Plugins and Themes
  • Bought between 10 and 49 items
  • Elite Author
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 7-8 years
  • Interviewed on the Envato Notes blog
  • Referred between 200 and 499 users
+1 more
LucidStudios says

15*24 = 360, so what’s wrong?

1277 posts
  • Bought between 50 and 99 items
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 6-7 years
  • Interviewed on the Envato Notes blog
  • Referred between 100 and 199 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+2 more
rondog says

15*24 = 360, so what’s wrong?

I want it to take 15 seconds to make the 360 degree rotation..its taking 24 seconds

Check this out: http://ronnieswietek.com/_random/timer.swf

The watch on the left is set to 15 seconds and the watch on the right is set to 5 seconds (click the stage to start)

5767 posts
  • Exclusive Author
  • Author had a File in an Envato Bundle
  • Elite Author
  • Has been a member for 6-7 years
  • Sold between 100 000 and 250 000 dollars
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • India
+3 more
VF says

Looks like the problem is due to frame rate and timer trigger having a slip. Instead of time based triggering, try with enterframe. (ie, on each enterframe get the time lapse, find angle and rotate accordingly)

by
by
by
by
by
by