Reviews & Opinions
Independent and trusted. Read before buy Macromedia Flash MX 2004 - Actionscript Language Reference!

Macromedia Flash MX 2004 - Actionscript Language Reference


Bookmark
Macromedia Flash MX 2004 - Actionscript Language Reference

Bookmark and Share

 

Macromedia Flash MX 2004 - Actionscript Language ReferenceAbout Macromedia Flash MX 2004 - Actionscript Language Reference
Here you can find all about Macromedia Flash MX 2004 - Actionscript Language Reference like manual and other informations. For example: review.

Macromedia Flash MX 2004 - Actionscript Language Reference manual (user guide) is ready to download for free.

On the bottom of page users can write a review. If you own a Macromedia Flash MX 2004 - Actionscript Language Reference please write about it to help other people.
[ Report abuse or wrong photo | Share your Macromedia Flash MX 2004 - Actionscript 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 MX 2004-actionscript Language Reference, size: 6.9 MB

 

Macromedia Flash MX 2004 - Actionscript Language Reference

 

 

User reviews and opinions

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

No opinions have been provided. Be the first and add a new opinion/review.

 

Documents

doc0

& (bitwise AND), &= (bitwise AND assignment), ^ (bitwise XOR), ^= (bitwise XOR assignment), | (bitwise OR), |= (bitwise OR assignment)

+ (addition)

Flash Player 4; Flash Player 5.In Flash 5 and later, + is either a numeric operator or a string concatenator depending on the data type of the parameter. In Flash 4, + is only a numeric operator. Flash 4 files that are brought into the Flash 5 or later authoring environment undergo a conversion process to maintain data type integrity. The following example illustrates the conversion of a Flash 4 file containing a numeric quality comparison: Flash 4 file:
Converted Flash 5 or later file:
Number(x) + Number(y) Usage expression1 + expression2 Parameters expression1,expression2 Returns

A number or string.

A string, integer, or floating-point number.
Operator; adds numeric expressions or concatenates (combines) strings. If one expression is a string, all other expressions are converted to strings and concatenated. If both expressions are integers, the sum is an integer; if either or both expressions are floatingpoint numbers, the sum is a floating-point number. For more information, see Operator precedence and associativity in Using ActionScript in Flash.
Usage 1: The following example concatenates two strings and displays the result in the Output panel.
var name:String = "Cola"; var instrument:String = "Drums"; trace(name+" plays "+instrument);
// output: Cola plays Drums
Usage 2: This statement adds the integers 2 and 3 and displays the resulting integer, 5, in the Output panel:

trace(2+3); // output: 5

This statement adds the floating-point numbers 2.5 and 3.25 and displays the resulting floatingpoint number, 5.75, in the Output panel
trace(2.5+3.25); // output: 5.75
Usage 3: Variables associated with dynamic and input text fields have the data type String. In the following example, the variable deposit is an input text field on the Stage. After a user enters a deposit amount, the script attempts to add deposit to oldBalance. However, because deposit is a String data type, the script concatenates (combines to form one string) the variable values rather than summing them.
var oldBalance:Number = 1345.23; var currentBalance = deposit_txt.text + oldBalance; trace(currentBalance);
For example, if a user enters 475 in the deposit text field, the trace() statement sends the value 4751345.23 to the Output panel. To correct this, use the Number() function to convert the string to a number, as in the following:
var oldBalance:Number = 1345.23; var currentBalance:Number = Number(deposit_txt.text) + oldBalance; trace(currentBalance);

Usage 1: The following example creates an object, uses it, and deletes it after it is no longer needed:
var account:Object = new Object(); account.name = "Jon"; account.balance = 10000; trace(account.name); delete account; trace(account.name); //output: Jon undefined
Usage 2: The following example deletes a property of an object:
// create the new object "account" var account:Object = new Object(); // assign property name to the account account.name = "Jon"; // delete the property delete account.name;
Usage 3: The following example deletes an object property:
var my_array:Array = new Array(); my_array[0] = "abc"; // my_array.length == 1 my_array[1] = "def"; // my_array.length == 2 my_array[2] = "ghi"; // my_array.length == 3 // my_array[2] is deleted, but Array.length is not changed delete my_array[2]; trace(my_array.length); // output: 3 trace(my_array); // output: abc,def,undefined
Usage 4: The following example shows the behavior of delete on object references:
var ref1:Object = new Object(); ref1.name = "Jody"; // copy the reference variable into a new variable // and delete ref1 ref2 = ref1; delete ref1; trace("ref1.name "+ref1.name); //output: undefined trace("ref2.name "+ref2.name); //output: Jody
If ref1 had not been copied into ref2, the object would have been deleted when ref1 was deleted because there would be no references to it. If you delete ref2, there are no references to the object; it will be destroyed, and the memory it used becomes available.

See also var

do while
Usage do { statement(s) } while (condition) Parameters condition
The condition to evaluate. The statement(s) to execute as long as the condition parameter evaluates

statement(s)

to true.
Statement; similar to a while loop, except that the statements are executed once before the initial evaluation of the condition. Subsequently, the statements are executed only if the condition evaluates to true. A do.while loop ensures that the code inside the loop executes at least once. Although this can also be done with a while loop by placing a copy of the statements to be executed before the while loop begins, many programmers believe that do.while loops are easier to read. If the condition always evaluates to true, the do.while loop is infinite. If you enter an infinite loop, you encounter problems with Flash Player and eventually get a warning message or crash the player. Whenever possible, you should use a for loop if you know the number of times you want to loop. Although for loops are easy to read and debug, they cannot replace do.while loops in all circumstances.

On another frame script, however, you would need to reference classes in that package by their fully qualified names (var myFoo:foo = new macr.util.foo();) or add an import statement to the other frame that imports the classes in that package.
For more information on importing, see Importing classes and Using packages in Using ActionScript in Flash.

#include

Usage #include "[path] filename.as" Note: Do not place a semicolon (;) at the end of the line that contains the #include statement. Parameters [path] filename.as The filename and optional path for the script to add to the Actions panel or to the current script;.as is the recommended filename extension. Returns
Compiler directive: includes the contents of the specified file, as if the commands in the file are part of the calling script. The #include directive is invoked at compile time. Therefore, if you make any changes to an external file, you must save the file and recompile any FLA files that use it. If you use the Check Syntax button for a script that contains #include statements, the syntax of the included files is also checked. You can use #include in FLA files and in external script files, but not in ActionScript 2.0 class files. You can specify no path, a relative path, or an absolute path for the file to be included. If you dont specify a path, the AS file must be in one of the following locations:
The same directory as the FLA file The same directory as the script containing the #include statement The global Include directory, which is one of the following:
Windows 2000 or Windows XP: C:\Documents and Settings\user\Local Settings\ Application Data\Macromedia\Flash MX 2004\language\Configuration\Include Windows 98: C:\Windows\Application Data\Macromedia\Flash MX 2004\ language\Configuration\Include Macintosh OS X: Hard Drive/Users/Library/Application Support/Macromedia/ Flash MX 2004/language/Configuration/Include
The Flash MX 2004 program\language\First Run\Include directory; if you save a file here, it is
copied to the global Include directory the next time you start Flash. To specify a relative path for the AS file, use a single dot (.) to indicate the current directory, two dots (.) to indicate a parent directory, and forward slashes (/) to indicate subdirectories. See the following example section.
To specify an absolute path for the AS file, use the format supported by your platform (Macintosh or Windows). See the following example section. (This usage is not recommended because it requires the directory structure to be the same on any computer that you use to compile the script.)
Note: If you place files in the First Run/Include directory or in the global Include directory, back up these files. If you ever need to uninstall and reinstall Flash, these directories might be deleted and overwritten. Example

Information displays in the Output panel when you press the Caps Lock key. The Output panel displays either true or false, depending on whether the Caps Lock is activated using the isToggled method.

Key.CONTROL

Usage Key.CONTROL:Number Description
Property; constant associated with the key code value for the Control key (17).
function myOnPress() { trace("hello"); } function myOnKeyDown() { // 55 is key code for 7 if (Key.isDown(Key.CONTROL) && Key.getCode() == 55) { Selection.setFocus(my_btn); my_btn.onPress(); } } var myListener:Object = new Object(); myListener.onKeyDown = myOnKeyDown; Key.addListener(myListener); my_btn.onPress = myOnPress; my_btn._accProps.shortcut = "Ctrl+7"; Accessibility.updateProperties();

Key.DELETEKEY

Usage Key.DELETEKEY:Number Description
Property; constant associated with the key code value for the Delete key (46).
The following example lets you draw lines with the mouse pointer using the Drawing API and listener objects. Press the Backspace or Delete key to remove the lines that you draw.
this.createEmptyMovieClip("canvas_mc", this.getNextHighestDepth()); var mouseListener:Object = new Object(); mouseListener.onMouseDown = function() { this.drawing = true; canvas_mc.moveTo(_xmouse, _ymouse); canvas_mc.lineStyle(3, 0x99CC00, 100); }; mouseListener.onMouseUp = function() { this.drawing = false; }; mouseListener.onMouseMove = function() { if (this.drawing) { canvas_mc.lineTo(_xmouse, _ymouse); } updateAfterEvent(); }; Mouse.addListener(mouseListener); // var keyListener:Object = new Object(); keyListener.onKeyDown = function() { if (Key.isDown(Key.DELETEKEY) || Key.isDown(Key.BACKSPACE)) { canvas_mc.clear(); } }; Key.addListener(keyListener);

Key.DOWN

Usage Key.DOWN:Number Description
Property; constant associated with the key code value for the Down Arrow key (40).
The following example moves a movie clip called car_mc a constant distance (10) when you press the arrow keys. A sound plays when you press the Spacebar. Give a sound in the library a linkage identifier of horn_id for this example.
var DISTANCE:Number = 10; var horn_sound:Sound = new Sound(); horn_sound.attachSound("horn_id"); var keyListener_obj:Object = new Object(); keyListener_obj.onKeyDown = function() { switch (Key.getCode()) { case Key.SPACE : horn_sound.start(); break; case Key.LEFT : car_mc._x -= DISTANCE; break; case Key.UP : car_mc._y -= DISTANCE; break; case Key.RIGHT : car_mc._x += DISTANCE; break; case Key.DOWN : car_mc._y += DISTANCE; break; } }; Key.addListener(keyListener_obj);

Key.END

Usage Key.END:Number Description
Property; constant associated with the key code value for the End key (35).

Key.ENTER

Usage Key.ENTER:Number Description

var keyListener:Object = new Object(); keyListener.onKeyDown = function() { trace("The ASCII code for the last key typed is: "+Key.getAscii()); }; Key.addListener(keyListener);
When using this example, make sure that you select Control > Disable Keyboard Shortcuts in the test environment. The following example adds a call to Key.getAscii() to show how the two methods differ. The main difference is that Key.getAscii() differentiates between uppercase and lowercase letters, and Key.getCode() does not.
var keyListener:Object = new Object(); keyListener.onKeyDown = function() { trace("For the last key typed:"); trace("\tThe Key code is: "+Key.getCode()); trace("\tThe ASCII value is: "+Key.getAscii()); trace(""); }; Key.addListener(keyListener);

Key.getCode()

Usage Key.getCode() : Number Parameters
A number; an integer that represents the key code of the last key pressed.
Method; returns the key code value of the last key pressed. To match the returned key code value with the key on a standard keyboard, see Appendix C, Keyboard Keys and Key Code Values. in Using ActionScript in Flash.
The following example calls the getCode() method any time a key is pressed. The example creates a listener object named keyListener and defines a function that responds to the onKeyDown event by calling Key.getCode(). For more information, see Using event listeners in Using ActionScript in Flash. The keyListener object is then registered to the Key object, which broadcasts the onKeyDown message whenever a key is pressed while the SWF file plays.

Key.HOME

Usage Key.HOME:Number Description
Property; constant associated with the key code value for the Home key (36).
The following example attaches a draggable movie clip called car_mc at the x and y coordinates of 0,0. When you press the Home key, car_mc returns to 0,0. Create a movie clip that has a linkage ID car_id, and add the following ActionScript to Frame 1 of the Timeline:
this.attachMovie("car_id", "car_mc", this.getNextHighestDepth(), {_x:0, _y:0}); car_mc.onPress = function() { this.startDrag(); }; car_mc.onRelease = function() { this.stopDrag(); }; var keyListener:Object = new Object(); keyListener.onKeyDown = function() { if (Key.isDown(Key.HOME)) { car_mc._x = 0; car_mc._y = 0; } }; Key.addListener(keyListener);

The following example draws a circle using the mathematical constant pi and the Drawing API.
drawCircle(this, 100, 100, 50); // function drawCircle(mc:MovieClip, x:Number, y:Number, r:Number):Void { mc.lineStyle(2, 0xFF0000, 100); mc.moveTo(x+r, y); mc.curveTo(r+x, Math.tan(Math.PI/8)*r+y, Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y); mc.curveTo(Math.tan(Math.PI/8)*r+x, r+y, x, r+y); mc.curveTo(-Math.tan(Math.PI/8)*r+x, r+y, -Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y); mc.curveTo(-r+x, Math.tan(Math.PI/8)*r+y, -r+x, y); mc.curveTo(-r+x, -Math.tan(Math.PI/8)*r+y, -Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y); mc.curveTo(-Math.tan(Math.PI/8)*r+x, -r+y, x, -r+y); mc.curveTo(Math.tan(Math.PI/8)*r+x, -r+y, Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y); mc.curveTo(r+x, -Math.tan(Math.PI/8)*r+y, r+x, y); }

Math.pow()

Usage Math.pow(x:Number , y:Number) : Number Parameters x y
A number to be raised to a power. A number specifying a power the parameter x is raised to.
Method; computes and returns x to the power of y.
The following example uses Math.pow and Math.sqrt to calculate the length of a line.
this.createEmptyMovieClip("canvas_mc", this.getNextHighestDepth()); var mouseListener:Object = new Object(); mouseListener.onMouseDown = function() { this.origX = _xmouse; this.origY = _ymouse; }; mouseListener.onMouseUp = function() { this.newX = _xmouse; this.newY = _ymouse; var minY = Math.min(this.origY, this.newY); var nextDepth:Number = canvas_mc.getNextHighestDepth(); var line_mc:MovieClip = canvas_mc.createEmptyMovieClip("line"+nextDepth+"_mc", nextDepth); line_mc.moveTo(this.origX, this.origY); line_mc.lineStyle(2, 0x000000, 100); line_mc.lineTo(this.newX, this.newY); var hypLen:Number = Math.sqrt(Math.pow(line_mc._width, 2)+Math.pow(line_mc._height, 2)); line_mc.createTextField("length"+nextDepth+"_txt", canvas_mc.getNextHighestDepth(), this.origX, this.origY-22, 100, 22); line_mc['length'+nextDepth+'_txt'].text = Math.round(hypLen) +" pixels"; }; Mouse.addListener(mouseListener);

Math.random()

Usage Math.random() : Number Parameters
Method; returns a pseudo-random number n, where 0 <= n < 1. The number returned is a pseudo-random number because it is not generated by a truly random natural phenomenon such as radioactive decay.
The following example returns a random number between two specified integers.
function randRange(min:Number, max:Number):Number { var randomNum:Number = Math.round(Math.random()*(max-min))+min; return randomNum; } for (var i = 0; i<25; i++) { trace(randRange(4, 11)); }

Math.round()

Usage Math.round(x:Number) : Number Parameters x

A number; an integer.

Method; rounds the value of the parameter x up or down to the nearest integer and returns the value. If parameter x is equidistant from its two nearest integers (that is, the number ends in.5), the value is rounded up to the next higher integer.

MovieClip._url

MovieClip.useHandCursor

MovieClip._visible

MovieClip._width MovieClip._x MovieClip._xmouse

MovieClip._xscale

MovieClip._y MovieClip._ymouse

MovieClip._yscale

Event handler summary for the MovieClip class
MovieClip.onData MovieClip.onDragOut
Description Invoked when all the data is loaded into a movie clip. Invoked when the mouse button is pressed inside the movie clip area and then rolled outside the movie clip area. Invoked when the mouse pointer is dragged over the movie clip. Invoked continually at the frame rate of the SWF file. The actions associated with the enterFrame event are processed before any frame actions that are attached to the affected frames. Invoked when a key is pressed. Use the Key.getCode() and Key.getAscii() methods to retrieve information about the last key pressed. Invoked when a key is released. Invoked when focus is removed from a movie clip.

MovieClip.onDragOver

MovieClip.onEnterFrame

MovieClip.onKeyDown

MovieClip.onKeyUp MovieClip.onKillFocus

MovieClip.onLoad

Description Invoked when the movie clip is instantiated and appears in the Timeline. Invoked when the left mouse button is pressed. Invoked every time the mouse is moved. Invoked when the left mouse button is released. Invoked when the mouse is pressed while the pointer is over a movie clip. Invoked when the mouse is released while the pointer is over a movie clip. Invoked when the mouse is clicked over a movie clip and released while the pointer is outside the movie clips area. Invoked when the pointer rolls outside of a movie clip area. Invoked when the mouse pointer rolls over a movie clip. Invoked when a movie clip has input focus and a key is released. Invoked in the first frame after the movie clip is removed from the Timeline. The actions associated with the Unload movie clip event are processed before any actions are attached to the affected frame.

The following example attaches the symbol with the linkage identifier circle to the movie clip instance, which is on the Stage in the SWF file:
this.attachMovie("circle", "circle1_mc", this.getNextHighestDepth()); this.attachMovie("circle", "circle2_mc", this.getNextHighestDepth(), {_x:100, _y:100}); See also MovieClip.removeMovieClip(), MovieClip.unloadMovie(), removeMovieClip()

MovieClip.beginFill()

Usage my_mc.beginFill([rgb:Number[, alpha:Number]]) : Void Parameter rgb
A hex color value (for example, red is 0xFF0000, blue is 0x0000FF, and so on). If this value is not provided or is undefined, a fill is not created.
An integer between 0100 that specifies the alpha value of the fill. If this value is not provided, 100 (solid) is used. If the value is less than 0, Flash uses 0. If the value is greater than 100, Flash uses 100.
Method; indicates the beginning of a new drawing path. If an open path exists (that is, if the current drawing position does not equal the previous position specified in a MovieClip.moveTo() method) and it has a fill associated with it, that path is closed with a line and then filled. This is similar to what happens when MovieClip.endFill() is called. You can extend the methods and event handlers of the MovieClip class by creating a subclass. For more information, see Assigning a class to a movie clip symbol in Using ActionScript in Flash.
The following example creates a square with red fill on the Stage.
this.createEmptyMovieClip("square_mc", this.getNextHighestDepth()); square_mc.beginFill(0xFF0000); square_mc.moveTo(10, 10); square_mc.lineTo(100, 10); square_mc.lineTo(100, 100); square_mc.lineTo(10, 100); square_mc.lineTo(10, 10); square_mc.endFill();
An example is also in the drawingapi.fla file in the HelpExamples folder. The following list gives typical paths to this folder:
See also MovieClip.beginGradientFill(), MovieClip.endFill()
MovieClip.beginGradientFill()
Usage my_mc.beginGradientFill(fillType:String, colors:Array, alphas:Array, ratios:Array, matrix:Object) : Void Parameter fillType
Either the string "linear" or the string "radial".
colors An array of RGB hex color values to be used in the gradient (for example, red is 0xFF0000, blue is 0x0000FF, and so on). alphas An array of alpha values for the corresponding colors in the colors array; valid values are 0100. If the value is less than 0, Flash uses 0. If the value is greater than 100, Flash uses 100. ratios An array of color distribution ratios; valid values are 0255. This value defines the percentage of the width where the color is sampled at 100 percent. matrix A transformation matrix that is an object with either of the following two sets of properties.

function Book() { this.setQuantity = function(numBooks:Number):Void { this.books = numBooks; }; this.getQuantity = function():Number { return this.books; }; this.getTitle = function():String { return "Catcher in the Rye"; }; this.addProperty("bookcount", this.getQuantity, this.setQuantity); this.addProperty("bookname", this.getTitle, null); } var myBook = new Book(); myBook.bookcount = 5; trace("You ordered "+myBook.bookcount+" copies of "+myBook.bookname); // output: You ordered 5 copies of Catcher in the Rye
The previous example works, but the properties bookcount and bookname are added to every instance of the Book object, which requires having two properties for every instance of the object. If there are many properties, such as bookcount and bookname, in a class, they could consume a great deal of memory. Instead, you can add the properties to Book.prototype so that the bookcount and bookname properties exist only in one place. The effect, however, is the same as that of the code in the example that added bookcount and bookname directly to every instance. If an attempt is made to access either property in a Book instance, the propertys absence will cause the prototype chain to be ascended until the versions defined in Book.prototype are encountered. The following example shows how to add the properties to Book.prototype:
function Book() {} Book.prototype.setQuantity = function(numBooks:Number):Void { this.books = numBooks; }; Book.prototype.getQuantity = function():Number { return this.books; }; Book.prototype.getTitle = function():String { return "Catcher in the Rye"; };
Book.prototype.addProperty("bookcount", Book.prototype.getQuantity, Book.prototype.setQuantity); Book.prototype.addProperty("bookname", Book.prototype.getTitle, null); var myBook = new Book(); myBook.bookcount = 5; trace("You ordered "+myBook.bookcount+" copies of "+myBook.bookname);
The following example shows how to use the implicit getter and setter functions available in ActionScript 2.0. For more information, see Implicit getter/setter methods in Using ActionScript in Flash.Rather than defining the Book function and editing Book.prototype, you define the Book class in an external file named Book.as. For more information, see Creating and using classes in Using ActionScript in Flash. The following code must be in a separate external file named Book.as that contains only this class definition and resides within the Flash applications classpath:

The target path of the movie clip to drag.
A Boolean value specifying whether the draggable movie clip is locked to the center of the mouse position (true) or locked to the point where the user first clicked the movie clip (false). This parameter is optional. Values relative to the coordinates of the movie clips parent that specify a constraint rectangle for the movie clip. These parameters are optional.
Function; makes the target movie clip draggable while the movie plays. Only one movie clip can be dragged at a time. After a startDrag() operation is executed, the movie clip remains draggable until it is explicitly stopped by stopDrag() or until a startDrag() action for another movie clip is called.
The following example creates a movie clip, pic_mc, at runtime that users can drag to any location by attaching the startDrag() and stopDrag() actions to the movie clip. An image is loaded into pic_mc using the MovieClipLoader class.
var pic_mcl:MovieClipLoader = new MovieClipLoader(); pic_mcl.loadClip("http://www.macromedia.com/devnet/mx/blueprint/articles/ qa_petmarket/spotlight_thale.jpg", this.createEmptyMovieClip("pic_mc", this.getNextHighestDepth())); var listenerObject:Object = new Object(); listenerObject.onLoadInit = function(target_mc) { target_mc.onPress = function() { startDrag(this); }; target_mc.onRelease = function() { stopDrag(); }; }; pic_mcl.addListener(listenerObject); See also MovieClip._droptarget, MovieClip.startDrag(), stopDrag()

static

Usage class someClassName{ static var name; static function name() { // your statements here } } Note: To use this keyword, you must specify ActionScript 2.0 and Flash Player 6 or later in the Flash tab of your FLA files Publish Settings dialog box. This keyword is supported only when used in external script files, not in scripts written in the Actions panel. Parameters name
The name of the variable or function that you want to specify as static.
Keyword; specifies that a variable or function is created only once per class rather than being created in every object based on that class. For more information, see Instance and class members in Using ActionScript in Flash. You can access a static class member without creating an instance of the class by using the syntax someClassName.name. If you do create an instance of the class, you can also access a static member using the instance. You can use this keyword in class definitions only, not in interface definitions.

String.lastIndexOf()

Usage my_str.lastIndexOf(substring:String, [startIndex:Number]) : Number Parameters substring startIndex substring. Returns
String; the string for which to search. Number; an optional integer specifying the starting point from which to search for
A number; the position of the last occurrence of the specified substring or -1.
Method; searches the string from right to left and returns the index of the last occurrence of substring found before startIndex within the calling string. This index is zero-based, meaning that the first character in a string is considered to be at index 0not index 1. If substring is not found, the method returns -1.
The following example shows how to use lastIndexOf() to return the index of a certain character:
var searchString:String = "Lorem ipsum dolor sit amet."; var index:Number; index = searchString.lastIndexOf("L"); trace(index); // output: 0 index = searchString.lastIndexOf("l"); trace(index); // output: 14 index = searchString.lastIndexOf("i"); trace(index); // output: 19 index = searchString.lastIndexOf("ipsum"); trace(index); // output: 6 index = searchString.lastIndexOf("i", 18); trace(index); // output: 6 index = searchString.lastIndexOf("z"); trace(index); // output: -1 See also String.indexOf()
Usage my_str.length:Number Description
Property; an integer specifying the number of characters in the specified String object. Because all string indexes are zero-based, the index of the last character for any string x is x.length - 1.
The following example creates a new String object and uses String.length to count the number of characters:
var my_str:String = "Hello world!"; trace(my_str.length); // output: 12
The following example loops from 0 to my_str.length. The code checks the characters within a string, and if the string contains the @ character, true displays in the Output panel. If it does not contain the @ character, then false displays in the Output panel.
function checkAtSymbol(my_str:String):Boolean { for (var i = 0; i<my_str.length; i++) { if (my_str.charAt(i) == "@") { return true; } } return false; } trace(checkAtSymbol("dog@house.net")); // output: true trace(checkAtSymbol("Chris")); // output: false
An example is also in the Strings.fla file in the HelpExamples folder. The following list gives typical paths to this folder:

String.slice()

Notice that any text inserted manually by the user, or replaced by means of TextField.replaceSel(), receives the text field's default formatting for new text, and not the formatting specified for the text insertion point. To set a text fields default formatting for new text, use TextField.setNewTextFormat().
The following example sets the text format for two different strings of text. The setTextFormat() method is called and applied to the my_txt text field.
var format1_fmt:TextFormat = new TextFormat(); format1_fmt.font = "Arial"; var format2_fmt:TextFormat = new TextFormat(); format2_fmt.font = "Courier"; var string1:String = "Sample string number one."+newline; var string2:String = "Sample string number two."+newline; this.createTextField("my_txt", this.getNextHighestDepth(), 0, 0, 300, 200); my_txt.multiline = true; my_txt.wordWrap = true; my_txt.text = string1; var firstIndex:Number = my_txt.length; my_txt.text += string2; var secondIndex:Number = my_txt.length; my_txt.setTextFormat(0, firstIndex, format1_fmt); my_txt.setTextFormat(firstIndex, secondIndex, format2_fmt); See also
TextField.setNewTextFormat(), TextFormat class

TextField.styleSheet

Usage my_txt.styleSheet = TextField StyleSheet Description
Property; attaches a style sheet to the text field specified by my_txt. For information on creating style sheets, see the TextField.StyleSheet class entry and Formatting text with Cascading Style Sheets in Using ActionScript in Flash. The style sheet associated with a text field may be changed at any time. If the style sheet in use is changed, the text field is redrawn using the new style sheet. The style sheet may be set to null or undefined to remove the style sheet. If the style sheet in use is removed, the text field is redrawn without a style sheet. The formatting done by a style sheet is not retained if the style sheet is removed.
The following example creates a new text field at runtime, called news_txt. Three buttons on the Stage, css1_btn, css2_btn and clearCss_btn, are used to change the style sheet that is applied to news_txt, or clear the style sheet from the text field. Add the following ActionScript to your FLA or AS file:
this.createTextField("news_txt", this.getNextHighestDepth(), 0, 0, 300, 200); news_txt.wordWrap = true; news_txt.multiline = true; news_txt.html = true; var newsText:String = "<p class='headline'>Description</p> Method; starts loading the CSS file into styleSheet. The load operation is asynchronous; use the <span class='bold'>TextField.StyleSheet.onLoad</span> callback handler to determine when the file has finished loading. <span class='important'>The CSS file must reside in exactly the same domain as the SWF file that is loading it.</span> For more information about restrictions on loading data across domains, see Flash Player security features."; news_txt.htmlText = newsText; css1_btn.onRelease = function() { var styleObj:TextField.StyleSheet = new TextField.StyleSheet(); styleObj.onLoad = function(success:Boolean) { if (success) { news_txt.styleSheet = styleObj; news_txt.htmlText = newsText; } }; styleObj.load("styles.css"); }; css2_btn.onRelease = function() { var styleObj:TextField.StyleSheet = new TextField.StyleSheet(); styleObj.onLoad = function(success:Boolean) {

Usage condition1 and condition2 Parameters condition1,condition2 Returns
Conditions or expressions that evaluate to true or false.
Operator; performs a logical AND (&&) operation in Flash Player 4. If both expressions evaluate to true, the entire expression is true.
See also && (logical AND)

and 1073

Button._highquality
Flash Player 6. The global version of this function was deprecated in Flash 5 in favor of _quality.
Usage my_btn._highquality:Number Description
Property (global); specifies the level of anti-aliasing applied to the current SWF file. Specify 2 (best quality) to apply high quality with bitmap smoothing always on. Specify 1 (high quality) to apply anti-aliasing; this smooths bitmaps if the SWF file does not contain animation and is the default value. Specify 0 (low quality) to prevent anti-aliasing.
Add a button instance on the Stage and name it myBtn_btn. Draw an oval on the Stage using the Oval tool that has a stroke and fill color. Select Frame 1 and add the following ActionScript using the Actions panel:
myBtn_btn.onRelease = function(){ myBtn_btn._highquality = 0; };
When you click myBtn_btn, the circles stroke will look jagged. You could add the following ActionScript instead to affect the SWF globally:
_highquality = 0; See also _quality

call()

Flash Player 4. This action was deprecated in Flash 5 in favor of the function statement.
Usage call(frame) Parameters frame Returns
The label or number of a frame in the Timeline.
Action; executes the script in the called frame without moving the playhead to that frame. Local variables do not exist after the script executes.
If variables are not declared inside a block ({}) but the action list was executed with a call()
action, the variables are local and expire at the end of the current list.
If variables are not declared inside a block and the current action list was not executed with the
call() See also function, Function.call()
action, the variables are interpreted as Timeline variables.

call() 1075

Flash Player 4. This function was deprecated in Flash 5 in favor of String.fromCharCode().
Usage chr(number) Parameters number Returns

An ASCII code number.

String function; converts ASCII code numbers to characters.
The following example converts the number 65 to the letter A and assigns it to the variable myVar:
myVar = chr(65); See also String.fromCharCode()
eq (equal string specific)
Flash Player 4. This operator was deprecated in Flash 5 in favor of the == (equality) operator.

doc1

You can set breakpoints in the Actions panel or in the Debugger. (To set breakpoints in external scripts, you must use the Debugger.) Breakpoints set in the Actions panel are saved with the Flash document (FLA file). Breakpoints set in the Debugger are not saved in the FLA file and are valid only for the current debugging session.
To set or remove a breakpoint in the Actions panel, do one of the following:
Click in the left margin. A red dot indicates a breakpoint. Click the Debug options button above the Script pane. Right-click (Windows) or Control-click (Macintosh) to display the context menu, and select
Breakpoint, Remove Breakpoint, or Remove All Breakpoints. Press Control+Shift+B (Windows) or Command+Shift+B (Macintosh).
Note: In previous versions of Flash, clicking in the left margin of the Script pane selected the line of code; now it adds or removes a breakpoint. To select a line of code, use Control-click (Windows) or Command-click (Macintosh). To set and remove breakpoints in the Debugger, do one of the following:
Click in the left margin. A red dot indicates a breakpoint. Click the Toggle Breakpoint or Remove All Breakpoints button above the code view. Right-click (Windows) or Control-click (Macintosh) to display the context menu, and select
Breakpoint, Remove Breakpoint, or Remove All Breakpoints. Press Control+Shift+B (Windows) or Command+Shift+B (Macintosh). Once Flash Player is stopped at a breakpoint, you can step into, step over, or step out of that line of code. If you set a breakpoint in a comment or on an empty line in the Actions panel, the breakpoint is ignored.
Stepping through lines of code When you start a debugging session, Flash Player is paused. If you set breakpoints in the Actions panel, you can simply click the Continue button to play the SWF file until it reaches a breakpoint. For example, in the following code, suppose a breakpoint is set inside a button on the line myFunction():
on(press){ myFunction(); }
When you click the button, the breakpoint is reached and Flash Player pauses. You can now step in to bring the Debugger to the first line of myFunction() wherever it is defined in the document. You can also step through or out of the function. If you didnt set breakpoints in the Actions panel, you can use the jump menu in the Debugger to select any script in the movie. Once youve selected a script, you can add breakpoints to it. After adding breakpoints, you must click the Continue button to start the movie. The Debugger stops when it reaches the breakpoint.
As you step through lines of code, the values of variables and properties change in the Watch list and in the Variables, Locals, and Properties tabs. A yellow arrow along the left side of the Debuggers code view indicates the line at which the Debugger stopped. Use the following buttons along the top of the code view:

In this case, the variable named nextDepth contains the value 11, because thats the next highest available depth for the movie clip menus_mc. To obtain the current highest occupied depth, subtract 1 from the value returned by getNextHighestDepth(), as shown in the next section (see Determining the instance at a particular depth on page 130). Determining the instance at a particular depth To determine the instance at particular depth, use MovieClip.getInstanceAtDepth(). This method returns a reference to the instance at the specified depth. The following code combines getNextHighestDepth() and getInstanceAtDepth() to determine the movie clip at the (current) highest occupied depth on the root Timeline.
var highestOccupiedDepth = _root.getNextHighestDepth() - 1; var instanceAtHighestDepth = _root.getInstanceAtDepth(highestOccupiedDepth);
For more information, see MovieClip.getInstanceAtDepth() on page 503. Determining the depth of an instance To determine the depth of a movie clip instance, use MovieClip.getDepth(). The following code iterates over all the movie clips on a SWF files main Timeline and displays each clips instance name and depth value in the Output panel.
for(each in _root) { var obj = _root[each]; if(obj instanceof MovieClip) { var objDepth = obj.getDepth(); trace(obj._name + ":" + objDepth) } }
For more information, see MovieClip.getDepth() on page 503. Swapping movie clip depths To swap the depths of two movie clips on the same Timeline, use MovieClip.swapDepths(). For more information, see MovieClip.swapDepths() on page 535.
Drawing shapes with ActionScript
You can use methods of the MovieClip class to draw lines and fills on the Stage. This allows you to create drawing tools for users and to draw shapes in the movie in response to events. The drawing methods are beginFill(), beginGradientFill(), clear(), curveTo(), endFill(), lineTo(), lineStyle(), and moveTo(). You can use the drawing methods with any movie clip. However, if you use the drawing methods with a movie clip that was created in authoring mode, the drawing methods execute before the clip is drawn. In other words, content that is created in authoring mode is drawn on top of content drawn with the drawing methods. You can use movie clips with drawing methods as masks; however, as with all movie clip masks, strokes are ignored.

the field.

Using HTML-formatted text
Flash Player supports a subset of standard HTML tags such as <p> and <li> that you can use to style text in any dynamic or input text field. Text fields in Flash Player 7 and later also support the <img> tag, which lets you embed JPEG files, SWF files, and movie clips in a text field. Flash Player automatically wraps text around images embedded in text fields in much the same way a web browser wraps text around embedded images in an HTML page. For more information, see Embedding images, SWF files, and movie clips in text fields on page 152. Flash Player also supports the <textformat> tag, which lets you apply paragraph formatting styles of the TextFormat class to HTML-enabled text fields. For more information, see Using the TextFormat class on page 137. Overview of using HTML-formatted text To use HTML in a text field, you must enable the text fields HTML formatting either by selecting the Render Text as HTML option in the Property inspector, or by setting the text fields html property to true. To insert HTML into a text field, use the TextField.htmlText property. For example, the following code enables HTML formatting for a text field named headline_txt, and then assigns some HTML to the text field.
headline_txt.html = true; headline_txt.htmlText = "<font face='Times New Roman' size='24'>This is how you assign HTML text to a text field.</font>";
Attributes of HTML tags must be enclosed in double or single quotation marks. Attribute values without quotation marks may produce unexpected results, such as improper rendering of text. For example, the following HTML snippet will not be rendered properly by Flash Player because the value assigned to the align attribute (left) is not enclosed in quotation marks:
textField.htmlText = "<p align=left>This is left-aligned text</p>";
If you enclose attribute values in double quotation marks, you must escape the quotation marks (\"). For example, either of the following are acceptable:
textField.htmlText = "<p align='left'>This uses single quotes</p>"; textField.htmlText = "<p align=\"left\">This uses escaped double quotes</p>";
Its not necessary to escape double quotation marks if youre loading text from an external file; its only necessary if youre assigning a string of text in ActionScript.
Supported HTML tags This section lists the built-in HTML tags supported by Flash Player. You can also create new styles and tags using Cascading Style Sheets; see Formatting text with Cascading Style Sheets on page 139. Anchor tag (<a>) The <a> tag creates a hyperlink and supports the following attributes:

onClipEvent(data) { goToAndPlay(lastFrameVisited); }
If you use the XML.load(), XML.sendAndLoad(), and XMLSocket.connect() methods, you should define a handler that will process the data when it arrives. This handler is a property of an XML or XMLSocket object to which you assign a function you have defined. The handlers are called automatically when the information is received. For the XML object, use XML.onLoad() or XML.onData(). For the XMLSocket object, use XMLSocket.onConnect().
Chapter 10: Working with External Data
For more information, see Using the XML class on page 181 and Using the XMLSocket class on page 184. Using HTTP to connect to server-side scripts The loadVariables(), loadVariablesNum(), getURL(), loadMovie(), and loadMovieNum() functions and the MovieClip.loadVariables(), MovieClip.loadMovie(), and MovieClip.getURL() methods can all communicate with server-side scripts over HTTP or HTTPS protocols. These functions send all the variables from the Timeline to which the function is attached. When used as methods of the MovieClip object, loadVariables(), getURL(), and loadMovie() send all the variables of the specified movie clip; each function (or method) handles its response as follows:
returns any information to a browser window, not to Flash Player. loadVariables() loads variables into a specified Timeline or level in Flash Player. loadMovie() loads a SWF file into a specified level or movie clip in Flash Player.

getURL()

When you use loadVariables(), getURL(), or loadMovie(), you can specify several parameters:
is the file in which the remote variables reside. Location is the level or target in the SWF file that receives the variables. (The getURL() function does not take this parameter.) For more information about levels and targets, see About multiple Timelines and levels in Using Flash Help. Variables sets the HTTP method, either GET or POST, by which the variables will be sent. When omitted, Flash Player defaults to GET, but no variables are sent.
For example, if you wanted to track the high scores for a game, you could store the scores on a server and use loadVariables() to load them into the SWF file each time someone played the game. The function call might look like this:
loadVariables("http://www.mySite.com/scripts/high_score.php", _root.scoreClip, GET);
This loads variables from the PHP script called high_score.php into the movie clip instance scoreClip using the GET HTTP method. Any variables loaded with the loadVariables() function must be in the standard MIME format application/x-www-form-urlencoded (a standard format used by CGI scripts). The file you specify in the URL parameter of loadVariables() must write out the variable and value pairs in this format so that Flash can read them.This file can specify any number of variables; variable and value pairs must be separated with an ampersand (&), and words within a value must be separated with a plus (+). For example, this phrase defines several variables:

Event handler; invoked when a button is released. You must define a function that executes when the event handler is invoked.
In the following example, a function that sends a trace() action to the Output panel is defined for the onRelease handler.
my_btn.onRelease = function () { trace ("onRelease called"); };

Button.onReleaseOutside

Usage my_btn.onReleaseOutside = function() { // your statements here } Parameters
Event handler; invoked when the mouse is released while the pointer is outside the button after the button is pressed while the pointer is inside the button. You must define a function that executes when the event handler is invoked.
In the following example, a function that sends a trace() action to the Output panel is defined for the onReleaseOutside handler.
my_btn.onReleaseOutside = function () { trace ("onReleaseOutside called"); };

Button.onRollOut

Usage my_btn.onRollOut = function() { // your statements here } Parameters
Event handler; invoked when the pointer moves outside a button area. You must define a function that executes when the event handler is invoked.
In the following example, a function that sends a trace() action to the Output panel is defined for the onRollOut handler.
my_btn.onRollOut = function () { trace ("onRollOut called"); };

Button.onRollOver

Usage my_btn.onRollOver = function() { // your statements here } Parameters
Event handler; invoked when the pointer moves over a button area. You must define a function that executes when the event handler is invoked.
In the following example, a function that sends a trace() action to the Output panel is defined for the onRollOver handler.
my_btn.onRollOver = function () { trace ("onRollOver called"); };

Button.onSetFocus

Usage my_btn.onSetFocus = function(oldFocus){ // your statements here } Parameters oldFocus Returns
The object to lose keyboard focus.
Event handler; invoked when a button receives keyboard focus. The oldFocus parameter is the object that loses the focus. For example, if the user presses the Tab key to move the input focus from a text field to a button, oldFocus contains the text field instance. If there is no previously focused object, oldFocus contains a null value.

Button._parent

Usage my_btn._parent.property _parent.property Description
Property; a reference to the movie clip or object that contains the current movie clip or object. The current object is the one containing the ActionScript code that references _parent. Use _parent to specify a relative path to movie clips or objects that are above the current movie clip or object. You can use _parent to climb up multiple levels in the display list as in the following:

Button._xscale, Button._y, Button._yscale

Button._xmouse

Usage my_btn._xmouse Description
Property (read-only); returns the x coordinate of the mouse position relative to the button.

Button._ymouse

Button._xscale
Usage my_btn._xscale Description
Property; the horizontal scale of the button as applied from the registration point of the button, expressed as a percentage. The default registration point is (0,0). Scaling the local coordinate system affects the _x and _y property settings, which are defined in pixels. For example, if the parent movie clip is scaled to 50%, setting the _x property moves an object in the button by half the number of pixels as it would if the SWF file were at 100%.
Button._x, Button._y, Button._yscale

Button._y

Usage my_btn._y Description
Property; the y coordinate of the button relative to the local coordinates of the parent movie clip. If a button is in the main Timeline, its coordinate system refers to the upper left corner of the Stage as (0, 0). If the button is inside another movie clip that has transformations, the button is in the local coordinate system of the enclosing movie clip. Thus, for a movie clip rotated 90 degrees counterclockwise, the enclosed button inherits a coordinate system that is rotated 90 degrees counterclockwise. The buttons coordinates refer to the registration point position.
Button._x, Button._xscale, Button._yscale
Usage my_btn._ymouse Description
Property (read-only); indicates the y coordinate of the mouse position relative to the button.

Button._yscale

Usage my_btn._yscale Description
Property; the vertical scale of the button as applied from the registration point of the button, expressed as a percentage. The default registration point is (0,0).
Button._y, Button._x, Button._xscale

call()

Flash Player 4. This action was deprecated in Flash 5, and Macromedia recommends that you use the function action instead.

If a matrixType property does not exist then the remaining parameters are all required; the function fails if any of them are missing. This matrix scales, translates, rotates, and skews the unit gradient, which is defined at (-1,-1) and (1,1).
matrixType, x, y, w, h, r.
The properties indicate the following: matrixType is the string "box", x is the horizontal position relative to the registration point of the parent clip for the upper left corner of the gradient, y is the vertical position relative to the registration point of the parent clip for the upper left corner of the gradient, w is the width of the gradient, h is the height of the gradient, and r is the rotation in radians of the gradient. The following example uses a beginGradientFill() method with a matrix parameter that is an object with these properties.
_root.createEmptyMovieClip( "grad", 1 ); with ( _root.grad ) { colors = [ 0xFF0000, 0x0000FF ]; alphas = [ 100, 100 ]; ratios = [ 0, 0xFF ]; matrix = { matrixType:"box", x:100, y:100, w:200, h:200, r:(45/ 180)*Math.PI }; beginGradientFill( "linear", colors, alphas, ratios, matrix ); moveto(100,100); lineto(100,300); lineto(300,300); lineto(300,100); lineto(100,100); endFill(); }
If a matrixType property exists then it must equal "box" and the remaining parameters are all required. The function fails if any of these conditions are not met.
Method; indicates the beginning of a new drawing path. If the first parameter is undefined, or if no parameters are passed, the path has no fill. If an open path exists (that is if the current drawing position does not equal the previous position specified in a moveTo() method), and it has a fill associated with it, that path is closed with a line and then filled. This is similar to what happens when you call endFill(). This method fails if any of the following conditions exist:
The number of items in the colors, alphas, and ratios parameters are not equal. The fillType parameter is not linear or radial. Any of the fields in the object for the matrix parameter are missing or invalid.
The following code uses both methods to draw two stacked rectangles with a red-blue gradient fill and a 5-pt. solid green stroke.
_root.createEmptyMovieClip("goober",1); with ( _root.goober ) { colors = [ 0xFF0000, 0x0000FF ]; alphas = [ 100, 100 ]; ratios = [ 0, 0xFF ]; lineStyle( 5, 0x00ff00 ); matrix = { a:500,b:0,c:0,d:0,e:200,f:0,g:350,h:200,i:1}; beginGradientFill( "linear", colors, alphas, ratios, matrix ); moveto(100,100); lineto(100,300); lineto(600,300); lineto(600,100); lineto(100,100); endFill(); matrix = { matrixType:"box", x:100, y:310, w:500, h:200, r:(0/180)*Math.PI }; beginGradientFill( "linear", colors, alphas, ratios, matrix ); moveto(100,310); lineto(100,510); lineto(600,510); lineto(600,310); lineto(100,310); endFill(); }

Number.MIN_VALUE

Number.NaN
Number.NEGATIVE_INFINITY Constant representing the value for negative infinity. Number.POSITIVE_INFINITY Constant representing the value for positive infinity. This value is the same as the global variable Infinity.
Constructor for the Number class
Usage new Number(value) Parameters value Returns
The numeric value of the Number object being created, or a value to be converted to a number.
Constructor; creates a new Number object. You must use the Number constructor when using Number.toString() and Number.valueOf(). You do not use a constructor when using the properties of a Number object. The new Number constructor is primarily used as a placeholder. A Number object is not the same as the Number() function that converts a parameter to a primitive value.
The following code constructs new Number objects.
n1 = new Number(3.4); n2 = new Number(-10); See also Number()
Usage Number.MAX_VALUE Description
Property; the largest representable number (double-precision IEEE-754). This number is approximately 1.79E+308.
Usage Number.MIN_VALUE Description
Property; the smallest representable number (double-precision IEEE-754). This number is approximately 5e-324.
Usage Number.NaN Description
Property; the IEEE-754 value representing Not A Number (NaN).

See also isNaN(), NaN

Number.NEGATIVE_INFINITY
Usage Number.NEGATIVE_INFINITY Description
Property; specifies the IEEE-754 value representing negative infinity. The value of this property is the same as that of the constant -Infinity. Negative infinity is a special numeric value that is returned when a mathematical operation or function returns a negative value larger than can be represented.

Number.POSITIVE_INFINITY

Usage Number.POSITIVE_INFINITY Description
Property; specifies the IEEE-754 value representing positive infinity. The value of this property is the same as that of the constant Infinity. Positive infinity is a special numeric value that is returned when a mathematical operation or function returns a value larger than can be represented.

Number.toString()

Usage myNumber.toString(radix) Parameters radix Returns
Specifies the numeric base (from 2 to 36) to use for the number-to-string conversion. If you do not specify the radix parameter, the default value is 10.
Method; returns the string representation of the specified Number object (myNumber). If myNumber is undefined, the return value is as follows:
In files published for Flash Player 6 or earlier, the result is 0. In files published for Flash Player 7 or later, the result is NaN.
The following example uses 2 and 8 for the radix parameter and returns a string that contains the corresponding representation of the number 9.

System.capabilities.playerType
Usage System.capabilities.playerType Description
Property; a string that indicates the type of player. This property can have the value "StandAlone", "External", "PlugIn", or "ActiveX". The server string is PT.
Usage System.capabilities.screenColor Description
Property; indicates whether the screen is color (color), grayscale (gray), or black and white (bw). The server string is COL.
Usage System.capabilities.screenDPI Description
Property; indicates the dots-per-inch (dpi) resolution of the screen, in pixels. The server string is DP.
System.capabilities.screenResolutionX
Usage System.capabilities.screenResolutionX Description
Property; an integer that indicates the maximum horizontal resolution of the screen. The server string is R (which returns both the width and height of the screen).
System.capabilities.screenResolutionY
Usage System.capabilities.screenResolutionY Description
Property; an integer that indicates the maximum vertical resolution of the screen. The server string is R (which returns both the width and height of the screen).
Usage System.capabilities.serverString Description
Property; a URL-encoded string that specifies values for each System.capabilities property, as in this example:
A=t&SA=t&SV=t&EV=t&MP3=t&AE=t&VE=t&ACC=f&PR=t&SP=t&SB=f&DEB=t&V=WIN%207%2C0%2C 0%2C226&M=Macromedia%20Windows&R=1152x864&DP=72&COL=color&AR=1.0&OS=Windows%20 XP&L=en&PT=External&AVD=f&LFD=f
Usage System.capabilities.version Description
Property; a string containing the Flash Player platform and version information, for example, "WIN 7,0,0,231". The server string is V.

System.security object

This object contains methods that specify how SWF files in different domains can communicate with each other. Method summary for the System.security object
System.security.allowDomain()
Description Allows SWF files in the identified domains to access objects and variables in the calling SWF file, or in any other SWF file from the same domain as the calling SWF file. objects and variables in the calling SWF file, which is hosted using the HTTPS protocol.
System.security.allowInsecureDomain() Allows SWF files in the identified domains to access
Usage System.security.allowDomain("domain1", "domain2,. domainN") Parameters domain1, domain2,. domainN Strings that specify domains that can access objects and variables in the file containing the System.Security.allowDomain() call. The domains can be formatted in the following ways:

"domain.com" "http://domain.com" "http://IPaddress"
Method; allows SWF files in the identified domains to access objects and variables in the calling SWF file, or in any other SWF file from the same domain as the calling SWF file. In files playing back in Flash Player 7 or later, the parameter(s) passed must follow exact-domain naming rules. For example, to allow access by SWF files hosted at either www.domain.com or store.domain.com, both domain names must be passed:
// For Flash Player 6 System.security.allowDomain("domain.com"); // Corresponding commands to allow access by SWF files // that are running in Flash Player 7 or later System.security.allowDomain("www.domain.com". "store.domain.com");
Also, for files running in Flash Player 7 or later, you cant use this method to allow SWF files hosted using a secure protocol (HTTPS) to permit access from SWF files hosted in nonsecure protocols; you must use System.security.allowInsecureDomain() instead.
The SWF file located at www.macromedia.com/MovieA.swf contains the following lines.
System.security.allowDomain("www.shockwave.com"); loadMovie("http://www.shockwave.com/MovieB.swf", _root.my_mc);
Because MovieA contains the allowDomain() command, MovieB can access the objects and variables in MovieA. If MovieA didnt contain this command, the Flash security implementation would prevent MovieA from accessing MovieBs objects and variables.
System.security.allowInsecureDomain()
Usage System.Security.allowInsecureDomain("domain") Parameters domain An exact domain name, such as www.myDomainName.com or store.myDomainName.com. Returns
Method; allows SWF files in the identified domains to access objects and variables in the calling SWF file, which is hosted using the HTTPS protocol. By default, SWF files hosted using the HTTPS protocol can be accessed only by other SWF files hosted using the HTTPS protocol. This implementation maintains the integrity provided by the HTTPS protocol. Macromedia does not recommend using this method to override the default behavior because it compromises HTTPS security. However, you may need to do so, for example, if you must permit access to HTTPS files published for Flash Player 7 or later from HTTP files published for Flash Player 6. A SWF file published for Flash Player 6 can use System.security.allowDomain() to permit HTTP to HTTPS access. However, because security is implemented differently in Flash Player 7, you must use System.Security.allowInsecureDomain() to permit such access in SWF files published for Flash Player 7 or later.

See also TextField._xscale, TextField._y, TextField._yscale

TextField._xmouse

Usage my_txt._xmouse Description
Property (read-only); returns the x coordinate of the mouse position relative to the text field.
See also TextField._ymouse
Usage my_txt._xscale Description
Property; determines the horizontal scale of the text field as applied from the registration point of the text field, expressed as a percentage. The default registration point is (0,0).
See also TextField._x, TextField._y, TextField._yscale

TextField._y

Usage my_txt._y Description
Property; the y coordinate of a text field relative to the local coordinates of the parent movie clip. If a text field is in the main Timeline, then its coordinate system refers to the upper left corner of the Stage as (0, 0). If the text field is inside another movie clip that has transformations, the text field is in the local coordinate system of the enclosing movie clip. Thus, for a movie clip rotated 90 degrees counterclockwise, the enclosed text field inherits a coordinate system that is rotated 90 degrees counterclockwise. The text fields coordinates refer to the registration point position.
See also TextField._x, TextField._xscale, TextField._yscale

TextField._ymouse

Usage my_txt._ymouse Description
Property (read-only); indicates the y coordinate of the mouse position relative to the text field.
See also TextField._xmouse
Usage my_txt._yscale Description
Property; the vertical scale of the text field as applied from the registration point of the text field, expressed as a percentage. The default registration point is (0,0).
See also TextField._x, TextField._xscale, TextField._y
The TextFormat class represents character formatting information. You must use the constructor new TextFormat() to create a TextFormat object before calling its methods. You can set TextFormat parameters to null to indicate that they are undefined. When you apply a TextFormat object to a text field using TextField.setTextFormat(), only its defined properties are applied, as in the following example:
my_fmt = new TextFormat(); my_fmt.bold = true; my_txt.setTextFormat(my_fmt);
This code first creates an empty TextFormat object with all of its properties undefined, then sets the bold property to a defined value.
The code my_txt.setTextFormat(my_fmt) only changes the bold property of the text fields default text format, because the bold property is the only one defined in my_fmt. All other aspects of the text fields default text format remain unchanged. When TextField.getTextFormat() is invoked, a TextFormat object is returned with all of its properties defined; no property is null. Method summary for the TextFormat class

TextFormat.bullet

Usage my_fmt.bullet Description
Property; a Boolean value that indicates that the text is part of a bulleted list. In a bulleted list, each paragraph of text is indented. To the left of the first line of each paragraph, a bullet symbol is displayed. The default value is null.

TextFormat.color

Usage my_fmt.color Description
Property; indicates the color of text. A number containing three 8-bit RGB components; for example, 0xFF0000 is red, 0x00FF00 is green.

TextFormat.font

Usage my_fmt.font Description
Property; the name of the font for text in this text format, as a string. The default value is null, which indicates that the property is undefined.
TextFormat.getTextExtent()
Flash Player 6. The optional width parameter is supported in Flash Player 7.
Usage my_fmt.getTextExtent(text, [width])

Parameters text

width An optional number that represents the width, in pixels, at which the specified text should wrap. Returns
An object with the properties width, height, ascent, descent, textFieldHeight, textFieldWidth.
Method; returns text measurement information for the text string text in the format specified by my_fmt. The text string is treated as plain text (not HTML). The method returns an object with six properties: ascent, descent, width, height, textFieldHeight, and textFieldWidth. All measurements are in pixels. If a width parameter is specified, word wrapping is applied to the specified text. This lets you determine the height at which a text box shows all of the specified text. The ascent and descent measurements provide, respectively, the distance above and below the baseline for a line of text. The baseline for the first line of text is positioned at the text fields origin plus its ascent measurement. The width and height measurements provide the width and height of the text string. The textFieldHeight and textFieldWidth measurements provide the height and width required for a text field object to display the entire text string. Text fields have a 2-pixel-wide gutter around them, so the value of textFieldHeight is equal the value of height + 4; likewise, the value of textFieldWidth is always equal to the value of width + 4. If you are creating a text field based on the text metrics, use textFieldHeight rather than height and textFieldWidth rather than width. The following figure illustrates these measurements.
When setting up your TextFormat object, set all the attributes exactly as they will be set for the creation of the text field, including font name, font size, and leading. The default value for leading is 2.

You cannot declare a variable scoped to another object as a local variable:
my_array.length = 25; // ok var my_array.length = 25; // syntax error
When you use var, you can strictly type the variable; see Strict data typing on page 38
Note: Classes defined in external scripts also support public, private, and static variable scopes. See Chapter 9, Creating Classes with ActionScript 2.0, on page 155 and private, public, and static.
Flash Player 6; the ability to play Flash Video (FLV) files was added in Flash Player 7.
The Video class lets you display live streaming video on the Stage without embedding it in your SWF file. You capture the video by using Camera.get(). In files published for Flash Player 7 and later, you can also use the Video class to play back Flash Video (FLV) files over HTTP or from the local file system. For more information, see Playing back external FLV files dynamically on page 197, NetConnection class, and NetStream class. A Video object can be used like a movie clip. As with other objects you place on the stage, you can control various properties of Video objects. For example, you can move the Video object around on the stage by using its _x and _y properties; you can change its size using its _height and _width properties, and so on. To display the video stream, first place a Video object on the Stage. Then use Video.attachVideo() to attach the video stream to the Video object.
To place a Video object on the Stage:
1 If the Library panel isnt visible, select Window > Library to display it. 2 Add an embedded Video object to the library by clicking the Options menu on the right side
of the Library panel title bar and selecting New Video.
3 Drag the Video object to the Stage and use the Property inspector to give it a unique instance
name, such as my_video. (Do not name it Video.) Method summary for the Video class
Method Description object on the Stage.

Video.clear()

Video.attachVideo() Specifies a video stream to be displayed within the boundaries of the Video
Clears the image currently displayed in the Video object.
Property summary for the Video class

Video.deblocking

Description Specifies the behavior for the deblocking filter that the video compressor applies as needed when streaming the video. Read-only; the height of the video stream, in pixels.

 

Tags

GT-I5700 Kiel CD36 Multimaster BG-PM 46 Decathlon DC9 KE500 If-ED DTR6600 Aspirateur 6318370 SGH D980 SRU5170 32LB9RT P43ME SE5000 Boss CE-5 PSC 2310 UX-A555 556 Reunion M8003ER BJC-5100 Combi Afw2 Xxx 7 CE3250 TCP50G25 DB156 NF8-V Autopilot Uk EP3000 Review GC-154SQS Coupe ASF2644 Easyshare Z700 RS21dcns BDZ-X90 Roland FP-9 6g ED Network User Modus HT-X625 GTO 4000 DSC-T10 AST-400 RC400 RX-V393RDS System PKG-850P KX-TG2216 DPF 9331 AVR-1707 XE-A401 5738Z Pctv 50I Gryphon D432 SHB1300 Series FX-992VB NP-F970 NS-10MMF IPF610 SRU3006 27 DEH-P75BT KX-FPC161 AN-37AG2 LX-1050 Alpine 3537 TDM900-2004 Tempest PRO WX-C3010 215TW RS-TR333 CLP-840 ER3660BN CHM-S611 TD9473 LE-15A10 1480 D Vista-50P P5K EPU PSW110 SH12APG A8 TX-32LXD700 C350 PC LH-RH9509TA MFC-420CN B4250 PS-LX350H FP563 Iii Plus Wizard Scubapro-uwatec OXY2 DPR-1260 Dvpf3E Nikkor CQ-DP101U VGN-FW11S TX-P42c10Y LST-3800

 

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