Import all the classes in a particular package by using the wildcard operator (*) trailing the package name : package « Language « Flash / Flex / ActionScript






Import all the classes in a particular package by using the wildcard operator (*) trailing the package name

 

package
{
    import com.example.shapes.*;

    public class PackagesTest
    {
        public function PackagesTest()
        {
            var r:Rectangle = new Rectangle();
            10 + DEFAULT_SIZE;
            testShapes();
        }
    }
}

package com.example.shapes
{
    public const DEFAULT_SIZE:int = 256;
}
package com.example.shapes
{
    public class Rectangle
    {
        // define Rectangle here.
    }
}

        








Related examples in the same category

1.The general form of a package definition directive
2.To gain access to all the public classes in another package.
3.Global Scope: Code placed directly outside a package body or at the top-level of a package body resides in the global scope.
4.package level function
5.Packages groups classes
6.Variables, functions, and namespace declarations can also be contained inside packages.
7.A package-level function
8.References to the classes by using their full name