28 Days Later.
hey guys id just saw the 28 day later site. very cool !!!!!! 28 later and I want to know how to make that grunggy layout. and does cool buttons. so if someone knows something please ! Thanks.
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 08-26-2003, 09:02 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Please Help, I've Only Got 2 Days Before This Is Due
Hey everyone. So I'm down to the very last revision of a site I'm designing, and they want to change the infinite menu to use left and right buttons that you rollover to make the menu scroll left and right, rather than where the mouse is to make the thing scroll.
How do I translate this...
onClipEvent (load)
{
xcenter=400;
speed=1/20;
}
onClipEvent (enterFrame)
{
var distance=_root._xmouse-xcenter;
_x+=(distance*speed);
if (_x > 0) _x=-800;
if (_x < -800) _x=0;
}
...onto a left and right button that make it scroll the appropriate direction?
Could use this asap.
Thanks a ton
Evan
Days, And MovieClips
I'm making a homepage for my self, and i want to do this:
if it's monday, the intro specially made for monday opens.
if it's tuesday, the intro for tuesday opens.
That's it....help me, please...
-3DeMON
Count Days?
please help me I don't know how to use textfield to show how many days have passed since a specific day in a past.
Thanks
Counting The Days Up To 365
How can I count the days from 1 - 365? In other words:
January 15 would return 15
February 15 would return 46
March 1 would return 60
etc.
Then next January 1st it starts all over again.
Thanks!
3 Days And No Progress, Please Help Me
I downloaded a guestbook from another site and it worked perfectly in it's own site.
GuestBook Sample
The same site I downloaded it from told me that it worked just as well in any level or mc. Here is what I got when I loaded it into a blank mc. This is only a test to see if it worked.
GuestBook test inside a blank mc
There are tons of people on the site that I downloaded it from that say it works fine, what am I doing wrong?
Here are the files I made for each of these tests. Please, someone download them and tell me what I'm doing wrong, I can't take too much more of this.
dowload guestbook.fla
Download the test which loads the guestbook into a blank mc
I'm Gonna Cry - Trying For Days
Hello
I have a very simple Flash animation that I need to do and I CANNOT figure out something.
I have some text that will be placed over an image - the text needs to fade in and then stay somewhat transparent over the image. It also need to glow or have some type of shadow to make it stand out a bit oer the photos (like a gray glow around transparent text). Anyway, for the life of me I cannot figure out how to do both I can create the transparency - but then when I create the glow using soften edges - it changes the color/transparency of the text.
I'm not one to give up easily - but you are my last shot!
Thanks in advance to any help you can offer!!!!!!
C
Help Dissertation Due In Two Days
I'm currently trying to create an interactive chemistry simulation as part of my degree but have been having problems with the functionality of the system for some time. All I want to do is allow a user to select an item, drag it to a work area, drop it and then an animation play to show something. I thought it would just be a case of when dropped, using a gotoAndPlay command but cannot get it to play the main timeline of the scene, it either plays the timeline of the object (which is nothing) or the first scene of the movie. I have tried _root and _parent and even using the name of the current scene to reference the timeline but with no effect. What I want is to place all the animations on the main timeline and gotoandplay the start of each relevant animation when an itme is dragged and dropped.
Please help me!
I've Been Using Flash For 2 Days, Plz Help Me
Hi everyone.
I'm a student and I recently started website design from home. I知 more then just newbie but besides that I致e learnt several things from tutz ect, although I知 still confused about 95% of what I have learnt.. I need more help.
First of all, I need to know where to start. I知 planning on making an animated website but I don't know how to make movie clips
1) Where do I start?
2) How do I make movie clips which have a lil animation while it痴 loading with the status bar thing which goes from 0%-100% with the modifications I like?
3) Can you also please tell me how and where to start, from this example website, if I wanted something very similar what would I have to do to get started, don't waste to much time on me just tell me briefly and I will try to figure it out. This is the example website http://www.freewebs.com/ogunstudios/ which would give you an idea of what i have in mind for my site. Thank you very
My Thesis Is Due In Two Days HELP
I've constructed (attempted to construct) a flash movie to describe Dante's Inferno to a generation of visual learners for my Thesis Project in Visual Communications. I'm running into problems with the rollovers.
Please check out:
http://www.phatcity.org/dante
to view the problem. I have set up several actions like this:
<MovieClip>.onRollOver = function() {
<instance>.gotoAndPlay("framelable");
};
<MovieClip>.onRollOut = function() {
<instance>.gotoAndPlay("framelable");
};
but onRollOut, the MovieClip jumps to the framelabel of the next action, rather than completing it's current action and then proceeding to its next destination.
Can someone please help me out? I'm looking for a fairly easy method as I have VERY LITTLE TIME LEFT to work on this bad boy. Thanks so much! -jordan
Calculating How Old I Am In Days
Hi everyone,
i have a problem it just got bigger than i thought... how would i acurately calculate my age in days from a function?
because i was doing calculations using: getMonth() - birthdayMonth
but then what if my birthday month is smaller than the current month, then i am not that whole year older than i am supposed to be as it becomes negative and the days that i am counting get messed up... heres some code i've done, its acurate to year and month, but the days are a bit dodgy:
myDate = new Date();
yyyy = myDate.getFullYear();
mm = myDate.getMonth();
dd = myDate.getDate();
born = parseInt(_root.gk_year);
trace("born year: " + born);
born_m = parseInt(_root.gk_month); parseInt
trace("born month: " + born_m);
born_d = parseInt(_root.gk_day);
trace("born day: " + born_d);
age = 365*(yyyy-born);
function month_checker(arg) {//arg is the current month
if (arg > born_m)
{
age = age + ((mm - born_m)/*-1*/)*30 +30 + dd;
return age;
}
if (arg < born_m) //if current month is smaller than birth_month
{
age = (age - 365) + (12 - (born_m - mm))*30 +30 + dd; //seems to always be 30 short so +30.
return age;
}
}
thanks
183 Days Calculation
I知 new so I知 Justin. In my epic battle between a Lotus Notes developer and my attempt to transition to HTML and Flash I have ran into a problem. In our current database (in Lotus Notes) there is a 183 day calculator for someone who tested. You put in their test date and get the date they can retest. Is it possible to do the same in flash? Could someone show me how please?
Is Break; Useful These Days?
Hello,
Why would a person use the break command these days? It seems there is nothing it does that loops can't do more efficient ways.
Is there anything it can do to make my life easier? When would be a good occasion to use it?
Thank-you!
-Jen
I've Been Stuck On This For Days
i have attached a link to some files in hopes of getting help.
http://www.garyhush.com/post/projectFolder.zip
trouble.fla is the main document and sOne.fla is a swf that loads into it.
the pink button in sOne.swf gives me this error
Error #1009: Cannot access a property or method of a null object reference.
at sOne_fla::MainTimeline/onClickz()
my goal is to move all the thumbnail buttons into a swf similiar to sOne, and therefore be able to show more images, different groups of images, by selecting groups of thumbnails to load onto the stage.
otherwise is is basically ready to get the job done.
2 Days Research Still No Joy
Hello everyone.....first time at this.
Here's the thing.
I have a main movie...(it's a music player...works from loading ext swfs..)
What I need to do is make the loaded swf affect the frame position of my main movie..the reason ?
When you click on a button it fires up an ext swf (song sample) and moves the frame position on the main movie to show the name of the track.....
The ext swfs will (if you leave them to play) load up the next swf....but this is not changing the name of the track...because I can't work it out.....
Thanks for your time all....
p.s. I have tried using the connection class...but to no avail as yet....and also the code _root.gotoAndPlay() etc.
ta.
Days Left Until..
Im trying to do a script that tell how many days is left until a specific date.
Ive come this far:
today = new Date(today.getYear() + 1900, today.getMonth(), today.getDate());
today = today.getTime();
thedate = new Date(2004, 7, 7);
thedate = thedate.getTime();
then something like:
daysleft.text = thedate - today;
but that returns: "NaN"
Days Countdown
Hi there
I would like to put a countdown on a flash header that I am creating. It's basically counting down the days until christmas. Could someone point me to a tutorial or help me out?
Thanks
Days Countdown W/ Xml
Hi all I found this code in this forum for a countdown to days:
Code:
var end_date = new Date(2007, 11, 7);
var tmp_date = new Date();
var now_date = new Date(tmp_date.getFullYear(), tmp_date.getMonth(), tmp_date.getDate());
var difference = end_date.getTime()-now_date.getTime();
var daysleft = difference/1000/60/60/24;
this.createTextField("daysleft_txt", 0, 0, 0, 0, 0);
daysleft_txt.autoSize = "left";
daysleft_txt.text = !daysleft ? "Tonight!" : daysleft+(daysleft>1 ? " Days!" : " Day!");
daysleft_txt.setTextFormat(new TextFormat("Verdana", 10));
It works excellent i was wondering if there was a way to do something like this but have it access an xml file for the new Date(); Basically i want the ability to change the date without having to go into the FLA everytime. Any direction would be greatly appreciated.
thanks,
faubus
2 Days Research Still No Joy
Hello everyone.....first time at this.
Here's the thing.
I have a main movie...(it's a music player...works from loading ext swfs..)
What I need to do is make the loaded swf affect the frame position of my main movie..the reason ?
When you click on a button it fires up an ext swf (song sample) and moves the frame position on the main movie to show the name of the track.....
The ext swfs will (if you leave them to play) load up the next swf....but this is not changing the name of the track...because I can't work it out.....
Thanks for your time all....
p.s. I have tried using the connection class...but to no avail as yet....and also the code _root.gotoAndPlay() etc.
ta.
Days Left Until..
Im trying to do a script that tell how many days is left until a specific date.
Ive come this far:
today = new Date(today.getYear() + 1900, today.getMonth(), today.getDate());
today = today.getTime();
thedate = new Date(2004, 7, 7);
thedate = thedate.getTime();
then something like:
daysleft.text = thedate - today;
but that returns: "NaN"
Days Countdown
Hi there
I would like to put a countdown on a flash header that I am creating. It's basically counting down the days until christmas. Could someone point me to a tutorial or help me out?
Thanks
Days Between Dates
I need to find out how many days exist between any 2 dates. In the F5 section of the tutorials here at UltrasShock there is a Date Object tutorial with this an example using the days between now and Christmas.
Code:
now = new Date()
xmas = new Date(2001, 11, 25, 0, 0, 0, 0 )
howlong = xmas-now
It can't possible be this easy considering the different amount of days in months, leap years, etc, etc or is it?
Thanks in advance.
Calculate Days In Month
Hi all, I am putting together a calendar using AS and need to calculate the days in any given month - my function is unreliable - sometimes right sometimes wrong!
function countDays(theDate)
{
thisYear = theDate.getUTCFullYear();
thisMonth = theDate.getUTCMonth();
nextMonth = new Date(thisYear,thisMonth+1);
lastDay = new Date(nextMonth.getTime() - oneDay);
return noOfDays = lastDay.getDate();
}
Any ideas??!
Thanks,
The Forgotten Days Of Trig
in action script i want the code to turn the SIN of an angle back into an angle value, it's the inverse SIN i think
Can anybody help me out here
[Edited by multichild on 06-20-2002 at 11:06 AM]
Three Days Of Sound Frustration
i am trying to create a flash movie (in flash 5) that is a simple a graphic with start and stop buttons and music playing (a loop).
THE GOAL
-a flash movie that automatically opens in a pop-up window as my home page loads. (homepage is not flash)
-the music starts playing automatically.
-play and stop buttons
-the music fades in when play is pressed, fades out when stop is pressed.
also want to create a pre-loader as the music loads (haven't gotten there yet but just so you know)
SO FAR
i've gotten the music to start playing automatically,(by either attaching a sound object or creating a separate movie clip)
with the sound object i can get it to fade out but it won't play. with the movie clip it won't play or stop.
i've found tutorials that help me with bits and pieces of what i want but nothing that puts all the elements together...my head hurts...please help!
thanks a bunch
Finding The Days Between Two Dates
Basically I want flash to output the number of days between today and a date I specify, like "was 7 days ago" I don't want hours, weeks, minutes or any of that just the pure day. I've tried a few of the examples posted round this forum but always get really bizarre results back.
Thanks in advance
Buttons Urgent Due In 4 Days :o
ok heres the problem i have 7 buttons and when the page loads it automaticalley keeps like loading the buttons like its weird ok heres whats supposed to happen , it loads ya that stuff, then when u click on the button it goes to a diff. part of site SIMPLE enough but, it's doing that w/o clicking so i lik freezes the computer and like keeps reloading diff. parts of sites its on
on (release) {
getURL("main.html");
}
ANY HELP PLEASE AND THANK YOU
: crazy:
PPPPLLEAAZZZ SOMEONE ANSWER ME CAUSE I SEE PPL COME BUT NO ONE ANSWER PLLLLLEEAAAZZZEE
That code was placed , not inside it when u dbl clik to edit the up down over , but single click on the button and then i entered it in actions
Whats With The HitTest These Days?
Hi,
ok, I have a block (movie clip - with an animation inside).
What I am trying to do is a hitTest in the block which will , on rollOver, make it animate from a certain frame and, on rollOut, animate from a certain frame.
My problem is that its not working, just doing wierd things!!
Please check out my .fla
Any help much appreciated
Thanks
Chris
[F8] Stuck For Days :( AS 2.0 Tint
I have been stuck for days on an actionscripted tint function, basically
when a radio button is selected and then a filter button pressed to changes
objects on a map to a different tint but as soon as i move frames it drops
all the tints.
if anyone has a spare moment could you look at my fla file i will have to email it because its 1.15mb. so if you could post your email it would mean the world.
thanks
So I Think I've Just Wasted Four Days Of My Life
I've just spent 4 days redesigning my web portfolio site and now just found out that you can no longer use the getURL command to make a simple link to a web site!!!!!
Is there a way around it? Or shall I just fire up Dreamweaver and start again in HTML!!
Leroy
So How Strong Is Flash These Days
Hi all,
What's your oppinion on the strength of Flash these days, i mean compared to .net/java/ruby/haxe/php etc... i mean it's the only decent way we can animate someting cool on the web, 97,7% of all desktops has the flash player plugin installed) and it has major programming capabilities.
But i can read and write files with flash, even write a complete engine if i would like to, and even animate my website wherever i need to, this is not even close to posible on .net or php, java could do animation but isn't that stable imo.
Not even speaking on the new technologies like flex, but that's where my technique knowledge stops, can't know everything these day's
So what's your thought on this...
Let us know..
Calculating Days With An Arrray?
I'm creating a countdown event program where I'd like to calculate the remaining days until a given date. I grab the current date in a new date object, and the target date in separate variables.
My next challenge is calculating the actual days left. I tried to store the number of days in each month in an array. I would think that this would be the best way to pull the days. I take the start month and the end month and then use the number of months as an index inside the array. so I would pull numbers such as (30, 31, 30). Then subtract the days remaining from the start and endmonths to get the number of days. How would you go about adding up these values from an array?
-Jared
Lock Btns On Certain Days
Hi,
I need to create a little microsite that has buttons that ONLY become available on certain days. Basically customers need to return each day to click on the next btn to see what's available but it's really important that certain button only become active at precise times and days.
A really crap way to create this would be to create a different .swf for each day and upload that making a new btn active in each new .swf file. However I would really like to do this in actionscript so if I can get some pointers I would like to figure this one out!
Thanks guys!
How To Add 7 Days To My Date Object?
i created a DATE object.
Code:
var myTime:Date = new Date(2008,9,19,12,0,0);
now I would like to add 7 days to myTime.
do I need to convert myTime to milliseconds?
how can I do this?
please help me!
P.S. Im using AS 3.0
Calculate Difference In Days Between The
Hi, I dont have the code on this laptop but can post it up once I get home, if needed. But until then, what i can do is try and explain...
Im trying to create a function which can calculate the number of days between the occurance and re-occurance of a specific value in an array element.
Example;
Code:
allDraws = new Array("year", "month", "date", "n1", "n2")
If that was my complete array structure and Ive added a 100 or so records. I need to search through "n1" for specified value, so for example say I want to search for occurence of 5. Starting from allDraws[0] I need to find the value that matches 5 in allDraws[n1]. Which I can do and also
can find the number of days from the start to the first occurence of that value. From then the number of days from the first re-occurance to the second re-occurance and so on for as long as that number appears in allDates["n1"].
I can find the number of times 5 appears in "n1" and list all the dates using a for loop - a trace would look something like...
5 has been drawn 3 times
5 was drawn 2004-10-12
5 was drawn 2004-10-17
5 was drawn 2004-10-24
What I CANT do is get flash to trace the difference between those dates. I found a little function in the library...
Code:
today = new Date(2004, 1, 2);
tomorrow = new Date(2004, 2, 2);
todayMS = today.getDate();
tomorrowMS = tomorrow.getDate();
trace((tomorrow-today)/(1000*60*60*24));
I guess I somehow need to mix this equation with my trace. I need to state a start date and then get the date values to update as the for loop runs returning the number of days, maybe giving me a trace like...
(lets assume my start date is (2004-10-02)
5 has been drawn 3 times
5 was drawn 2004-10-12 / = 10 days since start
5 was drawn 2004-10-17 / = 7 days since last drawn
5 was drawn 2004-10-24 / = 7 days since last drawn
any ideas?
Countdown Timer DAYS Only
Hello
I've been trying to make a countdown timer that displays the DAYS only. I've been following the tutorial here
http://www.kirupa.com/developer/mx/countdown.htm
Only problem is, I cant figure out how to do this with only the date changing every day without also including the seconds.
Basically, the end date is DEC 7th.
So, starting today, that is 17 days. ON the 7th, it needs to say TONIGHT. Also, on the last day, it needs to say 1 DAY instead of DAYS.
One other note: I've decided to do these numbers in Flash as i'm just using simple text without any kind of effect on it. So, i've created a movieclip that just countdowns for each keyframe (and changing on the last day to say '1 DAY' instead of '1 DAYS' and then on the final day, all text changes to TONIGHT)
As much as I've tried to learn from this tutorial, it seems to be different enough to just be too confusing for me. If anyone out there can lend me a helping hand, I would be greatful. Thanks!
Elton
Disable Buttons As Days Go By?
I'm looking to make a countdown flash movie, that will have clickable buttons for days, but i only want the current day to have an active button and as the days go i would like to hit the button(leaving a grey'd out image).
Is anyone awhere of someway to link functionality to a global clock or using some countdown script?
HELP Stuck On A Script For Days.
Hey thanks in advance to anyone who takes a look at this for me and helps me out, cause I've fried my brain trying to figure this out. So I've attached my .fla, and my xml is at the bottom, for you to look at. It's an image viewer, pop in some pics and you'll see what's going on. Problem is I can't get the text from the xml to load in, and I know why, just don't know how to fix it. Had several ideas, but none worked. Best case scenario, I'd just like it to work. But an even better one, would be to work, but to also function as a movie clip and be "attached" to the main photo, as the thumbnails are, and move with the resize. That would be perfect.
Again thanks..
-patrick
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<images thumbs="photos_th" viewers="photos">
<img thumb="picture_th.jpg" viewer_bw="picture.jpg" largura="300" altura="300" desc="Title"/>
<img thumb="picture_th.jpg" viewer_bw="picture.jpg" largura="300" altura="300" desc="Title"/>
</images>
Days Countdown From Txt File
hi all. I'm using this script
Code:
this.createEmptyMovieClip("loader_mc", 0);
loadVariables("assets/flash/splash/deadlines2.txt", loader_mc);
// Variables declaration
year;
month;
day;
desc;
// Check if variables text file are loaded
function varLoaded() {
if (loader_mc.y != undefined) {
year = loader_mc.y;
month = loader_mc.m;
day = loader_mc.d;
desc = loader_mc.desc;
clearInterval(interval);
}
// Then call function to calculate days difference
diffDays();
}
var interval = setInterval(varLoaded, 100);
//
function diffDays() {
var end_date = new Date(year, month, day);
var tmp_date = new Date();
var now_date = new Date(tmp_date.getFullYear(), tmp_date.getMonth(), tmp_date.getDate());
var difference = end_date.getTime()-now_date.getTime();
var daysleft = difference/1000/60/60/24;
desc2.autoSize = "left";
desc2.htmlText = !daysleft ? "<b>> Today" : "<b>> " + daysleft+(daysleft>1 ? " Days</b>" : " Day</b>") + desc;
desc2.setTextFormat(new TextFormat("Verdana", 9));
}
it acts pretty flaky, sometimes it works sometimes i get some weird results.
if i put this:
y=2007&m=2&d=23&desc= Deadline - Mar. 23, 2007
into the txt file i get 23.9583333333333 Days. Which 23 isn't right even. plus i don't need any of those decimals. Any direction would be awesome.
Thanks,
Mike
Desparate Help Is Needed Within Two Days...
I need help....
Now that I admitted that, I really need help...
I have a project due in a couple of days, and I need to know how to parse XML data in a class file. Basically, I need to know how class files work, in respect to variables, looping, etc. . Personally, I have never worked with Class files, and I don't understand the difference between public and private functions, a little explanation, along with example code would be much appreciated.
In case I failed to explain that in english, this is essentially what I need to accomplish, except for in a class file....
Code:
myArray = [];
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (success) {
if (success) {
for (i=0; i<this.firstChild.childNodes.length; i++) {
myArray[i] = this.firstChild.childNodes[i].attributes.name;
}
}
}
myXML.load("path2XMLfile");
obviosly that isn't the exact actions that I will be using, but somthing like that. All I need is an explanation of how class files work etc.
ALSO.......... A much HUGER, BETTER alternative would be to be able to load in .as files, but I am pretty sure that Flash's File I/O is limited, and does not have access to do such things. If it does, please let me know....
So for now, I would just like to know looping, variable assignment (arrays), as well as XML parsing in a class file. I would like to thank anyone in advance, because I may not be on until the first of march.
BTW This project is due on the third.......
[AS2] Floating Days/calculating The Nth Day
Following on from this thread, I thought I'd have a more decent stab at creating a function to calculate floating days. Useful for calculating some holidays that occur on particular days or for calculating when the next pay day is due
nthDay FUNCTION
Calculates the nth day of the month,
e.g. the first Wednesday, the third Friday, the last Sunday, and the third Friday from the end of the month, etc.
ARGUMENTS:
nth - an integer that represents which nth day occurrence to search for, e.g. 1, 2, 3, 4, 5
n.b. A zero value will return the date of the last weekday.
n.b. A negative value will return the nth day counting back from the end of the month.
weekday - day of the week to search for (Sunday = 0, Monday = 1, etc.)
month - month to search in (January = 0, February = 1, etc.)
year - year to search in (1995, 2008, etc.)
RETURNS:
nthDate - new date object for the nth day
error - an error message if the nth day argument is outside the month
ActionScript Code:
function nthDay(nth, weekday, month, year) { var nthDate:Date = new Date(year, month + ((nth <= 0) ? 1 : 0), 1); var dayofweek:Number = nthDate.getDay(); var offset:Number = weekday - dayofweek; nthDate = new Date(year, month + ((nth <= 0) ? 1 : 0), nthDate.getDate() + (offset + (nth - (offset >= 0 ? 1 : 0)) * 7)); if (nthDate.getMonth() <> month) { return "**ERROR ** nthDay (" + nth + ") Out of range"; } else { return nthDate; }}
Sample Use:
ActionScript Code:
trace("Memorial Day = " + nthDay(0, 1, 4, 2008));// outputs Mon May 26 00:00:00 GMT+0100 2008trace("Thanksgiving Day = " + nthDay(4, 4, 10, 2008));// outputs Thu Nov 27 00:00:00 GMT+0000 2008
The function can also be combined with existing date objects, e.g.
ActionScript Code:
today = new Date();trace("Last Saturday in this month = " + nthDay(0, 6, today.getMonth(), today.getFullYear()));// outputs Sat Jul 26 00:00:00 GMT+0100 2008trace("Second occurrence of this weekday in two months time = " + nthDay(2, today.getDay(), today.getMonth() + 2, today.getFullYear()));// outputs Wed Sep 10 00:00:00 GMT+0100 2008 trace("Last but one Thursday in this month = " + nthDay(-1, 4, today.getMonth(), today.getFullYear()));// outputs Thu Jul 24 00:00:00 GMT+0100 2008
The function will also throw up an error message if the nth day doesn't exist within that month, e.g.
ActionScript Code:
trace("Fifth Saturday in this month = " + nthDay(5, 6, today.getMonth(), today.getFullYear()));// outputs **ERROR ** nthDay (5) Out of range
Optional Code:
It's also possible to use optional code to allow for the use of friendlier arguments. Simply add the following code before the function to give you an idea of how it would work:
ActionScript Code:
// Optional code to allow for the friendlier input of arguments var first = 1, second = 2, third = 3, fourth = 4, fifth = 5, last = -1; var firstlast = -1, secondlast = -2, thirdlast = -3, fourthlast = -4, fifthlast = -5; penultimate = -1, antepenultimate = -2, preantepenultimate = -3; var sun = 0, mon = 1, tue = 2, wed = 3, thu = 4, fri = 5, sat = 6; var jan = 0, feb = 1, mar = 2, apr = 3, may = 4, jun = 5, jul = 6, aug = 7, sep = 8, oct = 9, nov = 10, dec = 11;// End of optional code
The optional code allows for the use of friendlier arguments, e.g. The nth arguments (1, 2, 3, 4, 5 and 0) can be substituted with first, second, third, fourth, fifth, and last.
Additional nth arguments (-1, -2, -3, -4, and -5) can be substituted with firstlast, secondlast, thirdlast, fourthlast, fifthlast, or by the technical terms penultimate, antepenultimate, and preantepenultimate.
The weekday argument can be susbstituted with sun, mon, tue, etc.
The month argument can be substituted with jan, feb, mar, etc.
ActionScript Code:
trace("Memorial Day = " + nthDay(last, mon, may, 2008));// outputs Mon May 26 00:00:00 GMT+0100 2008trace("The third from last Tuesday in May was " + nthDay(preantepenultimate, tue, may, today.getFullYear()));// outputs Tue May 6 00:00:00 GMT+0100 2008
The nthDate date object that is returned can be manipulated just the same as any other date object in Actionscript, for example to make it more friendly to read, or to enter into a textfield. Hopefully it will be of use to someone.
How To Add 7 Days To My Date Object?
i created a DATE object.
Code:
var myTime:Date = new Date(2008,9,19,12,0,0);
now I would like to add 7 days to myTime.
do I need to convert myTime to milliseconds?
how can I do this?
please help me!
P.S. Im using AS 3.0
How To Add 7 Days To My Date Object?
i created a DATE object.
Code:
var myTime:Date = new Date(2008,9,19,12,0,0);
now I would like to add 7 days to myTime.
do I need to convert myTime to milliseconds?
how can I do this?
please help me!
P.S. Im using AS 3.0
Countdown Timer DAYS Only
Hello
I've been trying to make a countdown timer that displays the DAYS only. I've been following the tutorial here
http://www.kirupa.com/developer/mx/countdown.htm
Only problem is, I cant figure out how to do this with only the date changing every day without also including the seconds.
Basically, the end date is DEC 7th.
So, starting today, that is 17 days. ON the 7th, it needs to say TONIGHT. Also, on the last day, it needs to say 1 DAY instead of DAYS.
One other note: I've decided to do these numbers in Flash as i'm just using simple text without any kind of effect on it. So, i've created a movieclip that just countdowns for each keyframe (and changing on the last day to say '1 DAY' instead of '1 DAYS' and then on the final day, all text changes to TONIGHT)
As much as I've tried to learn from this tutorial, it seems to be different enough to just be too confusing for me. If anyone out there can lend me a helping hand, I would be greatful. Thanks!
Elton
|