FX2D Resizable Window Error

Where in the code should I put this? Should I put it before or after setup()? Because I tried to put it before setup and I got errors for the variables canvas, scene, and stage saying that those variables do not exist.