Accessibility
 
Home > Products > Flash > Support > Documentation
Flash Icon Macromedia Flash Support Center - Documentation
ActionScript Dictionary errata

The following information corrects known errors in the online Flash MX ActionScript Dictionary.

 
Global correction: Revised "Returns" information
The following entries incorrectly list Nothing under the "Returns" category for the entry. The actual value returned is indicated in the ActionScript Dictionary in the "Description" category for each entry.

Functions call, getProperty, getTimer, getVersion, targetPath, unescape

Conversion Functions Boolean, String

Mathematical Functions isFinite, isNaN, parseInt, parseFloat

Deprecated Functions length, ne

Array join, pop, slice

Boolean toString, valueOf

Color getRGB, getTransform

CustomActions get, install, uninstall

Key getAscii, getCode, isDown, isToggle

Math min, sin

Number toString, valueOf

Object toString, valueOf

Selection getFocus

Sound getTransform, getVolume, setPan

String charAt, charCodeAt, concat, fromCharCode, indexOf, lastIndexOf, length, slice, subStr, subString, toLowerCase, toUpperCase

TextField length

XML attribute, createElement, hasChildNode, toString

XMLSocket connect

 
>>= (bitwise right shift and assignment)
Revised Usage:

expression1 >>=expression2

 
arguments.length
Revised availability:

Macromedia Flash 5.

 
Array.join
Revised explanation of example (the example code is unchanged):

The following example creates an array with three elements: Earth, Moon, and Sun. It then joins the array three times—first using the default separator (a comma and a space), then using a dash, and then using a plus (+) sign—and displays them in the Output window:

a = new Array("Earth","Moon","Sun")
trace(a.join());
// returns Earth, Moon, Sun
trace(a.join(" - "));
// returns Earth - Moon - Sun
trace(a.join(" + "));
// returns Earth + Moon + Sun

 
Array.sort

There are a few typos in the example, the variable passwords is misspelled "password" and some quotes are not readable by the ActionScript compiler. The example should read as follows:

var passwords =[
"gary:foo",
"mike:bar",
"john:snafu",
"steve:yuck",
"daniel:1234"
];
function order (a,b){
//Entries to be sorted are in form
//name:password
//Sort using only the name part of the
//entry as a key.
var name1 =a.split(":")[0 ];
var name2 =b.split(":")[0 ];
if (name1 <name2){
return -1;
}else if (name1 >name2){
return 1;
}else {
return 0;
}
}
for (var i=0;i<passwords.length;i++){
trace (passwords.join());
}
passwords.sort(order);
trace ("Sorted:");
for (var i=0;i<passwords.length;i++){
trace (passwords.join());
}

 
eval
Revised description:

In Macromedia Flash MX, you cannot use the eval function to dynamically set and retrieve the value of a variable or instance name. However, you can use the set variable action in Macromedia Flash 5 or Macromedia Flash MX to dynamically set and retrieve the value of a variable or instance name. For example, replace the code

eval ("var" + i) = "first";

with this:

set ("var" + i, "first");

 
false

The Usage is incorrectly stated as true . The correct usage is as follows:

false

 
FScrollPane.setSmallSCroll()
Availability:
Flash Player 6

Usage:
scrollPaneInstance.setSmallScroll(x, y)

Parameters:
x a number indicating the number of pixels to scroll the contents horizontally for every scroll arrow click

y a number indicating the number of pixels to scroll the contents vertically for every scroll arrow click

Description:
Method; indicates the number of pixels to scroll the contents of the scroll pane.

 
fscommand
Revised usage for fscommand exec command:

The exec command can contain only the characters A-Z, a-z, 0-9, period ()., and underscore (_). The exec command runs in the subdirectory fscommand only. The exec command runs in the subdirectory fscommand only. In other words, if you use the fscommand exec command to call an application, the application must reside in a subdirectory named fscommand.

 
FStyleFormat object constructor
Revised example:

formStyleFormat = new FStyleFormat(); 

 
LoadVars (Object)
Revised method summary:

The second method in the table should be LoadVars.getBytesLoaded . The description is correct as it appears: Returns the number of bytes loaded from a load or sendAndLoad method.

 
LoadVars.load
Revised parameters:

The first parameter should be myLoadVars , not loadVarsObject .

 
LoadVars.onLoad
Revised parameters:

