A.2 Global Functions

 < Day Day Up > 

Global functions provide commands that relate generally to the Flash Player environment and are accessible to any scope in a movie.

Boolean( value :Object):Boolean*
call( ):Void*
clearInterval( id :Number):Void
Date( ):String*
duplicateMovieClip( target :String, newName :String, depth :Number):Void*
escape( value :String):String
eval( expr :String):Object*
fscommand( command :String, parameters :String):Void*
getProperty( movieClip :Object, property :Object):Object*
getTimer( ):Number*
getURL( url :String, window :String, method :String):Void*
getVersion( ):String*
gotoAndPlay( frameNumOrLabel :Object):Void*
gotoAndPlay( scene :Object, frameNumOrLabel :Object):Void*
gotoAndStop( frameNumOrLabel :Object):Void*
gotoAndStop( scene :Object, frameNumOrLabel :Object):Void*
int( num :Number):Number*
isFinite( value :Object):Boolean
isNaN( value :Object):Boolean
loadMovie( url :String, target :Object, method :String):Void*
loadMovieNum( url :String, level :Number, method :String):Void*
loadVariables( url :String, target :Object, method :String):Void*
loadVariablesNum( url :String, level :Number, method :String):Void*
nextFrame( ):Void*
nextScene( ):Void*
Number( value :Object):Number
parseFloat( value :String):Number
parseInt( value :String, radix :Number):Number
play( ):Void*
prevFrame( ):Void*
prevScene( ):Void*
print( target :Object, boundingBox :String):Void*
printAsBitmap( target :Object, boundingBox :String):Void*
printAsBitmapNum( level :Number, boundingBox :String):Void*
printNum( level :Number, boundingBox :String):Void*
random( number :Number):Number*
removeMovieClip( target :Object):Void*
setInterval( function :Object, interval :Object, arg1 :Object, ... argn :Object):Number [2]
setInterval( object :Object, method :Object, interval :Object, arg1 :Object, ... argn :Object):Number [2]
setProperty( movieClip :Object, property :Object, value :Object):Void*
startDrag( target :Object, lockCenter :Boolean, left :Number, top :Number, right :Number, bottom :Number):Void*
stop( ):Void*
stopAllSounds( ):Void*
stopDrag( ):Void*
String( value :Object):String*
targetPath( mc :MovieClip):String*
toggleHighQuality( ):Void*
trace( value :String):Void
unescape ( value :String):String
unloadMovie( target :Object):Void*
unloadMovieNum( level :Number):Void*
updateAfterEvent( ):Void*

[2] setInterval( ) has two forms with differing numbers of parameters, so all parameter types are specified as Object to accept any datatype.

Accessibility Class

The Accessibility class provides tools for developing advanced accessible UI components .

At runtime, the Accessibility class is actually a standalone, predefined object, not a class. However, it is treated as a class by the compiler for the sake of type checking. Hence, the Accessibility class has no constructor.


Constructor

None

Class methods

isActive( ):Boolean
sendEvent( mc :MovieClip, childID :Object, event :Object, isNonHtml :Boolean):Void [3]
updateProperties( ):Void

[3] No type specified for the childID parameter in 7.0.0 and 7.0.1

Arguments Class Extends Array

The Arguments class provides access to function arguments, the current function, and the calling function.

Note that datatype information for the Arguments class is stored in the intrinsic file FunctionArguments.as . Instances of the Arguments class are created automatically by ActionScript and made available within each executing function. Hence, the Arguments class has no constructor.

Instance properties

callee:Function [4]
caller:Function [4]

[4] Incorrectly listed as an instance method in 7.0.0 and 7.0.1

Elements are accessed as follows but not type checked:

arguments[ index ]
Array Class

The Array class provides support for ordered lists of data.

Constructor

Array( )*
Array( len :Object)*
Array( elem0 :Object, elem1 :Object, elem2 :Object,... elemn :Object)*

Class properties

The following class properties are supported for arrays in Flash Player 7 and later:

CASEINSENSITIVE:Number
DESCENDING:Number
NUMERIC:Number
RETURNINDEXEDARRAY:Number
UNIQUESORT:Number


Instance properties

length:Number

Instance methods

concat( value :Object):Array
join( delimiter :String):String
pop( ):Object
push( value :Object):Number [5]
reverse( ):Void
shift( ):Object
slice( startIndex :Number, endIndex :Number):Array
sort ( compare :Object, options :Number):Array [6]
sortOn( key :Object, options :Number):Array [7]
splice( startIndex :Number, deleteCount :Number, value :Object):Array
toString( ):String [8]
unshift( value :Object):Number

