Reviews & Opinions
Independent and trusted. Read before buy Macromedia Flash 8-actionscript 2 0 Language Reference!

Macromedia Flash 8-actionscript 2 0 Language Reference


Bookmark
Macromedia Flash 8-actionscript 2 0 Language Reference

Bookmark and Share

 

Macromedia Flash 8-actionscript 2 0 Language ReferenceActionScript 2.0 language reference for Macromedia Flash 8 [Book]

By Francis Cheng - Macromedia Press (2006) - Paperback - 1370 pages - ISBN 0321384040

The "ActionScript 2.0 Language Reference for Macromedia Flash 8" is a comprehensive reference manual that describes the application programming interface (API) for Macromedia Flash Player, the most pervasive client runtime environment in the world. It includes valuable syntax and usage information; detailed descriptions of classes, functions, properties, and events; and copy-and-paste code samples for every element in the ActionScript language. The "ActionScript 2.0 Language Refer... Read more
[ Report abuse or wrong photo | Share your Macromedia Flash 8-actionscript 2 0 Language Reference photo ]

 

 

Manual

Preview of first few manual pages (at low quality). Check before download. Click to enlarge.
Manual - 1 page  Manual - 2 page  Manual - 3 page 

Download (English)
Macromedia Flash 8-actionscript 2.0 Language Reference, size: 18.5 MB

 

Macromedia Flash 8-actionscript 2 0 Language Reference

 

 

User reviews and opinions

<== Click here to post a new opinion, comment, review, etc.

Comments to date: 1. Page 1 of 1. Average Rating:
steven keyte 8:47am on Sunday, October 31st, 2010 
PROS: OS, look, Awesomeness ITs great, and the idea is well along with the OS its a Mac downsized. its size is a bit big Bought the 16G WiFi for my wife. She enjoys playing games, surfing the web, reading books, reading email and catching up on her Soaps at ABC.com. Awesome game player, and has replaced my laptop but I do not have to need for business and so I do not know about how those work. Great for traveling,...

Comments posted on www.ps2netdrivers.net are solely the views and opinions of the people posting them and do not necessarily reflect the views or opinions of us.

 

Documents

doc0

About statements

