0

Is there a way to do something akin to import <BLAH> as in actionscript? I've got some classes that I don't want to type the full class name out for every time I use them. That's why I'm trying to find an import as, or var C = ImportedClassThatIDontWantToTypeEveryTime. I've tried a few different ways, such as:

package com.mysite.blah {
    // doesn't work
    import com.mysite.ImportedClassThatIDontWantToTypeEveryTime as C;

    // also doesn't work
    import com.mysite.ImportedClassThatIDontWantToTypeEveryTime;
    var C:Class = ImportedClassThatIDontWantToTypeEveryTime;

    // ????

    public class SomeOtherClass {

        public function blah():void {

            C.doSomething();

        }

    }

}

I know there is a way to do this - I've done it before years ago. However, I can't remember how to do it. Help?

d0c_s4vage
  • 3,947
  • 6
  • 23
  • 32

1 Answers1

0

What IDE are you using? I ask this because I haven't had to type out a class-path in full in years. The auto-complete features of both FlashDevelop and FlashBuilder will allow you to type the first couple of letters of the class you want in place, select it from a list, and it will automatically add the appropriate import statement to the top of your class.

net.uk.sweet
  • 12,444
  • 2
  • 24
  • 42