Sunset clock

I dunno if this even is possible - but you guys have suprised me before so, here goes: I would like to make a animation that is adjusted by my (the PC) clock. Say that I have an animation that shows a day -> sunset -> night -> morning -> day… and so on. Looping. Would it be possible to have the sun go down at a certain time etc!

I dont know if my english is understandable or if I just can’t express myself… hope you get it anyhow and that someone’s good enough :hugegrin:

If you want me to post a .fla with some kind of animation, let me know!

thanks!!

amazing… nobody knows… Im stunned!!

Well… you could fit your animation to the length of a day, maybe.
As in, 1 frame represents 1 minute, and then based on the time of the PC, gotoAndStop(minute)?
It’s only 1440 frames :stuck_out_tongue:

I’d try to do it via AS

If you used

ActionScript Code:
[FONT=Courier New][LEFT]today = [COLOR=#000000]**new**[/COLOR] [COLOR=#0000FF]Date[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];

hour = today.[COLOR=#0000FF]getHours[/COLOR]COLOR=#000000[/COLOR];
minute = today.[COLOR=#0000FF]getMinutes[/COLOR]COLOR=#000000[/COLOR].[COLOR=#0000FF]toString[/COLOR]COLOR=#000000[/COLOR];
[/LEFT]
[/FONT]

to setup up some variables you could work with. Then if you done some maths, you can make the time manipulate say the brightness of the sun, its position…the colour of the sky, fade from blue to orange to black etc…

but as sun rise/set changes daily and obviously in different parts of the world you may need to consider coding in ActionScript Code:
[FONT=Courier New][LEFT]month = today.[COLOR=#0000FF]getMonth[/COLOR]COLOR=#000000[/COLOR];
day = today.[COLOR=#0000FF]getDate[/COLOR]COLOR=#000000[/COLOR];
[/LEFT]
[/FONT]

so it could work precisely with known figures, but tis wouldn’t be able to account for geographical position, only a preset location…unless you culd read their country too, but thats just getting a bit insane. it depends how precise you want it.

I’m not the best person to ask, but thats where I’d start…

great ideas - thanks guys! its ok - its a swedish site so im gonna do it for their time and such. again, thanks!

You can use PHP to get the time on the server, then it will be swedish time everywhere!:

$timestamp = time();

I happened to be looking for cool clocks and found one all in AS.
On line 113 you could do a comparison with a variables that you define up front.
This is probably overkill, but looks cool to me!

NOTE: Credit goes to Folko Langner at Actionscript.org | website [U][COLOR=#0000ff]http://www.advance-media.com [/COLOR][/U]

Rustyd

http://www.advance-media.com

wow… that is quite possibly the worst use of flash i have ever seen, i wish i could poke my own eyes out with that pin.

wow… that is quite possibly the worst use of flash i have ever seen, i wish i could poke my own eyes out with that pin.

Amen.

nuff sed :ninja:

Thanks Defective,

Very interesting.

I feel bad for always downloading from Kirupa and not contributing. So, that was my first attempt to try and give something back~!

I am extremely new at this so I am glad to know that the attachment was a horrible example because I was actually trying to learn something from it. Apparently I am looking at the wrong type of examples to learn from.

So my question is; Is it the ‘way’ that guy went about creating that clock (just bad scripting), or what?
I am trying very hard to learn AS so I appreciate the fact that you pointed out that this is Bad AS. I am just wondering why it is bad ??

Pre-apologies for trying to ask questions for myself within your thread…so if this is out of line, just ignore!

Best Regards,
Rustyd

I wasn’t talking about the attachment, i was talking about their website. Seriously, take a look, I bet you’ll puke.:slight_smile:

Sorry, i didn’t mean for you to take it that way, i never even looked at the file.

Yeah, I puked. :diss: Not as bad as mine, but still…

god i got a head ace and i feel really wierd right now what a horrible experience, i think this will scar for life

those sound effects are horrible