Namespace in actionscript3 is entirely a new concept. Actionscript2 came with built-in namespaces, public and private, which was extended to protected and internal in actionscript3. Along with predefined namespaces, we can have user-defined namespaces too in as3.

Adobe documentation : Namespaces are outfitted with a Universal Resource Identifier (URI) to avoid collisions, and are also used to represent XML namespaces when you work with E4X. This means, Namespaces are similar to packages and it provide a way to separate code in to separate “space”. Packages allow you to have different classes with the same name(different packages), namespaces allow you to have different methods with the same name in one class (with different namespaces).

Now let us see how namespace are used with an example.

// class
package {

    //package level namespace
    public namespace np = "www.44actions.com";

    public class UseNamespace {

        // class level namespace declaration
        public namespace n1;
        public namespace n2 = "www.browzor.com";

        // property declared with different namespace
        n1 var value:String = "namespace1";
        n2 var value:String = "namespace2";
        np var value:String = "namespace_package";

         //method declared with different namespace
        n1 function displayValue():String {
                return n1::value;
        }
        n2 function displayValue():String {
                return n2::value;
        }
        np function displayValue():String{
                return np:value;
        }

        //method
        public function showAll():String{
                return n1::displayValue() +" and "+n2::displayValue()+" and "+np::displayValue();
        } 

        //constructor
        function useNamespace(){
                trace(showAll());
        }
    }
}
// class
package{
    public  class CallNamespace{

        //construcator
        public callNamespace(){
            var newObject:UseNamespace = new UseNamespace(); // trace : "namespace1 and namespace2 and namespace_package"
            //call method at package level namespace successfully
            trace(newObject.np::displayValue()); // trace : "namespace_package"
        }
    }
}

Let me try to explain this :) .

Declaring namespace – Namespace are declared same as any other class members with a keyword namespace. But if u need to access namespace outside class you need to declare it as package level. See the above example where I have both class level and package level namespace declaration. Here np is a package level namespace and n1 and n2 are class level.
You can either define a namespace with an explicit URI, as you would define an XML namespace, or you can omit the URI. np & n2 are namespaces with explicit URI but n1 is not. If you omit the URI, the compiler will create a unique internal identification string in place of the URI.
Using namespace – Functions, variable and constants can be placed into a custom namespace. Classes cannot be!. Now see in above example how variable and methods declared into custom namespace. Though they have conflicting names, since they are in different namespace they can exist in same classes. (seems something similar to overloading – funny). Also keep in mind that cannot apply more than one namespace to one declaration which include build-in namespace too.
Referencing namespace – You can reference namespaces with the use namespace directive or you can qualify the name with the namespace using the name qualifier (::) punctuator. Only if the namespace is declared at package level, it can be referred outside its classes.