References to the classes by using their full name : package « Language « Flash / Flex / ActionScript

Home
Flash / Flex / ActionScript
1.Animation
2.Array
3.Class
4.Data Type
5.Development
6.Function
7.Graphics
8.Language
9.Network
10.Regular Expressions
11.Statement
12.String
13.TextField
14.XML
Flash / Flex / ActionScript » Language » package 
References to the classes by using their full name
 

package
{
    import com.example.shapes.Rectangle;
    import flash.geom.Rectangle;

    public class PackagesTest
    {
        public function PackagesTest()
        {
            var a:com.example.shapes.Rectangle =
                new com.example.shapes.Rectangle();

            var b:flash.geom.Rectangle =
                new flash.geom.Rectangle();
        }
    }
}
 
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.Import all the classes in a particular package by using the wildcard operator (*) trailing the package name
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.