The first parameter should be myLoadVars , not loadVarsObject .

 
LoadVars.send
Revised parameters:

The first parameter should be myLoadVars , not loadVarsObject .

 
LoadVars.sendAndLoad
Revised parameters:

The first parameter should be myLoadVars , not loadVarsObject .

 
Math.log
Revised description:

Method; returns the logarithm of parameter x.

 
Math.LOG2E
Revised description:

The mathematical representation is log2e.

 
Math.SQRT1_2
Revised description:

Constant; a mathematical constant for the square root of one-half.

 
Mouse.hide

Returns a Boolean value true if the cursor is visible, and false if the cursor is invisible.

 
Mouse.show

Returns a Boolean value true if the cursor is visible, and false if the cursor is invisible.

 
MovieClip.attachMovie()
Revised returns:

A reference to the attached MovieClip instance in Flash Player 6. Undefined in Flash Player 5.

 
MovieClip.getBytesLoaded
Revised availability:

Flash 5.

 
MovieClip.getDepth
Revised usage:

MovieClip.getDepth()

 
MovieClip.hitTest

The following code in the example is incorrect:

if(_root.ball, hittest(_root.square))

The correct code reads as follows:

if(_root.ball.hitTest(_root.square))

The example also states that it uses the x_mouse and y_mouse properties. The correct properties are _xmouse and _ymouse .

 
MovieClip.onDragOut
Revised usage:

myMovieClip.onDragOut

Revised availability:

Flash Player 6

Revised description:

Event handler; invoked when the mouse button is pressed and the pointer rolls outside the object.

 
MovieClip.onDragOver

The example incorrectly states it is an example for onDragOut .

 
MovieClip.onKeyUp

The following text is incorrect, "The following example defines a function for the onKeyPress method that sends a trace action to the Output window."

The word onKeyPress should be onKeyUp .

 
MovieClip.onKeyDown and MovieClip.onKeyUp
Revised description:

The movie clip must have input focus enabled and set in order for the onKeyDown or onKeyUp event to work. First, the focusEnabled property must be set to true for the movie clip. Then, the clip must be given focus. This can be done either by using the Selection.setFocus method, or by setting the tab key to navigate to the clip.

If the Selection.setFocus method is used, the path for the movie clip must be passed to the Selection.setFocus method. Note that it is very easy for other elements to take the focus back once the mouse is moved.

Example for setting input focus:

MovieClip .focusEnabled = true;
Selection.setFocus( MovieClip );

 
MovieClip._parent
Revised availability:

Flash 5.

 
MovieClip.unloadMovie
Revised definition:

Removes the contents of a movie clip instance. The instance properties and clip handlers remain. To remove the instance, including its properties and clip handlers, use MovieClip.removeMovieClip .

 
Number.toString

Incorrectly states that it returns nothing. This method returns the string representation of the specified Number object (myNumber).

 
Object.registerClass
Revised example:

In the original example, in the second line, value should be newValue :

CheckBox.prototype.setValue = function (newValue) {
	this.value = value;
	...
};

The correct code is

CheckBox.prototype.setValue = function (newValue) {
	this.value = newValue;
	...
};

Revised instructions for Usage 1 (Timeline placement) in the example:

To use the registerClass method with a component instance that you have dragged onto the Stage, modify the ActionScript code in Frame 1 of the component movie clip. Place an #initclip action at the beginning of the code and place an #endinitclip action at the end of the code. For more information, see Flash MX Help > ActionScript Dictionary > #initclip .

 
Object.watch
Revised description:

You must return the new value from the Object.watch callback function, or the watched object property is assigned a value of undefined .

Revised example:

function CheckBox() {
	...
	this.watch ('value', function (id, oldval, newval) {
		...
	});
	this.watch ('label', function (id, oldval, newval) {
		...
	});
}

 
-parent
Revised availability:

Macromedia Flash 5.

 
print
Revised parameters:

The bounding box parameter ( bmovie , bmax , or bframe) is required.

 
printAsBitmapNum

Revised parameters:

The bounding box parameter ( bmovie , bmax , or bframe) is required.

 
-root
Revised availability:

Macromedia Flash 5.

 
Selection.getFocus

This method returns either the variable name of the text field that has focus or the value null.

 
Selection.setFocus

The following is also a valid usage:

Selection.setFocus(instanceName)

 
set variable
Revised example:

