This content has been marked as final. Show 3 replies
I'm no expert but - Using namespaces is just a simple way to remove
ambiguity from using like named classes or functions. If you're the only
developer ever working on your project it may not matter much. But if you
start using other peoples classes it probably will matter. For example you
might make a class named Display - and so might some other developer. By
using a namespace - like your domain name - you can use two same named
classes in your project: com.domain1.Display, and com.domain2.Display...
without the namespace you'd have no way to differentiate between the two
Display classes and would have to rename one - and possibly its methods.
Many tween classes have a stop() method - Flash has a stop() method -
namespaces allow Flash to know which stop() method you want to call...
Adobe Community Expert
Oh okay that makes sense and I can see that but that seems to have to do with just defining a generic namespace. Can't you also sort of attach functions to a namespace? What is the goal there?
the goal is to prevent name conflicts. so, if have two functions with the same name (like f) in two different namespaces (like ns1 and ns2), they can be referenced by
ns1::f // and