[5] Datatype for value not listed in 7.0.0 and 7.0.1

[6] Datatype for compare not listed in 7.0.0 and 7.0.1

[7] Datatype for key not listed in 7.0.0 and 7.0.1

[8] This method overrides the default Object.toString( ).

Boolean Class

The Boolean class acts as a wrapper class for primitive Boolean data.

Constructor

Boolean( value :Object)*

Instance methods

toString( ):String
valueOf( ):Boolean [9]

[9] Return type incorrectly listed as Number in 7.0.0 and 7.0.1

Button Class

The Button class provides control over instances of button symbols in a movie. Note that the following properties are not defined by the Button class but are erroneously listed in the Button.as intrinsic file for Flash MX 2004 and Flash MX Professional 2004 in versions 7.0.0 and 7.0.1.

_currentframe
_droptarget
_framesloaded
_totalframes

The legitimate properties and methods of the Button class are listed next .

Constructor

None (use the authoring tool to create buttons )

Instance properties

_alpha:Number
trackAsMenu:Boolean
enabled:Boolean
_url:String
_focusrect:Boolean
useHandCursor:Boolean
_height:Number
_visible:Boolean
_name:String
_width:Number
_parent:MovieClip
_x:Number
_quality:String [10]
_xmouse:Number
_rotation:Number
_xscale:Number
_soundbuftime:Number [11]
_y:Number
tabEnabled:Boolean
_ymouse:Number
tabIndex:Number
_yscale:Number
_target:String

[10] Synonym for global property _quality

[11] Synonym for global property _soundbuftime

Instance methods

getDepth( ):Number

Event handlers

onDragOut( ):Void
onRelease( ):Void
onDragOver( ):Void
onReleaseOutside( ):Void
onKeyDown( ):Void
onRollOut( ):Void
onKeyUp( ):Void
onRollOver( ):Void
onKillFocus( newFocus :Object):Void
onSetFocus( oldFocus :Object):Void
onPress( ):Void

Camera Class

The Camera class provides support to capture video from a video camera. It is used primarily with Macromedia Flash Communication Server.

Constructor

None (instances are created with Camera.get( ) )

Class properties

names :Array

Instance properties

activityLevel:Number
motionLevel:Number
bandwidth:Number
motionTimeOut:Number
currentFps:Number
muted:Boolean
fps:Number
name :String
height:Number
nativeModes:Array
index:Number
quality:Number
keyFrameInterval:Number
width:Number
loopback:Boolean

Class methods

get( index :Number):Camera

Instance methods

setKeyFrameInterval( keyFrameInterval :Number):Void
setLoopback( compress :Boolean):Void
setMode( width :Number, height :Number, fps :Number, favorArea :Boolean):Void
setMotionLevel( motionLevel :Number, timeOut :Number):Void
setQuality( bandwidth :Number, quality :Number):Void

Event handlers

onActivity( active :Boolean):Void
onStatus( infoObject :Object):Void
Color Class

The Color class provides control over movie clip color values.

Constructor

new Color ( target :Object) [12]

[12] The target parameter is not listed in 7.0.0 and 7.0.1.

Instance methods

getRGB( ):Number
getTransform( ):Object
setRGB( offset :Number):Void
setTransform( transformObject :Object):Void
ContextMenu Class

The ContextMenu class provides control over the Flash Player context menu, which is accessed via right-click (Windows) or Ctrl-click (Mac). This class is available in Flash Player 7 and later only.

Constructor

ContextMenu( callbackFunction :Function) [13]

[13] Datatype for callbackFunction not listed in 7.0.0 and 7.0.1

Instance properties

builtInItems:Object

Instance methods

copy( ):ContextMenu
hideBuiltInItems( ):Void

Event handlers

onSelect( item :Object, item_menu :ContextMenu):Void [14]

[14] Incorrectly listed as a property in 7.0.0 and 7.0.1

ContextMenuItem Class

An instance of the ContextMenuItem class represents an item in the Flash Player's context menu. This class is available in Flash Player 7 and later only.

Constructor

ContextMenuItem( caption :String, callbackFunction :Function, separatorBefore :Boolean, enabled :Boolean, visible :Boolean) [15]

[15] Datatypes for constructor parameters not listed in 7.0.0 and 7.0.1

Instance properties

caption:String
enabled:Boolean
separatorBefore:Boolean
visible:Boolean

Instance methods

