Welcome, Guest. Please login or register.
Did you miss your activation email?
31 Jul 2010, 11:40:33 UTC
Forum home
+  flexdeveloper.eu Forum
|-+  Other boards
| |-+  General Discussion (Moderators: thewarpedcoder, James)
| | |-+  What does import do?
« previous next »
Pages: [1] Print
Author Topic: What does import do? (Read 1110 times)
stephens
Newbie FD
*
Posts: 4


« on: 26 May 2009, 06:50:36 UTC »

Explain import tag
« Last Edit: 19 Oct 2009, 10:15:02 UTC by flexy » Logged
flexy
flexdeveloper.eu
Guru/Addict FD
*****
Posts: 3,155


Recovering Coffee Addict & Adobe Expert


WWW
« Reply #1 on: 26 May 2009, 11:36:56 UTC »

You'd like an summary of what the import tag does? Do you mean the ActionScript 3.0 import directive?

i.e
Code:
import com.utils.ExtendedMath;

This is required to make externally defined packages and classes available to the code in this class. After using the import directive, you can reference the class just by it's name, omitting the full package path.

So without the import directive, each time you declare a Sprite you'd have to do this:
Code:
var mySprite1:flash.display.Sprite = new flash.display.Sprite();
var mySprite2:flash.display.Sprite = new flash.display.Sprite();

Whereas using the import directive, you can simply use:
Code:
import flash.display.Sprite;
var mySprite1:Sprite = new Sprite();
var mySprite2:Sprite = new Sprite();

More here: http://livedocs.adobe.com/flex/2/langref/statements.html#import
« Last Edit: 19 Oct 2009, 10:15:11 UTC by flexy » Logged

Pages: [1] Print
« previous next »
Share this on: Twitter Twitter Del.icio.us del.icio.us Digg Digg
Jump to:

©2006-2010 Flexdeveloper.eu/Jodie O'Rourke. All rights reserved.
Adobe®, Adobe® Flash™, Adobe® AIR™ and Adobe® Flex™ are registered trademarks of Adobe Systems Incorporated in the United States and other countries. All rights reserved.

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC