Error - project is not defined

Hi Everyone

I am building a small login system which will require one to enter their username and password then, if their login details are correct they move to the (“verifyFrame”) where they have to either stop a moving clip using secret keys (L,R,M) to click it so they can proceed to the passFrame or, use the same keys to position the hiddenClip where they can press it to proceed to stop at the passFrame where they are able to click a button to go to the gameFrame but only one is required if it works.

However, during testing, i am getting the two listed errors depending on the clip i press but, i am not able to pin point where the error comes from despite console info that shows lines.

Please note, i may have forgotten to re-name the clips after testing but, dynamic clip is the circle shape and, hiddenClip is the square shape just for info.

If anybody can help, i will be super happy for any feedback.

Thanks to all…

loginsys.wick (150.9 KB)

ah, so i think this is a reeeeeally obscure issue.

you have code inside window.addEventListener, which changes the “scope” of variables you can see. project and other objects inside the project are visible if you use it in most cases, but NOT when inside a window function.

you can see what i mean in this project file. neither of the lines in the function will work because window cannot see those values.

addEventListener3-1-2026_13-55-47.wick (1.2 KB)

this can be fixed with some jank code that makes the project visible, but you run into another problem: each time the project runs, it will add a new event listener without removing the previous ones. as a result, you have a bunch of identical event listeners doing stuff on top of each other. wick was not designed to take event listeners or other window things into account, which is why it’s becoming a mess.

and on top of all of this, the event listeners are still listening when the project is paused! this is because the events are basically being added to the tab, not the project. so whatever you do to the tab is not undone when you pause the project. if you type in the code editor or in a text box, keydown will be registered and the console will print out text.

i tried to at least fix the first problem with removeEventListener but was unsuccessful in the time i have. the idea is that if you pause/play the project more than once, removeEventListener gets rid of the previous listener before re-adding it. right now though, that line doesn’t work, so if you pause/play the project many times and start hitting keys, it will run multiple times.

you can check out what i did below as a starting point, but given the amount of pain you’d have to go through to make everything behave, i’d recommend not using event listeners at all.

addEventListenerNew3-1-2026_14-07-58.wick (1.3 KB)