"not defined error" please help

That's probably because you did not use code tags </> to post your code.

Read this post:

It will better explain how to post your code. You probably will not be able to get proper help until you do.