Flex - why aren't these methods found on my Date objects?

I am trying to compile some example actionscript code. In Flex (Flash Builder 4.6), I imported the project folder (these are PurePDF examples).

In several places I have a yellow "?" icons when viewing the source files - although there are no warnings or errors for them yet (I have other errors that I am addressing).

This is an example - when I find "?" icon, I see access to the undefined property getTime:

end_time = new Date (). getTime ();

Another says the undefined property getStackTrace ()

catch (e: Error) {trace (e.getStackTrace ()); }

I cleared the errors I mentioned, and those yellow "?" while viewing the code, labels still appear. There are no warnings or errors in the problems window, but these question marks, which I describe, still exist. Even if I close the file and clean up the project and open the file again.

+4
source share
2 answers

He is throwing a problem with Falsh Builder. In any case, to handle this, use:

new Date().time 

instead

 new Date().getTime() 
0
source

getTime () - method of the Date class; getStackTrace () is a method of the Error class.

Make sure you import these two best classes:

 import Error import Date 
-2
source

Source: https://habr.com/ru/post/1391102/


All Articles