copy( ):ContextMenuItem

Event handlers

onSelect( obj :Object, menuItem :ContextMenuItem):Void [16]

[16] Incorrectly listed as a property in 7.0.0 and 7.0.1

Date Class

The Date class provides the current time and structured support for date information.

Constructor

Date( )
Date( milliseconds :Number)
Date( year :Number, month :Number, date :Number, hour :Number, min :Number, sec :Number, ms :Number)

Class methods

UTC( year :Number, month :Number, date :Number, hour :Number, min :Number, sec :Number, ms :Number):Number

Instance methods

getDate( ):Number
getYear( ):Number
getDay( ):Number
setDate( value :Number):Void
getFullYear( ):Number
setFullYear( value :Number):Void
getHours( ):Number
setHours( value :Number):Void
getMilliseconds( ):Number
setMilliseconds( value :Number):Void
getMinutes( ):Number
setMinutes( value :Number):Void
getMonth( ):Number
setMonth( value :Number):Void
getSeconds( ):Number
setSeconds( value :Number):Void
getTime( ):Number
setTime( value :Number):Void
getTimezoneOffset( ):Number
setUTCDate( value :Number):Void
getUTCDate( ):Number
setUTCFullYear( value :Number):Void
getUTCDay( ):Number
setUTCHours( value :Number):Void
getUTCFullYear( ):Number
setUTCMilliseconds( value :Number):Void
getUTCHours( ):Number
setUTCMinutes( value :Number):Void
getUTCMilliseconds( ):Number
setUTCMonth( value :Number):Void
getUTCMinutes( ):Number
setUTCSeconds( value :Number):Void
getUTCMonth( ):Number
setYear( value :Number):Void
getUTCSeconds( ):Number
toString( ):String
getUTCYear( ):Number [17]
valueOf( ):Number

[17] Undocumented

Function Class

The Function class provides an object-oriented representation of ActionScript functions.

Constructor

None (use the function keyword to create functions)

Instance properties

prototype:Object*

Instance methods

apply( thisArg :Object, args :Array)
call( thisArg :Object)
Key Class

The Key class is used to determine the state of keys on the keyboard.

At runtime, the Key class is actually a standalone, predefined object, not a class. However, it is treated as a class by the compiler for the sake of type checking. Hence, the Key class has no constructor.



Constructor

None

Class properties

The following properties are all datatype Number :

ALT
DOWN
INSERT
SHIFT
BACKSPACE
END
LEFT
SPACE
CAPSLOCK
ENTER
PGDN
TAB
CONTROL
ESCAPE
PGUP
UP
DELETEKEY
HOME
RIGHT


Class methods

addListener( listener :Object):Void
getAscii( ):Number
getCode( ):Number
isDown( code :Number):Boolean
isToggled( code :Number):Boolean
removeListener( listener :Object):Boolean

Events broadcast to listeners

onKeyDown( ):Void*
onKeyUp( ):Void*
LoadVars Class

The LoadVars class is used to export variables to, or import variables from, an external source.

Constructor

LoadVars( )

Instance properties

contentType:String
loaded:Boolean

Instance methods

addRequestHeader( header :Object, headerValue :String):Void [18]
decode( queryString :String):Void
getBytesLoaded( ):Number
getBytesTotal( ):Number
load( url :String):Boolean
send( url :String, target :String, method :String):Boolean
sendAndLoad(url:String, target, method :String):Boolean
toString( ):String [19]

[18] Supported in Flash Player 6.0.65.0 and later

[19] Overrides Object.toString( )

Event handlers

onData( src :String):Void
onLoad( success :Boolean):Void
LocalConnection Class

The LocalConnection class is used to transmit data directly between movies running on the same system.

Constructor

LocalConnection( )

Instance methods

close( ):Void
connect( connectionName :String):Boolean
domain( ):String
send( connectionName :String, methodName :String, args :Object):Boolean

Event handlers

allowDomain( domain :String):Boolean
allowInsecureDomain( domain :String):Boolean [20]
onStatus( infoObject :Object):Void

[20] Supported in Flash Player 7 and later

Math Class

The Math class provides access to mathematical functions and constants.

At runtime, the Math class is actually a standalone, predefined object, not a class. However, it is treated as a class by the compiler for the sake of type checking. Hence, the Math class has no constructor.


Constructor

None

Class properties

The following properties are all datatype Number :

E
LN2
LOG2E
SQRT1_2
LN10
LOG10E
PI
SQRT2

Class methods

