Using Date Objects in Flash Form (Issue)
Posted on Oct 18, 2005
A coworker of mine brought this issue to my attention. In my tests, you cannot modify a date object created using ActionScript in a Flash form. In his attempts and mine as well, no matter how we manipulate a date, it always comes back with the current date/time. For example:
<cfformitem type="script">
function setItem() {
var theDate:Date = Date(2004,9,1);
alert(theDate.toString());
theDate.setFullYear(1974,7,16);
alert(theDate.toString());
}
</cfformitem>
</cfform>
The first alert will show today's date/time and the second exactly the same. I also tried other methods listed under the date class with the same effect. Perhaps it is because Flash forms disallow the new keyword? Anyone run into this issue? Anyone have a solution?
Comments
It's gotta be something with "new". I'm just trying it in Flash, but if I change your first line to var theDate:Date = new Date(2004,9,1) it works.
Posted By Richard / Posted on 10/18/2005 at 4:11 PM