I don't know the technical reason, but when you make a GUI object. I.e.
PHP Code:
new GuiControl("control_name") {
}
you can access the control globally via control_name, TStaticVar works similarly.
Also I think it would of worked fine if you used a temp. prefix instead of using a global variable.