abs( value :Number):Number
acos( value :Number):Number
asin( value :Number):Number
atan( value :Number):Number
atan2( value1 :Number, value2 :Number):Number
ceil( value :Number):Number
cos( value :Number):Number
exp( value :Number):Number
floor( value :Number):Number
log( value :Number):Number
max( value1 :Number, value2 :Number):Number
min( value1 :Number, value2 :Number):Number
pow( value1 :Number, value2 :Number):Number
random( ):Number
round( value :Number):Number
sin( value :Number):Number
sqrt( value :Number):Number
tan( value :Number):Number
Microphone Class

The Microphone class is used to capture audio from a microphone. It is used primarily with Macromedia Flash Communication Server.

Constructor

None (instances are created using Microphone.get( ) )

Class properties

names:Array

Instance properties

activityLevel:Number
rate:Number
gain:Number
silenceLevel:Number
index:Number
silenceTimeOut:Number
muted:Boolean
useEchoSuppression:Boolean
name:String

Class methods

get( index :Number):Microphone

Instance methods

setGain( gain :Number):Void
setRate( rate :Number):Void
setSilenceLevel( silenceLevel :Number, timeOut :Number):Void
setUseEchoSuppression( useEchoSuppression :Boolean):Void

Event handlers

onActivity( active :Boolean):Void
onStatus( infoObject :Object):Void
Mouse Class

The Mouse class is used to access mouse events and control mouse pointer visibility.

At runtime, the Mouse class is actually a standalone, predefined object, not a class. However, it is treated as a class by the compiler for the sake of type checking. Hence, the Mouse class has no constructor.


Constructor

None

Class methods

addListener( listener :Object):Void
hide( ):Number
removeListener( listener :Object):Boolean
show( ):Number

Events broadcast to listeners

onMouseDown( ):Void
onMouseMove( ):Void
onMouseUp( ):Void
MovieClip Class

The MovieClip class is a classlike datatype for main movies and movie clips.

Constructor

None (use createEmptyMovieClip( ) , attachMovie( ) , duplicateMovieClip( ) , or the authoring tool to create instances)

Instance properties

_alpha:Number
tabEnabled:Boolean
_currentframe:Number
tabIndex:Number
_droptarget:String
_target:String
enabled:Boolean
_totalframes:Number
focusEnabled:Boolean
trackAsMenu:Boolean
_focusrect:Boolean
_url:String
_framesloaded:Number
useHandCursor:Boolean
_height:Number
_visible:Boolean
hitArea:Object
_width:Number
_lockroot:Boolean [21]
_x:Number
_name:String
_xmouse:Number
_parent:MovieClip
_xscale:Number
_quality:String [22]
_y:Number
_rotation:Number
_ymouse:Number
_soundbuftime:Number [23]
_yscale:Number
tabChildren:Boolean

[21] Supported in Flash Player 7 and later

[22] Synonym for global property _quality

[23] Synonym for global property _soundbuftime

Instance methods

attachAudio( id :Object):Void
attachMovie( id :String, name :String, depth :Number, initObject :Object):MovieClip
beginFill( rgb :Number, alpha :Number):Void
beginGradientFill( fillType :String, colors :Array, alphas :Array, ratios :Array, matrix :Object):Void
clear( ):Void
createEmptyMovieClip( name :String, depth :Number):MovieClip
createTextField( instanceName :String, depth :Number, x :Number, y :Number, width :Number, height :Number):Void
curveTo( controlX :Number, controlY :Number, anchorX :Number, anchorY :Number):Void
duplicateMovieClip( name :String, depth :Number, initObject :Object):MovieClip
endFill( ):Void
getBounds( targetCoordinateSpace :Object):Object [24]
getBytesLoaded( ):Number
getBytesTotal( ):Number
getDepth( ):Number
getInstanceAtDepth( depth :Number):MovieClip [25]
getNextHighestDepth( ):Number [28]
getSWFVersion( ):Number* [28]
getURL( url :String, window :String, method :String):Void
globalToLocal( pt :Object):Void
gotoAndPlay( frame :Object):Void
gotoAndStop( frame :Object):Void
hitTest( ):Boolean
lineStyle( thickness :Number, rgb :Number, alpha :Number):Void
lineTo( x :Number, y :Number):Void
loadMovie( url :String, method :String):Void
loadVariables( url :String, method :String):Void
localToGlobal( pt :Object):Void
moveTo( x :Number, y :Number):Void
nextFrame( ):Void
play( ):Void
prevFrame( ):Void
removeMovieClip( ):Void
setMask( mc :Object):Void
startDrag( lockCenter :Boolean, left :Number, top :Number, right :Number, bottom :Number):Void
stop( ):Void
stopDrag( ):Void
swapDepths( mc :Object):Void
unloadMovie( ):Void
valueOf( ):Object*

