Flash / Flex / ActionScript/Language/import

Материал из Web эксперт
Перейти к: навигация, поиск

Importing a class makes that class available to the code in the file and sets up a shortcut.

   <source lang="java">

package {

   import flash.display.Sprite;
   public class ExampleApplication extends Sprite {
       public function ExampleApplication(  ) {
           graphics.lineStyle(1, 0, 1);
           for(var i:int=0;i<100;i++) {
               graphics.lineTo(Math.random(  ) * 400, Math.random(  ) * 400);
           }
       }
   }

}

       </source>