The code

on(release) {
	set(orig_x_pos, getProperty ("ship", _x ));
}

should be

on(release) {
	set("orig_x_pos", getProperty ("ship", _x ));
}

 
Sound.loadSound
Revised example for loading a streaming sound:

s.loadSound( "http://serverpath:port/mp3filename", true);

 
Stage (Object)
Revised property summary for the Stage object:

In the table of properties for the Stage object, the column on the left should be titled "Property".

 
Stage.onResize

The syntax under the Usage heading is incorrect. Instead, use Stage.addListener with the Object.onResize callback method, as in the following:

myListener = new Object();
myListener.onResize = function () { ... }
Stage.addListener(myListener);
// later ...
Stage.removeListener(myListener);

 
Stage.removeListener

Returns a Boolean value, true or false .

 
Stage.showMenu
Additional property for Stage object.

Availability:

Flash MX

Usage:

Stage.showMenu = Boolean;

Description:

Property (read-write); forces the movie to show or hide the display options in the Flash Player context menu (Zoom In, Zoom Out, 100%, Show All). If showMenu is set to true , all context menu items appear. If showMenu is set to false , the items Zoom In, Zoom Out, 100%, and Show All are hidden.

 
Super

Add the following code to the last sample:

SubClass.prototype = new SuperClass();
x = new SubClass("test");

The complete code looks like this:

function SuperClass(arg) {
	trace("SuperClass constructor was passed " + arg);
}
function SubClass(arg) {
	super(arg);
	trace("SubClass constructor");
}
SubClass.prototype = new SuperClass();
x = new SubClass("test");

 
switch
Revised example:

In the first sentence, the word numer should be number .

The following example requires a colon (:) after the default keyword.

switch (number) {
	case 1:
		trace ("A");
	case 2:
		trace ("B");
		break;
	default
		trace ("D")
}

The correct code is as follows:

switch (number) {
	case 1:
		trace ("A");
	case 2:
		trace ("B");
		break;
	default:
		trace ("D")
}

 
System.capabilities.hasAudioEncoder
Revised description:

Property; an array of audio encoders.

 
System.capabilities.os
Revised description:

A string that indicates the current operating system.

 
System.capabilities.pixelAspectRatio
Revised usage:

System.capabilities.pixelAspectRatio

 
System.capabilities.screenResolutionX

This entry should read: System.capabilities.screenResolutionX .(There should be no period following Resolution .)

 
System.capabilities.screenResolutionY

This entry should read: System.capabilities.screenResolutionY .(There should be no period following Resolution .)

 
System.security.allowDomain
Availability:

Flash MX

Usage:

System.security.allowDomain(domain1, domain2,....domainN)

Description:

Allows Flash MX movies in the identified domains to access objects and variables in the Flash MX movie that calls the allowDomain command.

Example:

The domains can be formatted in the following ways: domain.com, http://domain.com, or http://IPaddress.

Scenario:

<http://www.macromedia.com/MovieA.swf> loads <http://www.shockwave.com/MovieB.swf>. MovieA.swf contains the command System.security.allowDomain("shockwave.com") . Therefore MovieB.swf will be able to access MovieA.swf's objects and variables.

 
System.useCodepage
System.useCodepage was not documented in the first release of the Flash MX ActionScript Dictionary. Follow this link for information about this property of the System object.

 
TextField.autoSize
Revised description:

If the value of autosize is left and the text field line type is set to Multiline in the Text Property inspector, then the text field expands or contracts its right and bottom sides to fit all contained text. If the value of autosize is left and the text field line type is set to Multiline No Wrap in the Text Property inspector, then the text field expands or contracts only its right side to fit all contained text.

 
TextField.getFontList
Revised description:

getFontList is a static method of the global TextField object. This method returns only names of fonts on the Player's host system, not fonts in currently loaded SWF files.

Example:

To display a font list returned by getFontList :

arr = TextField.getFontList();
for( i in arr){
	trace(arr[i]);
}

 
TextField.onChanged
Revised description:

This callback method is invoked when the user changes a text field by typing or issuing a command such as Cut or Paste. It is not invoked when the user interacts with a text field without changing it; for example, selecting or scrolling text. It is not invoked when ActionScript modifies a text field's variable.

 
TextField.removeListener
Revised usage:

TextField.removeListener(listener)

To Table of Contents Back to Previous document