How To Get System Date Or Month?
Hi all,
As i was browseing thourgh tutorials in this site i came across
one wonderful tutorial "Analog clock" and i did that successfully.
But now if want to show current month, date, and year also with it
how i will do it?
As i am not much actionscript master can some explain why i have to write .time everytime to get seconds, minutes, and hours to track system time?
the code is somthing like:-
time = new Date();
mil = time.getMilliseconds();
s = time.getSeconds();
m = time.getMinutes();
h = time.getHours();
and if i try the same code without copypaste from tutorial it dose not take .time but just a .getSeconds()then how a newcomer like me will understand significance of .time why its requide (i mean the function for it)
Thanking you in advance
Bhushan
FlashKit > Flash Help > Flash ActionScript
Posted on: 11-26-2002, 05:01 AM
View Complete Forum Thread with Replies
Sponsored Links:
Add Month(s) To A Date
Hi,
I am trying to add month(s) to a date using the calendar component in flash. Basically someone needs to enter an startdate, and I want flash to calculate the expiredate based on a variable 'duration'.
so far I have:
duration=6;//Nr of months to add
calendar1.setChangeHandler("getdatum");
function getdatum()
{
theYear = Calendar1.getSelectedItem().getFullYear();
theNumber = Calendar1.getSelectedItem().getDate();
theMonth = (Calendar1.getSelectedItem().getMonth())+1;
mysql_startdate = theYear+"-"+theMonth+"-"+theNumber;
//mysql_expiredate=???????
}
Anyone an idea?
greetings
Patrick
View Replies !
View Related
Last Date Of Month
ok, so i'm programming a dynamic asp driven calendar in flash, got the code down to create the dates starting at the appropriate day of the week, but i've no idea how to find out how many days are in my (dynamic) month...
any ideas??
View Replies !
View Related
Date To Pick The Month
Hello all,
I have a button that when I click it. It brings me to my callander page. Well I have created he Entire years callander and would like to be able to go to the correct month. How can I use the date function in the action of the button to take me to he right frame.
Old day programe I would say if Month = December then goto 1. else if Month = January then goto 2 else if.....
Anyone hae any clues would be realy helpfull instead of having to changethe calander section on a monthly basis.
Thanks,
Attila GnA
http://server40.hypermart.net/gna/
View Replies !
View Related
Date() Comes Up With Wrong Month
Hi,
I'm customizing a game for a client and they sent me the following code to submit the time to their server:
Code:
var d:Date = new Date();
var mm = (d.getUTCMonth()<10)?'0'+d.getUTCMonth():d.getUTCMonth();
var dd = (d.getUTCDate()<10)?'0'+d.getUTCDate():d.getUTCDate();
var hh = (d.getUTCHours()<10)?'0'+d.getUTCHours():d.getUTCHours();
var ii = (d.getUTCMinutes()<10)?'0'+d.getUTCMinutes():d.getUTCMinutes();
var ss = (d.getUTCSeconds()<10)?'0'+d.getUTCSeconds():d.getUTCSeconds();
var utcdate = (d.getUTCFullYear()+'-'+mm + '-' + dd + 'T' + hh + ':' + ii + ':' + ss + 'Z');
trace(utcdate);
This traces out the following: "2007-06-05T00:28:55Z"
It's coming up with the wrong month, June! It should be July (2007-07-05T00:28:55Z)
Does anyone know what's going wrong here?
Thanks
View Replies !
View Related
Simple Date (month) Question...
hi...i know i've seen this question in here before (somewhere), but can't seem to find it now that i need it.
here's the deal...
my month is coming back 1 month behind (so it reads as 7 instead of 8)...i know why, but i can't figure out how to add +1 to it...i'm new to the whole variable thing in flash, so if anyone can help i'd appreciate it
thanks
View Replies !
View Related
Live Date And Month (eg. 11 June ) In Flash
Hi There,
Im trying to set up a flash file that will automatically generate the date ( in digits ) and month ( in writing ) based on a users system clock. I was also hoping to use a font of my choice to display these details. Im after something similiar to the following.
http://www.jamesbond.com/bond20/index.php
Ive thoroughly search through the files on this website with no luck. If anyone could help me it would be greatly greatly appreciated!
Thank you,
Alex
View Replies !
View Related
Month/Date Dependent Flash Movie
The task set before me sounds easy - but I haven't found one example or tutorial regarding this.
Basically I would like to set up a flash movie with ten frames. Each frame would be reflective of the date that needs to be shown to the viewer. So for example if frame number 3 was inteneded to be shown to viewers on August 1, 2008. Then the movie goes to that frame and stops - not revealing any of the other frames. If the date is August 15th, then it would go to the fourth frame which is set up to be shown on that particualy date and after. Then on frame 5, it would be for Septemeber 1. Frame 5 would show for 15 days - then it would go to frame six afterwards... and so...
Wow! If anyone could point me in the right direction I would be forever in your debt.
Thanking you in advance.
Jerry ~ Philadelphia, PA
View Replies !
View Related
Wanted: Day, Month Date, Year ActionScript
I can not find a free script anywhere on the internet that will display for me the current date in my Flash MX pages.
I need the date to work in multiple frames and scenes. I have just begun using scripts with Flash, so I really need a complete with training wheels instruction on how to.
Thanks in advance.
View Replies !
View Related
Date Convert Month Number To String
Hi,
I have a text box, where any Date that I choose, from the Datefield, is inserted into. It inserts a date in the format 3/5/07 but I want 5 March 2007. How do I do this ?
The code I have is:
Thanks,
Paul
Attach Code
var dcListener:Object = new Object();
dcListener.change = function(evt_obj:Object) {
var SelectDate:Date = evt_obj.target.selectedDate;
var date_str:String = (SelectDate.getDate()+ "/" +(SelectDate.getMonth()+1)+"/"+SelectDate.getFullYear());
//BELOW INSERTS DATE INTO TEXT BOX
date_txt.htmlText = true;
date_txt.htmlText = date_str ;
};
my_df.addEventListener("change", dcListener);
View Replies !
View Related
Desktop Background Depending On Date And Month.
I am trying to create a little program in flash that will load a specific picture depending on what day it is and what month.
All the different picture swfs are named depending on date/month eg. Jan01, Dec15. (These will load into a blank container whenever called upon).
The only problem I am having is the actionscript to actually make this work. I have searched the forums for all kinds of things like getDate, getMonth etc but haven't found anything that seems to do the job.
Would it be possible for someone to help me with the coding?
Thanks.
View Replies !
View Related
Date Class Giving Wrong Day And Month Info
ActionScript Code:
function getTheDate ():void
{
var now:Date = new Date();
trace ("Year: " + now.getFullYear());
trace ("Month: " + now.getMonth());
trace ("Day: " + now.getDay());
trace ("Hour: " + now.getHours());
trace ("Minute: " + now.getMinutes());
// My trace is the following:
/*
Year: 2008
Month: 3
Day: 4
Hour: 9
Minute: 7
*/
// Day and Month are screwed up.
// Real info is: April 10, 2008 9:07 am.
// So my trace SHOULD have been:
/*
Year: 2008
Month: 4
Day: 10
Hour: 9
Minute: 7
*/
}
Why?
View Replies !
View Related
Can Flash Read Text File And System Date?
Flash newbie, way newbie here. I am working on a project where I need a swf file to read a parsed text file, and based on the system date, place text into the swf to be viewed. Is this possible, how do I go about it.
The end result is to have a flash movie that will run content for a year (365 entries in file). Other wise I am going to have to create 365 different ones.
Hopefully this made sense and is doable.
Thanks in advance
Example file with two entries
07042002~The Brave and the Bold~
07052002~The Stupid and the Clueless~
View Replies !
View Related
Convert RSS2 Date Format To Flash Date() Object
How can I take an RFC 822 (RSS 2) formatted string, and read it into a Flash MX Date() object. Flash does'nt like the format.
I have a function that will break the string apart the long way but is there an easier way to accomplish this - I can't believe flash would'nt have it built in like .NET or ColdFusion.
Thanks!
Aaron
View Replies !
View Related
Comapreing A Datefield Selected Date To Current Date
i have a made a small swf which checks the seleted date on the datefield component is passed current date or not...
i have a function get the day associated with it...
stop();
function getDayName(num) {
switch (num) {
case 0 :
return "Sunday";
break;
case 1 :
return "Monday";
break;
case 2 :
return "Tuesday";
break;
case 3 :
return "Wednesday";
break;
case 4 :
return "Thursday";
break;
case 5 :
return "Friday";
break;
case 6 :
return "Saturday";
break;
}
}
today = new Date();
today = getDayName(today.getDay())+" "+today.getMonth()+" "+today.getDate()+" 00:00:00 GMT+06000 "+today.getFullYear();
on relese event of the button...
dateField is named - arr_date
on (release) {
_global.selday = _root.arr_date.selectedDate;
_global.selday2 = getDayName(_global.selday.getDay())+" "+_global.selday.getMonth()+" "+_global.selday.getDate()+" 00:00:00 GMT+06000 "+_global.selday.getFullYear();
res = (selday2<today);
_root.dis = res;
}
the thing is sometimes res says "TRUE" for future dates also.
download fla here
can anyone help on this.
Thanks
View Replies !
View Related
Display Date And Day With Computing Three Days From The Date With Certain Restriction
Hi
i have a code that display date and day from your local machine.
Here it is:
================================================== ===========
function howlong(arg) {
if (length(arg) == 1) {
arg = "0"+arg;
return arg;
} else {
arg = arg;
return arg;
}
}
myDate = new Date();
//hr = howlong(String(myDate.getHours()));
//mnt = howlong(String(myDate.getMinutes()));
daytext = myDate.getDay();
//daytext = daytext+3;
dd = myDate.getDate();
//dd = dd+3;
mm = myDate.getMonth();
//yyyy = myDate.getFullYear();
switch (daytext) {
case 0 :
daytext = "Sunday";
break;
case 1 :
daytext = "Monday";
break;
case 2 :
daytext = "Tuesday";
break;
case 3 :
daytext = "Wednesday";
break;
case 4 :
daytext = "Thursday";
break;
case 5 :
daytext = "Friday";
break;
case 6 :
daytext = "Saturday";
break;
}
switch (mm) {
case 0 :
mm = "Jan";
break;
case 1 :
mm = "Feb";
break;
case 2 :
mm = "Mar";
break;
case 3 :
mm = "Apr";
break;
case 4 :
mm = "May";
break;
case 5 :
mm = "Jun";
break;
case 6 :
mm = "Jul";
break;
case 7 :
mm = "Aug";
break;
case 8 :
mm = "Sep";
break;
case 9 :
mm = "Oct";
break;
case 10 :
mm = "Nov";
break;
case 11 :
mm = "Dec";
break;
}
textdate = (daytext+", "+mm+". "+dd+".");
================================================== ===========
Now problem is it should compute three days from that date with certain restrictions like (dont count Saturday and Sunday, Dec 25th, Nov, 22nd, Jan 1st)...
I have to display the date based on the above rules..
plz help
Thanks
maxarindam
View Replies !
View Related
What Does System.capabilities.language Return On Your System?
I am working on a multi-lingual web site that automatically detects the user's OS or browser language by using System.capabilities.language .
Since I am running a german OS/browser, this returns 'de' in my case, but I wonder what it returns on other systems (english, french, spanish etc.)
To find this out, please copy and paste this code into a Flash doc and see what it says:
trace( System.capabilities.language );
Thx!
Mike
View Replies !
View Related
Get Month
when I use get month it returns an integer of 00 for jan and 11 for dec.
How do i get it to display jan as 1 and dec as 12 in other words how would i add 1 to the month integer.
Here is an example of the code used.
mydate = new Date( );
code = mydate.getFullYear() + "/" + mydate.getMonth() + "/"
+ mydate.getDate() + "-" + mydate.getHours() + ":"
+ mydate.getMinutes() + ":" + mydate.getSeconds()
Thanx in advance !!!!!!!!!!!!!!
Heebi
View Replies !
View Related
Month, Month, Month
Me again!
Interesting little question I have.
Is there a script of some sort in which a can tell flash to play a different frame each month? Meaning, I have 12 frames, flash checks what month it is (e.g. March) and then go to frame 3.
Any suggestions?
View Replies !
View Related
DATE() Reads Date From Server Or User?
2 questions about DATE() function:
1º The value is taken from the date setted on the server or the user machine?
2º How do i break apart the value to check each value? I mean, day, month, etc.
Im working on a quiz that has to display a different question every 15 days. Im loading them from a TXT. I´m missing that part of the code.
Thanks for any help.
View Replies !
View Related
Flash MX: Date To String And Back To Date
Greetings,
Im struggling to (a date which is converted to a string to format date as mm/dd/yyyy hh:mm:ss") transform the string textDate into a Date?
Im looking at mxateFormatter but I dont understand how it works
Any advice and guidance would be appreciated.
Cheers
Rob W
Code:
displaydate = new Date();
var day = displaydate.getDate()>9 ? displaydate.getDate() : "0"+displaydate.getDate();
var month = displaydate.getMonth()+1;
var years = displaydate.getFullYear();
if (month <9)
{
var month = "0"+month;
}
displaydate = (month + "/" + day + "/" + years);
timedisplay = new Date();
var hours = timedisplay.getHours()>9 ? timedisplay.getHours() : "0"+timedisplay.getHours();
var minutes = timedisplay.getMinutes()>9 ? timedisplay.getMinutes() : "0"+timedisplay.getMinutes();
var seconds = timedisplay.getSeconds()>9 ? timedisplay.getSeconds() : "0"+timedisplay.getSeconds();
timedisplay = (hours + ":" + minutes + ":" + seconds);
_root.textDate = (displaydate + " " + timedisplay)
View Replies !
View Related
Bad Data From Date.getDay() And Date.getMonth()
I am trying to utilize the Date class to retrieve the current date, and populate fields for each date part. However, the day and month returned from either the day/month properties or the getDay()/getMonth() methods are incorrect: today is 4/11/2008, yet I get back a month of 3 and a day of 5!
Here is the relevant code:
var curDate:Date=new Date();
NewProjectStartMonthField.text=String(curDate.getMonth());
NewProjectStartDayField.text=String(curDate.getDay());
NewProjectStartYearField.text=String(curDate.fullYear);
View Replies !
View Related
Comparing Current Date With Date String
Im loading in a date from a database and storing it in a string called dateToCheck. The dates I am loading in from my datebase could be anything so I want to check if its past, present or future but as its a string and not a date when I compare to the current date it doesn't seem to work.
Im storing the current date in actions script like this
var today_dateate = new Date();
var date_str:String = (today_date.getDate()+"/"+(today_date.getMonth()+1)+"/"+today_date.getFullYear());
Do I need to convert the value date value Im loading from my database into a proper date before I can check it agains the current date? If so is there any easy way of doing it.
Thanks
View Replies !
View Related
Determining 1st Day Of Month
Hello All,
Does anybody know how to determine what day of the week the first day of the month is on??
ex:
For August 2001 - Wednesday
I need to find a script that determines this.
(for any month, and any year in the future)
I think it needs to have something to do with
Code:
mydate = new Date();
curmonth = mydate.getMonth();
Then another date object set to the first day of the current month that was just detected.??
Thanks in advance!
View Replies !
View Related
Anyone Else Get The Wrong Month?
Not July 24.
I have this script in my movie:
mydate = new Date();
myvariable = mydate.getMonth()+"/"+mydate.getDate()+"/"+mydate.getFullYear();
I have put mydate = new Date (); as an expression
Everything comes out fine and it shows up as a properly formatted date. The only thing is, it shows a 7 instead of 8 for the month. I used SSI to check the date on my server, which shows 8. My computer's clock shows 8, but for some reason my flash shows 7. Am I missing something?
Thanks!
~!/
[Edited by TheTableist on 08-24-2001 at 09:58 AM]
View Replies !
View Related
New Picture Every Month
Actionscript.
Object date.
Windows date.
When is January i want to display picture for January.
(for example: _root.january.gotoAndPlay(2))
When is February i want to display picture for February.
When is March i want to display picture for March.
How can i do it?
View Replies !
View Related
Hi This Is My Second Month With Flash
Dear all,
I have been using flash now for two months and wanted to show any newbies like my self what is possible after only a couple of months and flash kits help.
My site is a university project for my year in russia.
Its url is
http://uk.geocities.com/ruslangallery
I hope this inspires as i am so happy to have got this far.
2 months ago i knew nothing and hoped for a nice text site and maybe a few thumb nails then i found out about flash and flash kit and have really enjoyed it.
If i should not have posted my url sorry and please delete posting.
yours
christopher.
thanks to kamyab he helped to set up the recommend to a friend PHP form. A real boost to the site.
I'm off to the coolsites forum (find it on the drop down menu) to be inspired
View Replies !
View Related
Month Problems
HI
im using the following script to get the month and date, im having a slight problem in th at the script returns the wrong month, it returns the month one in front. I can't see my way round this any help please
onClipEvent (load) {
mon = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Oct", "Nov", "Dec"];
weekdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
}
onClipEvent (enterFrame) {
now = new Date();
nDay = weekdays[now.getDay()];
nMonth = mon[now.getMonth()];
nDate = now.getDate();
nYear = now.getFullYear();
displayDate = nMonth+" "+nDate+", "+nYear;
displayDay = nDay;
}
ps flash mx
View Replies !
View Related
DAy Month Year
I just want to make a simple 'thing' that shows the day, month and year. Is this possible without going code crazy .. i just need some ideas..
I appreciate the help.
Thanks
Peter
View Replies !
View Related
Go Back 1 Month
Hi all, I searched around, and to be honest, I don't know if I read the answer to my ?
I have an array with day, month, all works fine.
I am making a calendar that pages will be torn off. Starting with 10 days prior to the current date.
So, easy:
code:
thaDay.text = currentDay[today.getDay() -1];
and so on.
But if I do the same for month:
code:
thaMonth.text = currentMonth[today.getMonth() -1];
I get the ol' UNDEFINED
I don't know where I am going wrong. Silly me thought I could just subtract like I could days/date.
View Replies !
View Related
Month To Varaible
Can anybody look into this.
A function gets the current month name whenever it is called and then tries to load a file with that name using loadvaraibles or loadvars
eg.
its september now so the movie tries ot load
september.txt.
View Replies !
View Related
Change BG Every Month HELP
I am trying to get a background to change every month
I got a code at http://www.flashkit.com/movies/Compo...0543/index.php
I modified this code and I think it will work but I do not know too much Action Script
Can some one PLZ help me put a If statement so on December it goes to frame 2 else go to frame 13
Quote:
myNow=new Date();
myMonth=myNow.getMonth();
theMonth=new Array("January","February","March","April","May"," June","July","August","September","October","Novem ber","December");
theDate=theMonth[myMonth]
if (myMonth=December)
{
gotoAndStop(2);
}
else
{
gotoAndStop(13);
}
View Replies !
View Related
Play By Month?
I want to make a banner with the monts of the year, eatch month on a specific frame and want the movie to see wath month it is and play its frame
so far the code looks like this bt it dosen't work
var luna:Date = new Date();
trace(luna.getMonth());
C = luna;
for (var C:Date = 0; C<11; gotoAndStop(C+2)) {
}
can someone help me
major newbie so be explicit pls
View Replies !
View Related
[F8] Finding First Day In A Month
Hey, I'm having trouble finding the first day of a given month.
The big problem I'm having, is that (inside my function), when I set the year and month to the desired values, calling a .getDate(); function just reads local time.
I'm guessing that I'm going to have to come at it from a completely different direction, so any ideas would be great.
Heres my code:
Code:
// Function to discover the first day of the desired (des) month and year
function getFirstDateNumber(des_month:Number, des_year:Number) {
var date:Date = new Date();
var year:Number = date.setYear(des_year);
year = date.getFullYear();
var month:Number = date.setMonth(des_month);
month = date.getMonth();
var day:Number = date.getDay();
var datenum:Number = date.getDate();
return(day);
}
What if I tried using a .setFullYear() to the desired month, year, use the last date number, run a .getDay(), and iterate backwards until I hit 1.
I'm thinking that the date would still retrieve from local time....
Thanks,
Echo Gen
View Replies !
View Related
Month Messes Up
code//
time=new Date(); // time object
var seconds = time.getSeconds()
var minutes = time.getMinutes()
var hours = time.getHours()
var month = time.getMonth()
var date = time.getDate()
if (month=1) {
month = "January";
}
if (month=2) {
month = "February";
}
if (month=3) {
month = "March";
}
if (month=4) {
month = "April";
}
if (month=5) {
month = "May";
}
if (month=6) {
month = "June";
}
if (month=7) {
month = "July";
}
if (month=8) {
month = "August";
}
if (month=9) {
month = "September";
}
if (month=10) {
month = "October";
}
if (month=11) {
month = "November";
}
if (month=12) {
month = "December";
}
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_txt.text = month + " " + date + " " + hours + ":" + minutes + ":" + seconds +" "+ ampm;
//code
View Replies !
View Related
|