phân công sẽ playBackTime một giá trị của ( mili giây cho mỗi giây). Đây là đại diện chính xác và chính xác về thời gian dựa trên đồng hồ hệ thống của người dùng và không phụ thuộc vào tỷ lệ khung hình của bộ phim, tốc độ xử lý của người dùng, hoặc cho dù bộ phim đang phát. | Determining the Passage of Time The getTimer function returns in milliseconds the length of time elapsed since the movie was first opened and played therefore if the movie has been open for six seconds the following script var playBackTime Number getTimer would assign playBackTime a value of 6000 1 000 milliseconds for each second . This is an accurate and precise representation of time based on the user s system clock and is not dependent on the movie s frame rate the user s processor speed or whether the movie is playing. This is also a universal value which means that it represents the playback of the movie as a whole you cannot track the length of time for which individual timelines have been present. By setting a variable s value based on the value returned by the getTimer function and comparing that value to the value returned by the function at a later point in time you can evaluate the amount of time too much or too little that has passed within that span and take appropriate action. To better understand this principle consider the following example Button A functionality var startTime Number function startTime getTimer Button B functionality var nowTime Number function nowTime getTimer if nowTime - startTime 1000 You press buttons pretty quickly else You re pretty slow Here the action on one button buttonA_btn establishes a starting point by capturing the time when the button is pressed and released. When buttonB_btn is pressed and released the time is captured again. A conditional statement is then used to determine whether the amount of time between these two button presses was more or less than a second and then acts accordingly. Similarly by using the following script you can facilitate doubleclicking functionality for a button that is the script takes action only if separate clicks occur within a half-second of each other. var lastClick Number function