[24] Datatype for targetCoordinateSpace not listed in 7.0.0 and 7.0.1

[25] Supported in Flash Player 7 and later

Event handlers

onData( ):Void
onMouseMove( ):Void
onDragOut( ):Void
onMouseUp( ):Void
onDragOver( ):Void
onPress( ):Void
onEnterFrame( ):Void
onRelease( ):Void
onKeyDown( ):Void
onReleaseOutside( ):Void
onKeyUp( ):Void
onRollOut( ):Void
onKillFocus( newFocus :Object):Void
onRollOver( ):Void
onLoad( ):Void
onSetFocus( oldFocus :Object):Void
onMouseDown( ):Void
onUnload( ):Void

MovieClipLoader Class

The MovieClipLoader class is used to load a .swf file or JPEG image into a movie clip and report on its download progress. Available in Flash Player 7 and later only.

Constructor

MovieClipLoader( )

Instance methods

addListener( listener :Object):Boolean
getProgress( target :Object):Object
loadClip( url :String, target :Object):Boolean
removeListener( listener :Object):Boolean
unloadClip( target :Object):Boolean

Events broadcast to listeners

onLoadComplete( target :Object):Void
onLoadError( target :Object, errorCode :String):Void
onLoadProgress( target :Object, bytesLoaded :Number, bytesTotal :Number):Void
onLoadStart( target :Object):Void
NetConnection Class