A statement is an instruction you give the FLA file to do something, such as to perform a particular action. For example, you can use a conditional statement to determine whether something is true or exists. Then your code might execute actions that you specify, such as functions or expressions, based on whether the condition is true or not. For example, the if statement is a conditional statement and evaluates a condition to determine the next action that should occur in your code.
Another example is the return statement, which returns a result as a value of the function in which it executes. There are many different ways for you to format or write ActionScript. You might differ from someone else who writes ActionScript in the way you form syntax, such as the way you space out your statements or where you put curly braces ({}) in your code. Even though there are several different ways you can form statements without breaking your code, there are some general guidelines you can follow to write well-formed ActionScript.
Place only one statement on a line to increase the readability of your ActionScript.
following example shows the recommended and not recommended statement usage:
theNum++; // recommended theOtherNum++; // recommended aNum++; anOtherNum++; // not recommended Assign variables as separate statements. var myNum:Number = (a = b + c) + d;
Consider the following ActionScript example:
This ActionScript embeds an assignment within the code, which is difficult to read. If you assign variables as separate statements, it improves readability, as the following example shows:
var a:Number = b + c; var myNum:Number = a + d;
The following sections show you how to form specific statements in ActionScript. For information on writing and formatting events, see Chapter 9, Handling Events, on page 291. For more information on each statement, see the following topics:
About compound statements on page 104 About conditions on page 105 Repeating actions using loops on page 115
About compound statements
A compound statement contains numerous statements that you enclose within curly brace ({}) punctuators. The statements inside a compound statement can be any kind of ActionScript statement. A typical compound statement is shown below. The statements within the curly brace punctuators are indented from the compound statement, as the following ActionScript shows:
var a:Number = 10; var b:Number = 10; if (a == b) { // This code is indented. trace("a == b"); trace(a); trace(b); }
This compound statement contains several statements, but acts like a single statement in your ActionScript code. The opening brace is placed at the end of the compound statement. The closing brace begins a line, and aligns with the beginning of the compound statement. For more information on using braces, see Curly braces on page 90.

Select Control > Test Movie to test the document. The Output panel displays Unable
var n2:Number = 0; to divide by zero.
Return to the authoring environment and change the following line of code: to

var n2:Number = 2;

Select Control > Enter to test the document again. If the value of n2 equals zero, an error is thrown and is caught by the catch block, which displays a message in the Output panel. If the value of y is not equal to zero, the Output panel displays the result of n1 divided by n2. The finally block executes regardless of whether an error occurs and deletes the values of the n1 and n2 variables from the Flash document.
You arent limited to throwing new instances of the Error class when an error occurs. You could also extend the Error class to create your own custom errors, as demonstrated in the following example.
To create a custom error:
Select File > New and create a new ActionScript file. Select File > Save As and name the file DivideByZeroException.as. Type the following ActionScript into the Script pane:
// In DivideByZeroException.as: class DivideByZeroException extends Error { var message:String = "Divide By Zero error"; }
Save the ActionScript file. Create a new Flash document named exception_test.fla in the same directory as the ActionScript file, and then save the file. Type the following ActionScript into the Actions panel in Frame 1 of the main Timeline:
var n1:Number = 7; var n2:Number = 0; try { if (n2 == 0) { throw new DivideByZeroException(); } else if (n2 < 0) { throw new Error("n2 cannot be less than zero"); } else { trace(n1/n2); } } catch (err:DivideByZeroException) { trace(err.toString()); } catch (err:Error) { trace("An unknown error occurred; " + err.toString()); }
Save the Flash document and select Control > Test Movie to test the file in the test environment. Because the value of n2 equals 0, Flash throws your custom DivideByZeroException error class and displays Divide By Zero error in the Output panel. If you change the value of n2 in line two from 0 to -1, and retest the Flash document, you would see An unknown error occurred; n2 cannot be less than zero in the Output panel. Setting the value of n2 to any number greater than 0 causes the result of the division to appear in the Output panel. For more information on creating custom classes, see Chapter 6, Classes, on page 187.

Create a new Flash document. Type the following ActionScript on Frame 1 of the Timeline:
// Define the object to use as an associative array. var someObj:Object = new Object(); // Define a series of properties. someObj.myShape = "Rectangle"; someObj.myW = 480; someObj.myH = 360; someObj.myX = 100; someObj.myY = 200; someObj.myAlpha = 72; someObj.myColor = 0xDFDFDF; // Display a property using dot operator and array access syntax. trace(someObj.myAlpha); // 72 trace(someObj["myAlpha"]); // 72
The first line of ActionScript defines a new object (someObj) that you use as the associative array. Following this, you define a series of properties in someObj. Finally, you display a property that you select using both dot operator and array access syntax.
You can access variables in an associative array using two different methods: dot syntax (someObj.myColor) and array syntax (someObj[myColor]).
Select Control > Test Movie to test your ActionScript. The Output panel displays the number 72 twice, which represents both of the alpha levels that you traced.
There are two ways to create associative arrays in ActionScript 2.0:
Use an Object constructor Use an Array constructor (or the constructor of any dynamic class)
You can use an instance of any dynamic class to create an associative array, but it is common practice to use an instance of the Object class because you wont have any added class member properties or methods. Both of these ways are demonstrated in upcoming examples.
The previous example used an Object constructor to create an associative array.
If you use the Object constructor to create an associative array, you can take advantage of initializing your array with an object literal. An instance of the Object class, also called a generic object, is functionally identical to an associative array. In fact, Object instances are essentially associative arrays. You might use associative arrays for dictionary-like functionality, when its more convenient to have string keys rather than numerical indices. Each property name of the generic object serves as the key that provides access to a stored value. For more information on literals, see About literals on page 94. For more information on classes, see Chapter 6, Classes, on page 187.
To create an associative array using an Object constructor:
Create a new Flash document, and save it as assocArray.fla. Add the following ActionScript to Frame 1 of the Timeline:
var monitorInfo:Object = {type:"Flat Panel", resolution:"1600 x 1200"}; trace(monitorInfo["type"] + ", " + monitorInfo["resolution"]);

function myFunc(someText:String):Void { trace(someText); }
After passing the parameter, you can pass a value to the function when you call the function. This value traces in the Output panel, as follows:
myFunc("This is what traces");
When you call the function, you should always pass the specified number of parameters unless your function checks for undefined values and sets default values accordingly. The function substitutes the passed values for the parameters in the function definition; if any parameters are missing, Flash sets their value to undefined. You regularly pass parameters into functions when you write ActionScript code. You can also pass multiple parameters to a function, which can be as simple as the following:
var birthday:Date = new Date(1901, 2, 3); trace(birthday);
Each parameter is separated by a comma delimiter. Many built-in functions in the ActionScript language have multiple parameters. For example, the startDrag() method of the MovieClip class takes five parameters, lockCenter, left, top, right, and bottom:
startDrag(lockCenter:Boolean, left:Number, top:Number, right:Number, bottom:Number):Void
To pass a parameter to a function:
Create a new Flash document and save it as parameters.fla.
Add the following code to Frame 1 of the Timeline:
function traceMe(yourMessage:String):Void { trace(yourMessage); } traceMe("How are you doing?");
The first few lines of code create a user-defined function called traceMe(), which takes a single parameter, yourMessage. The last line of code calls the traceMe() function and passes the string value How are you doing?.
The next example demonstrates how to pass multiple parameters to a function.
To pass multiple parameters to a function:
Create a new Flash document and save it as functionTest.fla. Add the following code to Frame 1 of the main Timeline:
function getArea(width:Number, height:Number):Number { return width * height; }
The getArea() function takes two parameters, width and height.
Type the following code after the function:

The benefits of using classes on page 189 About packages on page 189
About values and data types on page 193 Object-oriented programming fundamentals on page 193
The benefits of using classes
In OOP, a class defines a category of object. A class describes the properties (data) and methods (behaviors) for an object, much like an architectural blueprint describes the characteristics of a building. You write a custom class in an external ActionScript (AS) file and you can import it into your application when you compile the FLA file. Classes can be very useful when you build larger Flash applications because you can organize a lot of the applications complexity in external class files. When you move a lot of the logic into a custom class, you can not only make the code easier to reuse, but you can also hide some of the methods and properties from other parts of the ActionScript code. This helps you prevent people from accessing sensitive information or changing data that shouldnt be changed. When you use a class, you can also extend existing classes and add new functionality or modify existing functionality. For example, if you create three very similar classes, you can write a base class and then write two other classes that extend the base class. These two classes can add additional methods and properties, so that you dont need to create three class files that all duplicate the same code and logic. Another benefit of using classes is code reusability. For example, if you create a custom class that creates a custom progress bar using the Drawing application programming interface (API), you could save the progress bar class in your classpath and reuse the same code in all of your Flash documents by importing the custom class. For more information on setting the classpath, see About importing class files on page 201 and About setting and modifying the classpath on page 202.

About packages

When you are creating classes, you organize your ActionScript class files in packages. A package is a directory that contains one or more class files and that resides in a designated classpath directory (see About importing class files on page 201 and About setting and modifying the classpath on page 202). A package can, in turn, contain other packages, called subpackages, each with its own class files.
Like variables, package names must be identifiers; that is, the first character can be a letter, underscore (_), or dollar sign ($), and each subsequent character can be a letter, number, underscore, or dollar sign. There are preferred ways to name packages, which for example recommend that you avoid using underscores or dollar sign characters. For more information on naming packages, see Naming packages on page 675. Packages are commonly used to organize related classes. For example, you might have three related classes, Square, Circle, and Triangle, that are defined in Square.as, Circle.as, and Triangle.as. Assume that youve saved the ActionScript files to a directory specified in the classpath, as shown in the following example:

To continue writing your class file, see Controlling member access in your classes on page 233.
Controlling member access in your classes
By default, any property or method of a class can be accessed by any other class: all members of a class are public by default. However, in some cases you might want to protect data or methods of a class from access by other classes. You need to make those members private (available only to the class that declares or defines them). You specify public or private members using the public or private member attribute. For example, the following code declares a private variable (a property) and a private method (a function). The following class (LoginClass) defines a private property named userName and a private method named getUserName():
class LoginClass { private var userName:String; private function getUserName():String { return this.userName; } // Constructor: public function LoginClass(user:String) { this.userName = user; } }
Private members (properties and methods) are accessible only to the class that defines those members and to subclasses of that original class. Instances of the original class, or instances of subclasses of that class, cannot access privately declared properties and methods; that is, private members are accessible only within class definitions, not at the instance level. In the following example, you change member access in your class files.
This exercise is part of Example: Writing custom classes on page 223. If you do not wish to progress through the example, you can download the class files from www.helpexamples.com/flash/learnas/classes/.
To control member access:
Open ClassA.as and ClassB.as in the Flash authoring tool. Modify the ClassA.as ActionScript file so its contents match the following ActionScript (the changes to make appear in boldface):
class com.adobe.utils.ClassA { private static var _className:String = "ClassA"; public function ClassA() { trace("ClassA constructor"); }
public function doSomething():Void { trace("ClassA - doSomething()"); } }
This previous code sets both methods (the ClassA constructor and the doSomething() method) as public, meaning that they can be accessed by external scripts. The static _className variable is set as private, meaning the variable can be accessed only from within the class and not from external scripts.
Modify the ClassB.as ActionScript file and add the same method and property access as the ClassA class. Save both ActionScript files before you proceed.
An instance of ClassA or ClassB cannot access the private members. For example, the following code, added to Frame 1 of the Timeline in a FLA file, would result in a compiler error indicating that the method is private and cant be accessed:
import com.adobe.utils.ClassA; var a:ClassA = new ClassA(); trace(a._className); // Error. The member is private and cannot be accessed.

Create a new keyframe on Frame 10 of the actions layer and add the following ActionScript:

stop();

Create a new keyframe on Frame 10 of the content layer and drag several components onto the Stage. Right-click each component (except the ProgressBar) in the Library panel and select Linkage from the context menu to launch the Linkage Properties dialog box. In the Linkage Properties dialog box, make sure that Export for ActionScript is selected, deselect the Export in First Frame check box, and click OK. File > Publish Settings. In the Publish Settings dialog box, select the Flash tab. the Settings button next to the ActionScript version pop-up menu to open the ActionScript Settings dialog box. In the Export Frame for Classes text box, enter the number of the frame where you want to export your class code (Frame 10). If the frame specified does not exist in the timeline, you get an error message when you publish your SWF file.

10. Select 11.

12. Click

14. Click

OK to close the ActionScript Settings dialog box, and then click OK to close the Publish Settings dialog box.

15. Select

Control > Test Movie to test the Flash document. If the Components load too quickly, select View > Simulate Download from the SWF file. Flash simulates downloading the Flash document at a lower speed, which allows you to see the progress bar component animate as the class files download.
For more information on ASO files, see Using ASO files on page 242.

Using ASO files

During compilation, Flash sometimes creates files with.aso extensions in the /aso subdirectory of the default global classpath directory (see About setting and modifying the classpath on page 202). The.aso extension stands for ActionScript object (ASO). For each ActionScript 2.0 file that is implicitly or explicitly imported and successfully compiled, Flash generates an ASO file. The file contains the bytecode thats produced from the associated ActionScript (AS) file. Therefore, these files contain the compiled form (the bytecode) of a class file. Flash needs to regenerate an ASO file only when the following scenarios occur:
The corresponding AS file has been modified. ActionScript files that contain definitions imported or used by the corresponding ActionScript file have been modified. ActionScript files included by the corresponding ActionScript file have been modified.
The compiler creates ASO files for caching purposes. You might notice that your first compilation is slower than subsequent compilations. This is because only the AS files that have changed are recompiled into ASO files. For unchanged AS files, the compiler reads the already-compiled bytecode directly out of the ASO file instead of recompiling the AS file. The ASO file format is an intermediate format developed for internal use only. It is not a documented file format and is not intended to be redistributed. If you experience problems in which Flash appears to be compiling older versions of a file you have edited, delete the ASO files and then recompile. If you plan to delete ASO files, delete them when Flash is not performing other operations, such as checking syntax or exporting SWFs.

Embedding characters on page 360 Embedding fonts on page 361 Creating custom character sets on page 363 Using TextField methods with embedded fonts on page 365 About sharing fonts on page 367
The following example shows you how to add and remove embedded characters and character sets in a Flash document.
To add and remove embedded characters and character sets:
Create a new Flash document and save it as embedding.fla. Create a dynamic text field on the Stage by using the Text tool. Click Embed to launch the Character Embedding dialog box. Select a specific character set to embed by clicking it with your mouse pointer. To select multiple character sets, you can use the Shift or Control key while selecting items with your mouse pointer. To select a block of character sets, select a character set with your mouse pointer, press and hold Shift, and click a new character set. Using Shift selects every character set between the two selected character sets. To select multiple non-sequential character sets, press and hold the Control key while you select character sets. You can also quickly select multiple character sets by selecting a character set with your mouse, and with the mouse button still held down, drag your mouse over multiple character sets.
To remove a specific character set that you added earlier, press and hold the Control key and deselect the character set by clicking it with your mouse pointer. To remove every selected character set and any specified characters in the Include these characters text input field, click Dont Embed.
Dont Embed clears any previously specified individual characters or character sets.
Clicking Dont Embed in the Character Embedding dialog box removes any specified embedded characters and character sets that were previously chosen without asking you to confirm.

Embedding characters

If youre working with embedded fonts and know exactly what characters you need, you can reduce file size by embedding only the characters that you need instead of including additional, unused font outlines. To embed certain characters within a text field and not embed a whole character set, use the Character Embedding dialog box to specify which specific characters you want to embed.

Drag an instance of the Button component from the Components panel to the Stage. Select the Button component and type my_button in the Instance Name text box. Select Frame 1 on the Timeline and type the following code in the Actions panel:
import mx.video.FLVPlayback; var my_flvPb:FLVPlayback; my_flvPb.autoPlay = false; my_button.label = "Seek to point2"; function clickMe(){ my_flvPb.seekToNavCuePoint("point2"); } my_button.addEventListener("click", clickMe);
The cuepoints.flv file contains three navigation cue points: one each near the beginning, middle, and end of the video file. When you click the button, the FLVPlayback instance seeks to the specified cue point (point2). For more information on cue points and the FLVPlayback component, see ActionScript 2.0 Components Language Reference.

Working with metadata

You can use the onMetaData method to view the metadata information in your FLV file. Metadata includes information about your FLV file, such as duration, width, height, and frame rate. The metadata information that is added to your FLV file depends on the software you use to encode your FLV file or the software you use to add metadata information.
If your video file does not have metadata information, you can use tools to add metadata information to the file.
To work with NetStream.onMetaData, you must have Flash Video that contains metadata. If you encode FLV files using Flash 8 Video Encoder, your FLV file will have metadata information in it (see the following example for a list of metadata in a FLV file encoded with Flash 8 Video Encoder).
Flash Video Exporter 1.2 and later (including Flash 8 Video Exporter), add the metadata to your FLV files. Sorenson Squeeze 4.1 and later also adds metadata to your video files.
The following example uses NetStream.onMetaData to trace the metadata information of an FLV file encoded with Flash 8 Video Encoder.
To use NetStream.onMetaData to view metadata information:
Create a new FLA file called flvMetadata.fla. In the Library panel (Window > Library), select New Video from the Library pop-up menu. In the Video Properties dialog box, name the video symbol and select Video (ActionScript controlled). Click OK to create a video object. Drag the video object from the Library panel to the Stage to create a video object instance. With the video object selected on the Stage, type my_video in the Instance Name text box in the Property inspector (Window > Properties > Properties). With the video instance still selected, type 320 in the width text box and 213 in the height text box. Select Frame 1 in the Timeline, and open the Actions panel (Window > Actions).

For more information, see the XMLSocket entry in the ActionScript 2.0 Language Reference. For more information on local file security, see About local file security and Flash Player on page 633.
Sending messages to and from Flash Player
To send messages from a SWF file to its host environment (for example, a web browser, a Macromedia Director movie, or the stand-alone Flash Player), you can use the fscommand() function.This function lets you extend your SWF file by using the capabilities of the host. For example, you could pass an fscommand() function to a JavaScript function in an HTML page that opens a new browser window with specific properties. To control a SWF file in Flash Player from web browser scripting languages such as JavaScript, VBScript, and Microsoft JScript, you can use Flash Player methodsfunctions that send messages from a host environment to the SWF file. For example, you could have a link in an HTML page that sends your SWF file to a specific frame. For more information, see the following topics:
Using the fscommand() function on page 618 About using JavaScript to control Flash applications on page 621
About Flash Player methods on page 621
Using the fscommand() function
N OTE quit fullscreen 618 N OTE NOT E
The External API is a replacement for fscommand() in Flash 8 and later for interoperating with a HTML page or a container application. The External API offers more robust functionality than fscommand() in this situation. For more information, see About the External API on page 621.
You use the fscommand() function to send a message to whichever program is hosting Flash Player, such as a web browser.
Using the fscommand() to call JavaScript does not work on the Safari or Internet Explorer browsers for the Macintosh.
The fscommand() function has two parameters: command and arguments. To send a message to the stand-alone version of Flash Player, you must use predefined commands and arguments. For example, the following event handler sets the stand-alone player to scale the SWF file to the full monitor screen size when the button is released:
my_btn.onRelease = function() { fscommand("fullscreen", true); };
The following table shows the values you can specify for the command and arguments parameters of fscommand() to control the playback and appearance of a SWF file playing in the stand-alone player, including projectors.
A projector is a SWF file saved in a format that can run as a stand-alone applicationthat is, embedding Flash Player with your content in an executable file.

System.security.loadPolicyFile("xmlsocket://adobe.com:414");
In this example, Flash Player tries to retrieve a policy file from the specified host and a port. Any port can be used if the policy file is not in the default (root) directory; otherwise the port is limited to 1024 and higher (as with earlier players). When a connection is established to the specified port, Flash Player sends <policy-file-request />, terminated by a null byte. The XML socket server might be configured to serve policy files in the following ways:
To serve policy files and normal socket connections over the same port. The server should wait for <policy-file-request /> before transmitting a policy file.
To serve policy files over a separate port from normal connections, in which case it might send a policy file as soon as a connection is established on the dedicated policy file port.
The server must send a null byte to terminate a policy file before it closes the connection. If the server does not close the connection, Flash Player does so upon receiving the terminating null byte. A policy file served by an XML socket server has the same syntax as any other policy file, except that it must also specify the ports to which access is granted. The allowed ports are specified in a to-ports attribute in the <allow-access-from> tag. If a policy file is less than port 1024, it can grant access to any port; when a policy file comes from port 1024 or higher, it can grant access only to other ports above 1024. Single port numbers, port ranges, and wildcards are allowed. The following code is an example of an XMLSocket policy file:
<cross-domain-policy> <allow-access-from domain="*" to-ports="507" /> <allow-access-from domain="*.adobe.com" to-ports="507,516" /> <allow-access-from domain="*.helpexamples.com" to-ports="516-523" /> <allow-access-from domain="www.adobe.com" to-ports="507,516-523" /> <allow-access-from domain="www.helpexamples.com" to-ports="*" /> </cross-domain-policy>
Because the ability to connect to ports lower than 1024 is available in Flash Player 7 (7.0.19.0) and later, a policy file loaded with loadPolicyFile is always required to authorize this, even when a SWF file is connecting to its own subdomain.
HTTP to HTTPS protocol access between SWF files

Use strict data typing with your variables whenever possible because it helps you in the following ways:
Adds code completion functionality, which speeds up coding. Generates errors in the Output panel so you dont have a silent failure when you compile your SWF file. These errors help you find and fix problems in your applications.
To add a data type to your variables, you must define the variable using the var keyword. In the following example, when creating a LoadVars object, you would use strict data typing:
var paramsLv:LoadVars = new LoadVars();
Strict data typing provides you with code completion, and ensures that the value of paramsLv contains a LoadVars object. It also ensures that the LoadVars object will not be used to store numeric or string data. Because strict typing relies on the var keyword, you cannot add strict data typing to global variables or properties within an object or array. For more information on strict typing variables, see About assigning data types and strict data typing on page 45.
Strict data typing does not slow down a SWF file. Type checking occurs at compile time (when the SWF file is created), not at runtime.
Use the following guidelines when you name variables in your code: All variables must have unique names. Dont use the same variable name with different cases. Dont use, for example, firstname and firstName as different variables in your application. Although names are case-sensitive in Flash Player 7 and later, using the same variable name with a different case can be confusing to programmers reading your code and can cause problems in earlier versions of Flash that do not force case sensitivity. Dont use words that are part of the ActionScript 1.0 or 2.0 language as variable names. In particular, never use keywords as instance names, because they cause errors in your code. Dont rely on case sensitivity to avoid conflicts and get your code to work.
Dont use variables that are parts of common programming constructs. Dont use language constructs if you are aware of them in other programming languages, even if Flash does not include or support these language constructs. For example, do not use the following keywords as variables:

A class may not extend itself. An interface may not extend itself. There is no interface defined with this name. A class may not extend an interface. An interface may not extend a class. An interface name is expected after the implements keyword. A class may not implement a class, only interfaces. The class must implement method methodName from interface interfaceName. The implementation of an interface method must be a method, not a property. A class may not extend the same interface more than once. The implementation of the interface method doesnt match its definition. This construct is only available in ActionScript 1.0. This construct is only available in ActionScript 2.0. Static members are not permitted in interfaces. The expression returned must match the functions return type. A return statement is required in this function. Attribute used outside class. A function with return type Void may not return a value. The extends clause must appear before the implements clause. A type identifier is expected after the :. Interfaces must use the extends keyword, not implements. A class may not extend more than one class. An interface may not extend more than one interface. There is no method with the name <methodName>. This statement is not permitted in an interface definition. A set function requires exactly one parameter. A get function requires no parameters. Classes may only be defined in external ActionScript 2.0 class scripts. ActionScript 2.0 class scripts may only define class or interface constructs.
The name of this class, <A.B.C>, conflicts with the name of another class that was loaded, <A.B>. (This error occurs when the ActionScript 2.0 compiler cannot compile a class because of the full name of an existing class is part of the conflicting class' name. For example, compiling class mx.com.util generates error 1141 if class mx.com is a compiled class.) The class or interface <Class or Interface Name> could not be loaded. Interfaces may only be defined in external ActionScript 2.0 class scripts. Instance variables cannot be accessed in static functions. Class and interface definitions cannot be nested. The property being referenced does not have the static attribute. This call to super does not match the superconstructor. Only the public attribute is allowed for interface methods. The import keyword cannot be used as a directive. You must export your Flash movie as Flash 7 to use this action. You must export your Flash movie as Flash 7 to use this expression. This exception clause is placed improperly. A class must have only one constructor. A constructor may not return a value. A constructor may not specify a return type. A variable may not be of type Void. A function parameter may not be of type Void. Static members can only be accessed directly through classes. Multiple implemented interfaces contain same method with different types. There is already a class or interface defined with this name. Classes, interfaces, and built-in types may not be deleted. There is no class with this name. The keyword <keyword> is reserved for ActionScript 2.0 and cannot be used here. Custom attribute definition was not terminated. Only one class or interface can be defined per ActionScript 2.0.as file.

doc1

Alert.yesLabel = "da";

CHAPTER 4

Button component
The Button component is a resizable rectangular user interface button. You can add a custom icon to a button. You can also change the behavior of a button from push to toggle. A toggle button stays pressed when clicked and returns to its up state when clicked again.
A Button component is supported for both ActionScript 2.0 and ActionScript 3.0. This document discusses the version 2 component. If you are using the version 3 component, see Using the Button in Using ActionScript 3.0 Components.
A button can be enabled or disabled in an application. In the disabled state, a button doesnt receive mouse or keyboard input. An enabled button receives focus if you click it or tab to it. When a Button instance has focus, you can use the following keys to control it:

Shift+ Spacebar

Moves focus to the previous object. Presses or releases the component and triggers the click event. Moves focus to the next object.
For more information about controlling focus, see FocusManager class on page 717 or Creating custom focus navigation in Using ActionScript 2.0 Components. A live preview of each Button instance reflects changes made to parameters in the Property inspector or Component inspector during authoring. However, in the live preview a custom icon is represented on the Stage by a gray square. When you add the Button component to an application, you can use the Accessibility panel to make it accessible to screen readers. First, you must add the following line of code:
mx.accessibility.ButtonAccImpl.enableAccessibility();
You enable accessibility for a component only once. regardless of how many instances you have of the component.
Using the Button component
A button is a fundamental part of any form or web application. You can use buttons wherever you want a user to initiate an event. For example, most forms have a Submit button. You could also add Previous and Next buttons to a presentation. To add an icon to a button, you need to select or create a movie clip or graphic symbol to use as the icon. The symbol should be registered at 0,0 for appropriate layout on the button. Select the icon symbol in the Library panel, open the Linkage dialog box from the Library pop-up menu, and enter a linkage identifier. This is the value to enter for the icon parameter in the Property inspector or Component inspector. You can also enter this value for the Button.icon ActionScript property.

myDataGrid.getColumnAt(index).editable
Property; determines whether the column can be edited by a user (true) or not (false). The DataGrid.editable property must be true in order for individual columns to be editable, even when DataGridColumn.editable is set to true. The default value is true.

CA UT ION 306

The following example prevents items in the first column in a grid from being edited:
// Set grid attributes. my_dg.setSize(150, 100); my_dg.editable = true; // Add columns to grid. my_dg.addColumn("name"); my_dg.addColumn("score"); // Set up sample data. my_dg.addItem({name:"Clark", score:3135}); my_dg.addItem({name:"Bruce", score:403}); my_dg.addItem({name:"Peter", score:25}); // Don't allow first column to be editable. my_dg.getColumnAt(0).editable = false;
myDataGrid.getColumnAt(index).headerRenderer
Property; a string that indicates a class name to be used to display the header of this column. Any class used for this property must implement the CellRenderer API (see CellRenderer API on page 107). The default value is undefined.
The following example uses a linkage identifier to set a new header renderer:
myGrid.getColumnAt(3).headerRenderer = "MyHeaderRenderer";
DataGridColumn.headerText
myDataGrid.getColumnAt(index).headerText
Property; the text in the column header. The default value is the column name. This property allows you to display something other than the field name as the header.
The following example sets the column header text to Price (USD):
import mx.controls.gridclasses.DataGridColumn; var my_dg:mx.controls.DataGrid; var price_dgc:DataGridColumn = new DataGridColumn("price"); price_dgc.headerText = "Price (USD)"; price_dgc.width = 80; my_dg.addColumn(price_dgc); my_dg.addItem({price:"$14.99"});
DataGridColumn.labelFunction
myDataGrid.getColumnAt(index).labelFunction
Property; specifies a function to determine which field (or field combination) of each item to display. This function receives one parameter, item, which is the item being rendered, and must return a string representing the text to display. This property can be used to create virtual columns that have no equivalent field in the item.

NOT E 308

The specified function operates in a nondefined scope.
The following example calculates a value for the Subtotal column:
import mx.controls.gridclasses.DataGridColumn; var my_dg:mx.controls.DataGrid; my_dg.setSize(300, 200); // Set up columns. var guitar_dgc:DataGridColumn = new DataGridColumn("guitar"); var value_dgc:DataGridColumn = new DataGridColumn("value"); var tax_dgc:DataGridColumn = new DataGridColumn("tax"); var st_dgc:DataGridColumn = new DataGridColumn("Subtotal"); //Define labelFunction for Subtotal column. st_dgc.labelFunction = function(item:Object):String { if ((item.value != undefined) && (item.tax != undefined)) { return "$"+(item.value+item.tax); } }; // Add columns to grid. my_dg.addColumn(guitar_dgc); my_dg.addColumn(value_dgc); my_dg.addColumn(tax_dgc); my_dg.addColumn(st_dgc); // Set data model. my_dg.addItem({guitar:"Flying V", value:10, tax:1}); my_dg.addItem({guitar:"SG", value:20, tax:2}); my_dg.addItem({guitar:"jagstang", value:30, tax:3});

This populates the DataSet objects items property with an array of objects, each of which has three properties: id, firstName, and lastName.
Add the three properties and their required data types to the DataSet schema:
Select the DataSet component on the Stage, open the Component inspector, and click the Schema tab. Click Add Component Property, and add three new properties, with field names id, firstName, and lastName, and data types Number, String, and String, respectively.
Or, if you prefer to add the properties and their required data types in code, you can add the following line of code to the Actions panel instead of following steps a and b above:
// Add required schema types. var i:mx.data.types.Str; var j:mx.data.types.Num; 9.
To bind the contents of the DataSet component to the contents of the DataGrid component, open the Component inspector and click the Bindings tab. the DataGrid component (user_dg) on the Stage, and click the Add Binding (+) button in the Component inspector. In the Add Binding dialog box, select dataProvider : Array and click OK. the Bound To field in the Component inspector. In the Bound To dialog box that appears, select DataSet <user_ds> from the Component Path column and then select dataProvider : Array from the Schema Location column. component, select the DataGrid component on the Stage and click the Add Binding (+) button again in the Component inspector.
14. To bind the selected index of the DataSet component to the selected index of the DataGrid

15. In 16.

the dialog box that appears, select selectedIndex : Number. Click OK.
Double-click the Bound To field in the Component inspector to open the Bound To dialog box.
In the Component Path field, select DataSet <user_ds> from the Component Path column and then select selectedIndex : Number from the Schema Location column. Enter the following code in the Actions panel:
next_button.addEventListener("click", nextBtnClick); function nextBtnClick(evt_obj:Object):Void { user_ds.next(); }

The following code calls the applyUpdates() method on the my_ds DataSet.

my_ds.applyUpdates();

The following example adds four items to the my_ds DataSet instance on the Stage and displays each item in the top-level of the deltaPacket property:
my_ds.addItem({name:"Thomas", age:35, gender:"M"}); my_ds.addItem({name:"Orville", age:33, gender:"M"}); my_ds.addItem({name:"Jonathan", age:48, gender:"M"}); my_ds.addItem({name:"Carol", age:31, gender:"F"}); my_ds.applyUpdates(); var i:String; for (i in my_ds.deltaPacket) { trace(i + ":\t" + my_ds.deltaPacket[i]); }

DataSet.deltaPacket

DataSet.calcFields
var listenerObject:Object = new Object(); listenerObject.calcFields = function (eventObj:Object):Void { //. }; dataSetInstance.addEventListener("calcFields", listenerObject);

on (calcFields) { //. }

Event; generated when values of calculated fields for the current item in the collection need to be determined. A calculated field is one whose Kind property is set to Calculated on the Schema tab of the Component inspector. The calcFields event listener that you create should perform the required calculation and set the value for the calculated field. This event is also called when the value of a noncalculated field (that is, a field with its Kind property set to Data on the Schema tab) is updated.
dataSetInstance.changesPending()
Method; returns true if the collection, or any item in the collection, has changes pending that have not yet been sent in a delta packet; otherwise, returns false.
The following code enables a Save Changes button (not shown) if the DataSet collection, or any items with that collection, have had modifications made to them that havent been committed to a delta packet.
my_ds.addItem({name:"Milton", years:3}); my_ds.addItem({name:"Mark", years:3}); my_ds.addItem({name:"Sarah", years:1}); my_ds.addItem({name:"Michael", years:2}); my_ds.addItem({name:"Frank", years:2});

C AU TI ON

Do not change the values of any of noncalculated fields in this event, because this results in an infinite loop. Set only the values of calculated fields within the calcFields event.
my_ds.addEventListener("modelChanged", modelChangedListener); function modelChangedListener(evt_obj:Object):Void { if (evt_obj.target.changesPending()) { trace("changes pending"); submitChanges_button.enabled = true; } } submitChanges_button.enabled = false; my_ds.addItem({name:"Hal", years:4});

Delta.addDeltaItem() Delta.getChangeList() Delta.getDeltaPacket() Delta.getId()
Adds the specified DeltaItem instance. Returns an array of changes made to the current item. Returns the delta packet that contains the delta. Returns the unique ID of the current item within the DeltaPacket collection. Returns the specified DeltaItem object. Returns the message associated with the current item.
Delta.getItemByName() Delta.getMessage()

Delta.getOperation()

Returns the operation that was performed on the current item within the original collection. Returns the transfer object on which the changes were performed.

Delta.getSource()

Delta.addDeltaItem()
delta.addDeltaItem(deltaitem)

deltaitem

DeltaItem instance to add to this delta.
Method; adds the specified DeltaItem instance. If the specified DeltaItem instance already exists, this method replaces it.
The following example calls the addDeltaItem() method:
//. var d:Delta = new DeltaImpl("ID1345678", curItem, DeltaPacketConsts.Added, "", false); d.addDeltaItem(new DeltaItem(DeltaItem.Property, "ID", {oldValue:15, newValue:16})); //.

Delta.getChangeList()

delta.getChangeList()
An array of associated DeltaItem instances.
Method; returns an array of associated DeltaItem instances. Each DeltaItem instance in the array describes a change made to the item.
The following example calls the getChangeList() method.:
//. case mx.data.components.datasetclasses.DeltaPacketConsts.Modified: { // dpDelta is a variable of type Delta. var changes:Array = dpDelta.getChangeList(); for(var i:Number = 0; i<changes.length; i++) { // getChangeMessage is a user-defined method. changeMsg = _parent.getChangeMessage(changes[i]); trace(changeMsg); } //.

Delta.getDeltaPacket()

delta.getDeltaPacket()
The delta packet that contains this delta.
Method; returns the delta packet that contains this delta. This method lets you write code that can handle delta packets generically at the delta level.
The following example uses the getDeltaPacket() method to access the delta packets data source:

The FLVPlayback component includes the FLV Playback Custom UI components. The FLVPlayback component is a combination of the display area, or video player, in which you view the FLV file and the controls that allow you to operate it. The FLV Playback Custom UI components provide control buttons and mechanisms that you can use to play, stop, pause, and otherwise control the FLV file. These controls include the BackButton, BufferingBar, ForwardButton, MuteButton, PauseButton, PlayButton, PlayPauseButton, SeekBar, StopButton, and VolumeBar. The FLVPlayback component and the FLV Playback Custom UI controls appear in the Components panel, as shown in the following figure:
The process of adding playback controls to the FLVPlayback component is called skinning. The FLVPlayback component has an initial default skin, ClearOverPlaySeekMute.swf, that provides transparent controls for the play, seek, and mute functions. To change this skin, you have the following choices:
Select from an collection of predesigned skins Select individual controls from the FLV Playback Custom UI components and customize them Create a custom skin and add it to the collection of predesigned skins
After you select a different skin, the selected skin becomes the new default skin. For more information about selecting or creating a skin for the FLVPlayback component, see Customizing the FLVPlayback component on page 520.
The FLVPlayback component also includes an ActionScript application programming interface (API). The API includes the FLVPlayback, VideoError, and VideoPlayer classes. For more information on these classes, see FLVPlayback class on page 535, the VideoPlayer class on page 702, and the VideoError class on page 694.
Using the FLVPlayback component
Using the FLVPlayback component basically consists of putting it on the Stage and specifying an FLV file for it to play. In addition, however, you can also set various parameters that govern its behavior and describe the FLV file.
Creating an application with the FLVPlayback component
You can include the FLVPlayback component in your application in the following ways:
Drag the FLVPlayback component from the Components panel to the Stage, and specify a value for the contentPath parameter. Use the Video Import wizard to create the component on the Stage, and customize it by selecting a skin. Use the MovieClip attachMovie() method to dynamically create an FLVPlayback instance on the Stage, assuming the component is in the library.
To drag the FLVPlayback component from the Components panel:
Select File > New and choose Flash File (ActionScript 2.0). Drag the FLVPlayback component to the Stage. With the FLVPlayback component selected on the Stage, locate the Value cell for the contentPath parameter in the Parameters tab of the Component inspector, and enter a string that specifies one of the following:

FLVPlayback.bringVideoPlayerToFront(), FLVPlayback.getVideoPlayer(), VideoPlayer class, FLVPlayback.visibleVideoPlayerIndex,
FLVPlayback.addASCuePoint()
my_FLVplybk.addASCuePoint(cuePoint:Object) my_FLVplybk.addASCuePoint(time:Number, name:String[, parameters:Object])
An object having name:String and time:Number (in seconds) properties, which describe the cue point. It also might have a parameters:Object property that holds name/ value pairs. It may have type:String set to "actionscript". If type is missing or set to something else, it is set automatically. If the object does not conform to these conventions, the method throws a VideoError error.

cuePoint time

A number that is the time for the new cue point to be added. If you use the time parameter, the name parameter must follow.
name A string that specifies the name of the cue point if you submit a time parameter instead of the CuePoint object. parameters
Optional parameters for the cue point.
A copy of the cue point object that was added with the following additional properties:
The array of cue points that were searched. Treat this array as read-only, because adding, removing, or editing objects within it can cause cue points to malfunction. The index into the array for the returned cue point.
Method; adds an ActionScript cue point and has the same effect as adding an ActionScript cue point using the Cue Points dialog box, except that it occurs when an application executes rather than during application development. Cue point information is wiped out when the contentPath property is set. To set cue point information for the next FLV file to be loaded, set the contentPath property first. It is valid to add multiple ActionScript cue points with the same name and time. When you remove ActionScript cue points with the removeASCuePoint() method, all cue points with the same name and time are removed.
The following example adds two ActionScript cue points to an FLV file. The example adds the first one using a CuePoint parameter and the second one using the time and name parameters. When each cue point occurs while playing, a listener for cuePoint events shows the value of the playheadTime property in a text area. Drag an FLVPlayback component to the Stage, and give it an instance name of my_FLVPlybk. Drag a TextArea component to the Stage below the FLVPlayback instance, and give it an instance name of my_ta. Then add the following code to the Actions panel on Frame 1 of the Timeline:
/** Requires: - FLVPlayback component on the Stage with an instance name of my_FLVPlybk - TextArea component on the Stage with an instance name of my_ta */ import mx.video.*; my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/ water.flv"; my_ta.visible = false; // create cue point object var cuePt:Object = new Object(); // create cue point object cuePt.time = 2.444; cuePt.name = "ASCuePt1"; cuePt.type = "actionscript"; my_FLVPlybk.addASCuePoint(cuePt); //add AS cue point // add 2nd AS cue point using time and name parameters my_FLVPlybk.addASCuePoint(5, "ASCuePt2"); var listenerObject:Object = new Object(); listenerObject.cuePoint = function(eventObject:Object):Void { my_ta.text = "Elapsed time in seconds: " + my_FLVPlybk.playheadTime; my_ta.visible = true; }; my_FLVPlybk.addEventListener("cuePoint", listenerObject);

/** Requires: - FLVPlayback component on the Stage with an instance name of my_FLVPlybk */ import mx.video.*; var listenerObject:Object = new Object(); listenerObject.playheadUpdate = function(eventObject:Object):Void { trace(my_FLVPlybk.state + ": playhead time is: " + eventObject.playheadTime); }; my_FLVPlybk.addEventListener("playheadUpdate", listenerObject); my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/ water.flv";
FLVPlayback.playheadTime, FLVPlayback.playheadUpdateInterval
my_FLVPlybk.playheadUpdateInterval
Property; a number that is the amount of time, in milliseconds, between each playheadUpdate event. Setting this property while the FLV file is playing restarts the timer. The default is 250. Because ActionScript cue points start on playhead updates, lowering the value of the playheadUpdateInterval property can increase the accuracy of ActionScript cue points. Because the playhead update interval is set by a call to the global setInterval() function, the update cannot fire more frequently than the SWF file frame rate, as with any interval that is set this way. So, as an example, for the default frame rate of 12 frames per second, the lowest effective interval that you can create is approximately 83 milliseconds, or one second (1000 milliseconds) divided by 12.
The following example sets the playheadUpdateInterval property to 3000 and creates a listener that catches occurrences of the playheadUpdate event as it occurs while the FLV file plays. When the event occurs, the event handler shows the elapsed playhead time in the Output panel. Drag an FLVPlayback component to the Stage, and give it an instance name of my_FLVPlybk. Then add the following code to the Actions panel on Frame 1 of the Timeline:
/** Requires: - FLVPlayback component on the Stage with an instance name of my_FLVPlybk */ import mx.video.*; my_FLVPlybk.playheadUpdateInterval = 3000; var listenerObject:Object = new Object(); listenerObject.playheadUpdate = function(eventObject:Object):Void { trace("playhead time is: " + eventObject.playheadTime); };
my_FLVPlybk.addEventListener("playheadUpdate", listenerObject); my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/ water.flv";
FLVPlayback.playheadTime, FLVPlayback.playheadUpdate

FLVPlayback.PLAYING

mx.video.FLVPlayback.PLAYING

The FocusManager and TextField instances are enabled by default.
// Let Focus Manager know mc has children; // this overrides mc.focusEnabled=true; mc.tabChildren=true; mc.tabEnabled=false; // Set the tabbing sequence. txt1.tabIndex = 1; txt2.tabIndex = 2; mc.grid1.tabIndex = 3; mc.txt3.tabIndex = 4; // Set initial focus to txt1. txt1.text = "focus"; focusManager.setFocus(txt1);
If your movie clip doesnt have an onPress or onRelease method or a tabEnabled property, it wont be seen by the Focus Manager unless you set focusEnabled to true. Input text fields are always in the tab scheme unless they are disabled. If a Flash application is playing in a web browser, the application doesnt have focus until a user clicks somewhere in the application. Also, once a user clicks in the Flash application, pressing Tab can cause focus to jump outside the Flash application. To keep tabbing limited to objects inside the Flash application in Flash Player 7 ActiveX control, add the following parameter to the HTML <object> tag:
<param name="SeamlessTabbing" value="false"/>
Creating an application with Focus Manager
The following procedure creates a focus scheme in a Flash application.
To create a focus scheme:
Select File > New and choose Flash File (ActionScript 2.0). Drag the TextInput component from the Components panel to the Stage. In the Property inspector, assign it the instance name comment. Drag the Button component from the Components panel to the Stage. In the Property inspector, assign it the instance name okButton and set the label parameter to OK. In Frame 1 of the Actions panel, enter the following:
comment.tabIndex = 1; okButton.tabIndex = 2; focusManager.setFocus(comment); function click(evt){ trace(evt.type);
} okButton.addEventListener("click", this); 7. 8.
Select Control > Test Movie. Select Control > Disable Keyboard Shortcuts. The code sets the tab ordering. Although the comment field doesnt have an initial focus ring, it has initial focus, so you can start typing in the comment field without clicking in it. Also, you have to select the Disable Keyboard Shortcuts menu option for focus to work properly in test mode.
Customizing Focus Manager
You can change the color of the focus ring in the Halo theme by changing the value of the themeColor style, as in this example:
_global.style.setStyle("themeColor", "haloBlue");
The Focus Manager uses a FocusRect skin for drawing focus. This skin can be replaced or modified and subclasses can override UIComponent.drawFocus to draw custom focus indicators.

FocusManager class (API)

MovieClip > UIObject class > UIComponent class > FocusManager mx.managers.FocusManager
You can use the Focus Manager to specify the order in which components receive focus when a user presses the Tab key to navigate in an application. You can also use the FocusManager class to set a button in your document that receives keyboard input when a user presses Enter (Windows) or Return (Macintosh).

ProgressBar.direction

progressBarInstance.direction
Property; indicates the fill direction for the progress bar. A value of right specifies that the bar will fill from left to right. A value of left specifies that the bar will fill from right to left. The default value is right.
The following code loads a sound object and marks the progress with a progress bar that fills to the left. You must first drag a ProgressBar component from the Components panel to the current documents library; then add the following code to Frame 1 of the main timeline:
/** Requires: - ProgressBar component in library */ System.security.allowDomain("http://www.helpexamples.com"); this.createClassObject(mx.controls.ProgressBar, "my_pb", 20); //Set progress bar attributes my_pb.mode = "polled"; my_pb.source = "my_sound"; my_pb.direction = "left"; //Load sound var my_sound:Sound = new Sound(); my_sound.loadSound("http://www.helpexamples.com/flash/sound/disco.mp3", true);
ProgressBar.indeterminate
progressBarInstance.indeterminate
Property; a Boolean value that indicates whether the progress bar has a striped fill and a loading source of unknown size (true), or a solid fill and a loading source of a known size (false). For example, you might use this property if you are loading a large data set into a SWF file and do not know the size of the data you are loading.
The following code creates an indeterminate progress bar that moves from left to right with a striped fill. You must first drag a Loader component and a ProgressBar component from the Components panel to the current documents library; then add the following code to Frame 1 of the main timeline:
/** Requires: - ProgressBar component in library - Loader component in library */ System.security.allowDomain("http://www.helpexamples.com"); this.createClassObject(mx.controls.ProgressBar, "my_pb", 10); this.createClassObject(mx.controls.Loader, "my_ldr", 20); //Create Listener Object var pbListener:Object = new Object(); pbListener.complete = function(evt_obj:Object) { trace("Height: " + evt_obj.target.height + ", Width: " + evt_obj.target.width);}; //Add Listener my_pb.addEventListener("complete", pbListener); //Set progress bar settings my_pb.mode = "polled";
my_pb.indeterminate = true; my_pb.source = my_ldr; //Set loader settings my_ldr.autoLoad = false; my_ldr.scaleContent = false; my_ldr.move(100, 100) my_ldr.load("http://www.helpexamples.com/flash/images/image1.jpg");

When you add the RadioButton component to an application, you can use the Accessibility panel to make it accessible to screen readers. First, you must add the following line of code to enable accessibility:
mx.accessibility.RadioButtonAccImpl.enableAccessibility();
Using the RadioButton component
A radio button is a fundamental part of any form or web application. You can use radio buttons wherever you want a user to make one choice from a group of options. For example, you would use radio buttons in a form to ask which credit card a customer wants to use.

RadioButton parameters

You can set the following authoring parameters for each RadioButton component instance in the Property inspector or in the Component inspector:
is the value associated with the radio button. There is no default value. is the group name of the radio button. The default value is radioGroup.

Button.

groupName label
sets the value of the text on the button. The default value is Radio
orients the label text on the button. This parameter can be one of four values: left, right, top, or bottom. The default value is right. For more information, see RadioButton.labelPlacement.
labelPlacement selected sets the initial value of the radio button to selected (true) or unselected (false). A selected radio button displays a dot inside it. Only one radio button in a group can have a selected value of true. If more than one radio button in a group is set to true, the radio button that is instantiated last is selected. The default value is false.
You can write ActionScript to set additional options for RadioButton instances using the methods, properties, and events of the RadioButton class. For more information, see RadioButton class on page 1031.
Creating an application with the RadioButton component
The following procedure explains how to add RadioButton components to an application while authoring. In this example, the radio buttons are used to present the yes-or-no question Are you a Flashist?. The data from the radio group is displayed in a TextArea component with the instance name theVerdict.
To create an application with the RadioButton component:

/** Requires: - RadioButton component in library */ import mx.controls.RadioButton; this.createClassObject(RadioButton, "first_rb", 10, {label:"first", groupName:"radioGroup"}); this.createClassObject(RadioButton, "second_rb", 20, {label:"second", groupName:"radioGroup"}); this.createClassObject(RadioButton, "third_rb", 30, {label:"third", groupName:"radioGroup"}); // Position RadioButtons on Stage. second_rb.move(0, first_rb.y + first_rb.height); third_rb.move(0, second_rb.y + second_rb.height); // Create listener object. var rbListener:Object = new Object(); rbListener.click = function(evt_obj:Object){ trace("The selected radio instance is " + evt_obj.target.selection); } // Add listener. radioGroup.addEventListener("click", rbListener);

RadioButton.data

radioButtonInstance.data
Property; specifies the data to associate with a RadioButton instance. Setting this property overrides the data parameter value set during authoring. The data property can be of any data type.
The following example assigns the data value 0xFF00FF and the label #FF00FF to the radio button instance my_rb. It then creates a listener for a click event and displays the buttons data value when a user clicks the button. You first drag a RadioButton component from the Components panel to the current documents library, and then add the following code to Frame 1 of the main timeline:
/** Requires: - RadioButton component in library */ this.createClassObject(mx.controls.RadioButton, "my_rb", 10, {label:"first", groupName:"radioGroup"}); my_rb.data = 0xFF00FF; my_rb.label = "#FF00FF"; var rbListener:Object = new Object(); rbListener.click = function(evt_obj:Object){ trace("The data value for my_rb is " + my_rb.data); } // Add listener. my_rb.addEventListener("click", rbListener);

RadioButton.groupName

radioButtonInstance.groupName radioButtonGroup.groupName
Property; sets the group name for a radio button instance or group. You can use this property to get or set a group name for a radio button instance or for a radio button group. Calling this method overrides the groupName parameter value set during authoring. The default value is "radioGroup".
The following example sets the group name for a group of three radio buttons to myrbGroup. It positions the buttons and then creates a listener for a click event on the radio button group. When the user clicks a radio button, the example displays the groupName property for the button that was clicked. You first drag a RadioButton component from the Components panel to the current documents library, and then add the following code to Frame 1 of the main timeline:

Gets the style property from the style declaration or object. Marks the object so it is redrawn on the next frame interval. Moves the object to the requested position. Forces validation of the object so it is drawn in the current frame. Resizes the object to the requested size. Sets a skin in the object. Sets the style property on the style declaration or object.
The following table lists the methods the UIScrollBar class inherits from the UIComponent class. When calling these methods from the UIScrollBar object, use the form UIScrollBarInstance.methodName.
Property summary for the UIScrollBar class
The following table lists properties of the UIScrollBar class.
UIScrollBar.lineScrollSize
The number of lines or pixels scrolled when the user clicks the arrow buttons of the scroll bar. The number of lines or pixels scrolled when the user clicks the track of the scroll bar. The current scroll position of the scroll bar.
UIScrollBar.pageScrollSize
UIScrollBar.scrollPosition
UIScrollBar._targetInstanceName
The instance name of the text field associated with the UIScrollBar instance. A Boolean value indicating whether the scroll bar is oriented vertically (false), the default, or horizontally (true).

UIScrollBar.horizontal

The following table lists the properties the UIScrollBar class inherits from the UIObject class. When accessing these properties from the UIScrollBar object, use the form UIScrollBarInstance.propertyName.
The following table lists the properties the UIScrollBar class inherits from the UIComponent class. When accessing these properties from the UIScrollBar object, use the form UIScrollBarInstance.propertyName.
Event summary for the UIScrollBar class
The following table lists the event of the UIScrollBar class.

UIScrollBar.scroll

Broadcast when any part of the scroll bar is clicked.
The following table lists the events the UIScrollBar class inherits from the UIObject class.
The following table lists the events the UIScrollBar class inherits from the UIComponent class.
scrollBarInstance.horizontal
Property; indicates whether the scroll bar is oriented vertically (false) or horizontally (true). This property can be tested and set. The default value is false.

 

Technical specifications

Full description

The "ActionScript 2.0 Language Reference for Macromedia Flash 8" is a comprehensive reference manual that describes the application programming interface (API) for Macromedia Flash Player, the most pervasive client runtime environment in the world. It includes valuable syntax and usage information; detailed descriptions of classes, functions, properties, and events; and copy-and-paste code samples for every element in the ActionScript language. The "ActionScript 2.0 Language Reference for Macromedia Flash 8" will help you: - Learn how to use specific APIs efficiently and effectively - Understand the range and variety of functionality ActionScript offers - Repurpose Macromedia-tested code in your own applications Powerful development and design tools require thorough and authoritative technical advice and documentation. When it comes to Macromedia Flash, no one is more authoritative than Macromedia Development and writing teams. Now their official documentation is available to you in printed book form. As you work, keep this guide by your side for ready access to valuable information on using Flash. We've designed it so that it's easy to annotate as you progress.

 

Tags

TT09E Digitech VHM5 DHC-AZ33D CLX-2160N-XAZ D-NE820 EWF1229 ASI66011K P1265 WF-T65a31EC S5 PRO BDP-S1E ES-3024 PT-LB20SU KS700PE FWD-50PX3 NV-GS150GC KX-FL613FX WD-C12115D NV-DS65EGE Ldmpm45 WW TX-DS838 6 5 RTF 1021 MX300 Inkjet 2600 1923H Suunto X10 Ericsson T68I PT-AE700 WRT300N FWM589 22 XS-L1236 Rider Solo Type 2 KD-G710 CPC 6128 Bizhub 20 Systeme 5100 Mouse C-4040zoom ST-17 Dvdr985 UX-F41CL M-629V PMD671 Lansing M602 UN46B8000XF 500 VA Amplifier Force AQV12AWA LX-1050 SGH-X576 RT-1600 RP-3000 TH-42PWD6 TL-SC3000 TX-P42s10B KX-TCD245RU PL-Z91 KDL-32V2000 AR-160 161 FX-95MS NV-HS870 CS-15D V-227N Kardon 430 MZ-R55 SP-P400BX Samsung E258 Silverado-2005 KS-5200HT XR-C900RDS HTS3110 Dbrh198 P2500 SC-50 DMC-FZ3 GD-1700 Review HP962 CS-PA9GKD 37PFL7603D LX-850 RS200SD CC2201 Keynote 3 79-290 Gigaset 1010 Diamondback 3G 766R-serials-602000001-thru 5620Z UR5U-8500L UX-F12CW HS800 VSX-409RDS Silhouette 2000 NV-DS990EG SA-65 825R-41CD825a034 Suunto PM-5

 

manuel d'instructions, Guide de l'utilisateur | Manual de instrucciones, Instrucciones de uso | Bedienungsanleitung, Bedienungsanleitung | Manual de Instruções, guia do usuário | инструкция | návod na použitie, Užívateľská príručka, návod k použití | bruksanvisningen | instrukcja, podręcznik użytkownika | kullanım kılavuzu, Kullanım | kézikönyv, használati útmutató | manuale di istruzioni, istruzioni d'uso | handleiding, gebruikershandleiding

 

Sitemap

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101