Macromedia flex 2-migrating applications to flex 2 Manual De Usuario
34
ActionScript 2.0 to 3.0
(hintString ? String:Number)
is the non-assignment expression. The variable
myVar
is
dynamically typed to be String if
hintString
is
true
, else its type will be Number. You can
use a non-assignment expression anywhere that you would use a type-assignment expression.
Global functions
Most global functions have changed packages. In addition, they are no longer implicitly
imported. This section describes some changes to the global functions.
imported. This section describes some changes to the global functions.
Explicit imports
In most cases, you must import the classes to use global functions. For example, to use
functions in the System.* package, you now import flash.system.*. The global functions in
System.* were previously accessible in your
functions in the System.* package, you now import flash.system.*. The global functions in
System.* were previously accessible in your
<mx:Script>
blocks without explicit imports.
The following table lists common functions that you must now explicitly add an
import
statement to use:
For more information on what packages global functions are in, see the global function’s entry
in ActionScript 3.0 Language Reference.
in ActionScript 3.0 Language Reference.
The
trace()
function is an exception. It is in the flash.util package, but is implicitly
imported.
Function
Package to import
ContextMenu
import flash.ui.ContextMenu;
EventDispatcher
import flash.events.EventDispatcher;
(was mx.events.EventDispatcher mix-in)
(was mx.events.EventDispatcher mix-in)
LocalConnection
import flash.net.LocalConnection;
MovieClip
import flash.display.MovieClip;
PopUpManager
import mx.managers.PopUpManager;
XML
import flash.xml.XMLNode;