So I can’t help but notice every tag but mine starts with “mx:” and that “xmlns:mx=” is defined in the Application tag. My guess is this is mapping the “mx” namespace to definitions contained at “http://www.adobe.com/2006/mxml”.
Furthermore, because my tag doesn’t start with anything, that probably means it’s not in a namespace (or, rather, is in a global namespace). And the line “xmlns=” maps the global namespace to “*”, which apparently means the current directory. I can confirm these assumptions by updating “HelloWorld.mxml” to create my own namespace “blah”, and mapping that to the current directory as follows:
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” xmlns:blah=”*”><blah:CustomPanel/></mx:Application>
Works as you’d expect. However, I’m not sure how to put “blah” into a subdirectory. If I move “CustomPanel.mxml” into a subdirectory named “subdir/”, I’d expect to set “xmlns:blah=” to “subdir” or “/subdir” or “subdir/*” or something like that. But nothing works. Hm… Ah, here we go:
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” xmlns:blah=“subdir.*”><blah:CustomPanel/></mx:Application>
Not sure why languages love to get fancy and use dots instead of slashes, but so be it.
Judging by your last sentence of this post, you must be a freakin designer and never have programmed before or you might understand the dot notation for specifying name spaces.
Like I have always said, without designers IB Profen and Tylenol couldn’t stay in business with all of us programmers not having a use for it anymore.
Yikes, was that intended to be funny or are you truly as mean-spirited as the comment sounds? As for my background, it’s primarily in C++ (which has its own, even weirder namespaces) so Java-style namespace management doesn’t come naturally to me.
But regardless, I still don’t see why languages that mirror namespaces and directory structures don’t just use the same notation for both. I’m fine with the lack of header files, and I’m fine with each file corresponding to a single class with the same name as the file itself. Those are good ideas. But I think a slash notation:
import subdir/MyClass;
import otherdir/*;
Is intuitively more obvious than
import subdir.MyClass;
import otherdir.*;
And before replying, please take a Tylenol and try to respond in a nicer tone. Everyone’s got an opinion on the matter.
I like better dots.
@Matthew: you seem like a cocky rocket-scientist-wannabe. There are definitely better ways to say things.
peace out