Javascript scope problems
<p>I have a bunch of javascript "classes" (Prototype) that make up the inheritance hierarchy of a web application I'm building. I've been trying to organize these classes into "namespaces":</p>

<pre><code>var UI = {
Control: Class.create(KVO.Object,
{
...
})
}
</code></pre>

<p>The classes are organized into separate files, so when I wanted to add a class to UI, I did this in a separate file:</p>

<pre><code>UI.TextFieldControl = Class.create(UI.Control,
{
...
})
</code></pre>

<p>But, when I try to use UI.TextFieldControl in my program after including the files, it is undefined. I guess this is a scope problem of some sort, because within the TextFieldControl file it is defined, but as far as I can understand UI.TextFieldControl should be defined after it is included; what am I doing wrong?</p>
