a flag can not function

but the "delay(3000)" is executed at the "setup" and the "time =millis()" is executed at the "loop". What can i do? I just need to remove "delay(3000)" if I want to hold the flag for 1 second?

Big Thank you!