The NetConnection class is used to play streaming .flv (video) files. Note that when used with Macromedia Flash Communication Server or Macromedia Flash Remoting, the NetConnection class supports more methods. For details, see the documentation for those products. See also Flash Remoting: The Definitive Guide by Tom Muck (O'Reilly).

Constructor

NetConnection( )

Instance properties

isConnected:Boolean
uri:String

Instance methods

addHeader( )
call( remoteMethod :String, resultObject :Object):Void
close( ):Void
connect( targetURI :String):Boolean

Event handlers

onResult( infoObject :Object):Void
onStatus( infoObject :Object):Void
NetStream Class

The NetStream class offers control over a streaming .flv (video) file.

Constructor

NetStream( connection :NetConnection)

Instance properties

bufferLength:Number
bufferTime:Number
bytesLoaded:Number
bytesTotal:Number
currentFps:Number
liveDelay:Number
time:Number

Instance methods

attachAudio( theMicrophone :Microphone):Void
attachVideo( theCamera :Camera, snapshotMilliseconds :Number):Void
close( ):Void
pause( flag :Boolean):Void
play( name :Object, start :Number, len :Number, reset :Object)
publish( name :Object, type :String):Void
receiveAudio( flag :Boolean):Void
receiveVideo( flag :Object):Void
seek( offset :Number):Void
send( handlerName :String):Void
setBufferTime( bufferTime :Number)

Event handlers

onResult( streamId :Number)
onStatus( info :Object):Void
Number Class

The Number class is a wrapper class for primitive numeric data.

Constructor

Number( value :Object)

Class properties

MAX_VALUE:Number
NEGATIVE_INFINITY:Number
MIN_VALUE:Number
POSITIVE_INFINITY:Number
NaN:Number

Object Class

Th Object class is the base class for all other classes and the class for generic objects.

Constructor

Object( )

Class properties

prototype:Object

Instance properties

constructor:Object
_ _proto_ _:Object

Class methods

registerClass( name :String, theClass:Function):Boolean

Instance methods

addProperty( name :String, getter :Function, setter :Function):Boolean
hasOwnProperty( name :String):Boolean [26]
isPropertyEnumerable( name :String):Boolean [35]
isPrototypeOf( theClass :Object):Boolean [35]
toLocaleString( ):String [35]
toString( ):String
unwatch( name :String):Boolean
valueOf( ):Object
watch( name :String, callback :Function, userData :Object):Boolean

[26] Undocumented

PrintJob Class

The PrintJob class is used to print content from a movie, including dynamic and off-screen content. It offers more functionality and detailed control than the global print( ) function. Available in Flash Player 7 and later only.

Constructor

PrintJob( )

Instance properties

orientation:String
pageHeight:Number
pageWidth:Number
paperHeight:Number
paperWidth:Number

Instance methods

addPage( target :Object, printArea :Object, options :Object, frameNum :Number):Boolean
send( ):Void
start( ):Boolean
Selection Class

The Selection class provides control over text field selections and movie input focus.

At runtime, the Selection class is actually a standalone, predefined object, not a class. However, it is treated as a class by the compiler for the sake of type checking. Hence, the Selection class has no constructor.


Constructor

None

Class methods

addListener( listener :Object):Void
getBeginIndex( ):Number
getCaretIndex( ):Number
getEndIndex( ):Number
getFocus( ):String
removeListener( listener :Object):Boolean
setFocus( newFocus :Object):Boolean
setSelection( beginIndex :Number, endIndex :Number):Void

Events broadcast to listeners

onSetFocus( oldFocus :Object, newFocus :Object):Void
SharedObject Class

The SharedObject class supports local data storage and remote data transmission.

Constructor

None (instances are created with SharedObject.getLocal( ) or SharedObject.getRemote( ) )

Instance properties

data:Object

Class methods

getLocal( name :String, localPath :String):SharedObject
getRemote( name :String, remotePath :String, persistence :Object):SharedObject

Instance methods

close( ):Void
connect( myConnection :NetConnection):Boolean
flush( minDiskSpace :Number):Object
getSize( ):Number
send( handlerName :String):Void
setFPS( updatesPerSecond :Number):Boolean

Event handlers

onStatus( infoObject :Object):Void
onSync( objArray :Array):Void
Sound Class

The Sound class offers external sound-loading tools and control over sounds in a movie.

Constructor

Sound( target )

Instance properties

duration:Number
id3:Object
ID3:Object [27]
position:Number

[27] Refers to id3 property

Instance methods

attachSound( id :String):Void
getBytesLoaded( ):Number
getBytesTotal( ):Number
getPan( ):Number
getTransform( ):Object
getVolume( ):Number
loadSound( url :String, isStreaming :Boolean):Void
onSoundComplete( ):Void
setPan( value :Number):Void
setTransform( transformObject :Object):Void
setVolume( value :Number):Void
start( secondOffset :Number, loops :Number):Void
stop( linkageID :String):Void

Event handlers

onID3( ):Void [28]
onLoad( success :Boolean):Void

[28] Supported in Flash Player 7 and later

Stage Class

The Stage class provides access to a movie's size , scale settings, and alignment.

At runtime, the Stage class is actually a standalone, predefined object, not a class. However, it is treated as a class by the compiler for the sake of type checking. Hence, the Stage class has no constructor.


Constructor

None

Class properties

align:String
height:Number
scaleMode:String
showMenu:Boolean
width:Number

Class methods

addListener( listener :Object):Void
removeListener( listener :Object):Void

Events broadcast to listeners

onResize( ):Void
String Class

The String class is a wrapper class for the string primitive datatype.

Constructor

String( string :String)

Instance properties

length:Number

Class methods

fromCharCode( code_point1 , ... code_pointn ):String [29]

[29] Code points are not type checked, but should be type Number.

Instance methods

charAt( index :Number):String
charCodeAt( index :Number):Number
concat( ):String
indexOf( value :String, startIndex :Number):Number
lastIndexOf( value :String, startIndex :Number):Number
slice( index1 :Number, index2 :Number):String
split( delimiter :String):Array
substr( index1 :Number, index2 :Number):String
substring( index1 :Number, index2 :Number):String
toLowerCase( ):String
toUpperCase( ):String
System Class

The System class offers access to Flash Player and system settings and specifications.

At runtime, the System class is actually a standalone, predefined object, not a class. However, it is treated as a class by the compiler for the sake of type checking. Hence, the System class has no constructor.


Constructor

None

Properties

exactSettings:Boolean [30]
useCodepage:Boolean

[30] Supported in Flash Player 7 and later

Methods

setClipboard( text :String):Void [31]
showSettings( tabID :Number):Void

[31] Supported in Flash Player 7 and later

System.capabilities Class

The System.capabilities class offers information about the Flash Player and its host system.

At runtime, the System.capabilities class is actually a standalone, predefined object, not a class. However, it is treated as a class by the compiler for the sake of type checking. Hence, the System.capabilities class has no constructor.


At runtime, the System.capabilities class is a property of the System object, but at compile-time, the compiler treats capabilities as a class in the System package. These peculiarities are the unfortunate consequence of updating Flash's built-in class and object library from ActionScript 1.0 to ActionScript 2.0.

Constructor

None

Class properties

avHardwareDisable:Boolean [32]
language:String
hasAccessibility:Boolean
localFileReadDisable:Boolean [41]
hasAudio:Boolean
manufacturer:String
hasAudioEncoder:Boolean
os:String
hasEmbeddedVideo:Boolean [33]
pixelAspectRatio:Number
hasMP3:Boolean
playerType:String [41]
hasPrinting:Boolean [43]
screenColor:String
hasScreenBroadcast:Boolean [34]
screenDPI:Number
hasScreenPlayback:Boolean
screenResolutionX:Number
hasStreamingAudio:Boolean [43]
screenResolutionY:Number
hasStreamingVideo:Boolean [43]
serverString:String
hasVideoEncoder:Boolean
version:String
input:String
windowlessDisable:Boolean [35]
isDebugger:Boolean

[32] Supported in Flash Player 7 and later

[33] Supported in Flash Player 6.0.65.0 and later

[34] Supported in Flash Player 6.0.79.0 and later

[35] Undocumented

System.security Class

The System.security class is used to set cross-domain movie permissions.

At runtime, the System.security class is actually a standalone, predefined object, not a class. However, it is treated as a class by the compiler for the sake of type checking. Hence, the System.security class has no constructor.


At runtime, the System.security class is a property of the System object, but at compile time, the compiler treats security as a class in the System package. These peculiarities are the unfortunate consequence of updating Flash's built-in class and object library from ActionScript 1.0 to ActionScript 2.0.

Constructor

None

Class methods

allowDomain( domain1 , ... domainn ):Void [36]
allowInsecureDomain( domain1 , ... domainn ):Void [37]
loadPolicyFile( URL:String ):Void [38]

[36] Parameters not type checked

[37] Supported in Flash Player 7 and later; parameters not type checked

[38] No type specified for URL in 7.0.0 and 7.0.1

TextField Class

The TextField class is used to display and manipulate text on screen.

Note that the following properties are not defined by the TextField class but are erroneously listed in the TextField.as intrinsic file for Flash MX 2004 and Flash MX Professional 2004 in versions 7.0.0 and 7.0.1.

_currentframe
_droptarget
_focusrect
_framesloaded
_totalframes

The legitimate properties and methods of the TextField class are listed next.

Constructor

None (use MovieClip.createTextField( ) or the authoring tool to create instances)

Instance properties

_alpha:Number
_rotation:Number
autoSize:String
scroll:Number
background:Boolean
selectable:Boolean
backgroundColor:Number
_soundbuftime:Number [39]
border:Boolean
StyleSheet:TextField.StyleSheet [40]
borderColor:Number
tabEnabled:Boolean
bottomScroll:Number
tabIndex:Number
condenseWhite:Boolean
_target:String
embedFonts:Boolean
text:String
_height:Number
textColor:Number
hscroll:Number
textHeight:Number
html:Boolean
textWidth:Number
htmlText:String
type:String
length:Number
_url:String
maxChars:Number
variable:String
maxhscroll:Number
_visible:Boolean
maxscroll:Number
_width:Number
mouseWheelEnabled:Boolean* [41]
wordWrap:Boolean
multiline:Boolean
_x:Number
_name:String
_xmouse:Number
_parent:MovieClip
_xscale:Number
password:Boolean
_y:Number
_quality:String [42]
_ymouse:Number
restrict:String
_yscale:Number

[39] Synonym for global property _soundbuftime

[40] Supported in Flash Player 7 and later. The syntax TextField.StyleSheet is a special case allowed only in the built-in classes. In ActionScript 2.0, you cannot create nested classes such as TextField.StyleSheet .

[41] Supported in Flash Player 7 and later

[42] Synonym for global property _quality

Class methods

getFontList( ):Array

Instance methods

addListener( listener :Object):Boolean
getDepth( ):Number
getNewTextFormat( ):TextFormat
getTextFormat( beginIndex :Number, endIndex :Number):TextFormat
removeListener( listener :Object):Boolean
removeTextField( ):Void
replaceSel( newText :String):Void
replaceText( beginIndex :Number, endIndex :Number, newText :String):Void
setNewTextFormat( tf :TextFormat):Void
setTextFormat( ):Void

Event handlers

onChanged( changedField :TextField):Void
onKillFocus( newFocus :Object):Void
onScroller( scrolledField :TextField):Void
onSetFocus( oldFocus :Object):Void

Events broadcast to listeners

onChanged( changedField :TextField):Void
onScroller( scrolledField :TextField):Void
TextField.StyleSheet Class

The TextField.StyleSheet class provides CSS stylesheet support for a text field. Available in Flash Player 7 and later only.

At runtime, the StyleSheet class is actually defined as a static property of the TextField class. Classes can be made properties of other classes only in ActionScript 1.0. In ActionScript 2.0, it is illegal to assign a class as a property of another class. Therefore, for the sake of type checking, the compiler must treat StyleSheet as a class in the TextField package.


Constructor

StyleSheet( )

Instance methods

clear( ):Void
getStyle( name :String):Object
getStyleNames( ):Array
load( url :String):Boolean
parse( cssText :String):Boolean
parseCSS( cssText :String):Boolean
setStyle( name :String, style :Object):Void
transform( style :Object):TextFormat

Event handlers

onLoad( success :Boolean):Void
TextFormat Class

The TextFormat class retrieves or sets a text field's visual formatting.

Constructor

TextFormat( font :String, size :Number, textColor :Number, bold :Boolean, italic :Boolean, underline :Boolean, url :String, window :String, align :String, leftMargin :Number, rightMargin :Number, indent :Number, leading :Number)

Instance properties

align:String
leading:Number
blockIndent:Number
leftMargin:Number
bold:Boolean
rightMargin:Number
bullet:Boolean
size:Number
color:Number
tabStops:Array
font:String
target:String
indent:Number
underline:Boolean
italic:Boolean
url:String

Instance methods

getTextExtent( text :String):Object
TextSnapshot Class

The TextShapshot class represents static text fields in a movie. Available in Flash Player 7 and later only.

Constructor

None (create instances using MovieClip.getTextSnapshot( ) )

Instance methods

findText( startIndex :Number, textToFind :String, caseSensitive :Boolean):Number
getCount( ):Number
getSelected( start :Number, end :Number):Boolean
getSelectedText( includeLineEndings :Boolean):String
getText( start :Number, end :Number, includeLineEndings :Boolean):String
hitTestTextNearPos( x :Number, y :Number, closeDist :Number):Number
setSelectColor( color :Number):Void
setSelected( start :Number, end :Number, select :Boolean):Void
Video Class

The Video class provides control over captured or streaming video.

Constructor

None (create Video instances with the authoring tool)

Instance properties

deblocking:Number
height:Number
smoothing:Boolean
width:Number

Instance methods

attachVideo( source :Object):Void
clear( ):Void
XML Class Extends XMLNode

The XML class provides DOM-based support for XML-structured data.

Constructor

XML( text :String)

Instance properties

contentType:String
docTypeDecl:String
ignoreWhite:Boolean
loaded:Boolean
status:Number
xmlDecl:String

Instance methods

addRequestHeader( header :Object, headerValue :String):Void [43]
createElement( name :String):XMLNode
createTextNode( value :String):XMLNode
getBytesLoaded( ):Number
getBytesTotal( ):Number
load( url :String):Boolean
parseXML( value :String):Void
send( url :String, target :String, method :String):Boolean
sendAndLoad( url :String, result :XML):Void

[43] Supported in Flash Player 6.0.65.0 and later

Event handlers

onData( src :String):Void
onLoad( success :Boolean):Void
XMLNode Class

The XMLNode class is the superclass of the XML class. It contains operations required by a node in an XML DOM tree.

Constructor

XMLNode( type :Number, value :String)

Instance properties

attributes:Object
childNodes:Array
firstChild:XMLNode
lastChild:XMLNode
nextSibling:XMLNode
nodeName:String
nodeType:Number
nodeValue:String
parentNode:XMLNode
previousSibling:XMLNode

Instance methods

appendChild( newChild :XMLNode):Void
cloneNode( deep :Boolean):XMLNode
hasChildNodes( ):Boolean
insertBefore( newChild :XMLNode, insertPoint :XMLNode):Void
removeNode( ):Void
toString( ):String
XMLSocket Class

The XMLSocket class provides support for a persistent client/server TCP/IP connection, typically used to implement multiuser applications. For numerous examples, see http://www. moock .org/unity.

Constructor

XMLSocket( )

Instance methods

close( ):Boolean
connect( url :String, port :Number):Boolean
send( data :Object):Boolean

Event handlers

onClose( ):Void
onConnect( success :Boolean):Void
onData( src :String):Void
onXML( src :XML):Void
 < Day Day Up > 


Essential ActionScript 2.0
Essential ActionScript 2.0
ISBN: 0596006527
EAN: 2147483647
Year: 2004
Pages: 177
Authors: Colin Moock

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net