Flex Strangeness Part Two: getTime is not a recognized method of the dynamic class Date

13Oct2008

new Date().getTime() will produce the following warning:

“getTime is not a recognized method of the dynamic class Date”

To fix it, simply do it like this instead:

var myDate:Date = new Date();
trace(myDate.getTime());

Seems like a Flex compiler bug to me. Searching for the error message turned up *nothing* in Google, so I thought I’d add it to their index.

515 Comments

Leave a comment

Remember my personal information

Notify me of follow-up comments?