Put timer on dialog box

I want it to display a dialog where the user has 8 seconds to type in the specified text and if they dont the dialog box closes.

I tried

display dialog “This is where the text they have to type is” default answer “”
quit after 8
if text returned of the result is “Whatever they were supposed to type” then

But it didnt work.

How about this?

tell me
	display dialog "Enter something:" default answer "" giving up after 8
end tell
-- returns {text returned:"", button returned:"", gave up:true}