compile when I get the message ' setLocked ' was not Declared In This scope

Add this at the top:

boolean setLocked;