Stick Page Forums Archive

Clock -AS 1.0

Started by: Tawnik | Replies: 4 | Views: 553

Tawnik
2

Posts: 2,292
Joined: May 2007
Rep: 10

View Profile
Feb 24, 2009 2:36 PM #363126
Do you know the AS to code clocks ?

http://www.swfcabin.com/open/1235483307 this one is working fine, but I NEED it to be compatibile with flash player 4 and Action Script 1.0

**Error** Scene=Scene 1, layer=actionscript, frame=1:Line 1: You must export your movie as Flash 5 to use this expression.
time=new Date(); // time object

**Error** Scene=Scene 1, layer=actionscript, frame=1:Line 2: You must export your movie as Flash 5 to use this action.
var seconds = time.getSeconds()

**Error** Scene=Scene 1, layer=actionscript, frame=1:Line 3: You must export your movie as Flash 5 to use this action.
var minutes = time.getMinutes()

**Error** Scene=Scene 1, layer=actionscript, frame=1:Line 4: You must export your movie as Flash 5 to use this action.
var hours = time.getHours()

WARNING: This movie uses features that are not supported in the Flash 4 player
Scene=Scene 1, layer=hodiny, frame=1:Flash MX Text Field Instance Name
Total ActionScript Errors: 4 Reported Errors: 4


thats what I get when I want to publish for flash player 4

Im using this AS

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;
}
if(seconds<10)
{
seconds = "0" + seconds;
}
clock.text = hours + ":" + minutes + ":" + seconds +" "+ ampm;


I didnt create it I just found it on the internet, if you can fix it somehow please tell me =)
Scorpioxxx
2

Posts: 1,454
Joined: Apr 2006
Rep: 10

View Profile
Feb 24, 2009 6:14 PM #363221
Its action script 2 so you need to call the variable in a different way since that way isn't used in AS1. Unfortunatly i never learned AS1 so I can't help past this.
Tawnik
2

Posts: 2,292
Joined: May 2007
Rep: 10

View Profile
Feb 24, 2009 6:58 PM #363255
Yes, seems like no one knows AS 1, thats bad :c
darkcampainger
2

Posts: 159
Joined: Aug 2006
Rep: 10

View Profile
Feb 25, 2009 5:12 AM #363602
I need to know more information before I can help you.

First off, why Flash 4? What are you making this for that you expect someone with Flash 4 to view it?

According to "Version Penetration" data from Adobe, less than 0.9% of computers have a version less than Flash 7. It's probably near zero for those with Flash 4:
http://www.adobe.com/products/player_census/flashplayer/version_penetration.html

If you are absolutely set on using Flash 4 (although even upgrading it to Flash 5 AS1 would make it considerably easier to make/maintain,) I think I've found how to do it, but I don't want to take the time putting it together if you just pulled that number out of the air. Also, it requires a javascript interface, since Flash 4 doesn't have a time/date function and needs to pull the current time from an external application.

The Date constructor was added in Flash 5, meaning the code you posted would compile under it.
Tawnik
2

Posts: 2,292
Joined: May 2007
Rep: 10

View Profile
Feb 25, 2009 9:54 PM #364013
I know I know, it has to be suitable for Mobile phones, they use Flash lite 1.1, using Flash 4, not flash 5 thats why my scripts aren't working..
Website Version: 1.0.4
© 2025 Max Games. All rights reserved.