<?xml version="1.0" encoding="UTF-8"?>
<book title="Flash Lite 2.x and 3.0 ActionScript Language Reference" directory="FlashLiteAPIReference2">
   <page href="00004833.html" title="ActionScript language elements" text="ActionScript language elementsThis section provides syntax, usage information, and code samples for global functions and properties (those elements that do not belong to an ActionScript class compiler directives; and for the constants, operators, statements, and keywords used in ActionScript and defined in the ECMAScript (ECMA-262) edition 4 draft language specification." />
   <page href="00004834.html" title="Compiler Directives" text="DirectiveDescription#endinitclipCompiler directive; indicates the end of a block of initialization actions.#includeCompiler directive: includes the contents of the specified file, as if the commands in the file are part of the calling script.#initclipCompiler directive; indicates the beginning of a block of initialization actions.Compiler DirectivesThis section contains the directives to include in your ActionScript file to direct the compiler to preprocess certain instructions.Compiler Directives summary" />
   <page href="00004835.html" title="#endinitclip directive" text="#endinitclip directive#endinitclipCompiler directive; indicates the end of a block of initialization actions. Example#initclip...initialization actions go here...#endinitclip" />
   <page href="00004836.html" title="#include directive" text="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.#include directive#include &quot;[path]filename.as&quot; -- Do not place a semicolon (;) at the end of the line that contains the #include statement.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 don&#39;t 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 statementThe global Include directory, which is one of the following:Windows 2000 or Windows XP: C: Documents and Settings user Local&lt;br /&gt;Settings Application Data Macromedia Flash 8 language Configuration Include Windows Vista C: Users user Local Settings Application Data Macromedia Flash 8 language Configuration IncludeMacintosh OS X: Hard Drive/Users/Library/Application Support/Macromedia/Flash 8/language/Configuration/IncludeThe Flash 8 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.)Parameters[path]filename.as - filename.asThe filename and optional path for the script to add to the Actions panel or to the current script; .as is the recommended filename extension.ExampleThe following examples show various ways of specifying a path for a file to be included in your script:// Note that #include statements do not end with a semicolon (;)// AS file is in same directory as FLA file or script// or is in the global Include directory or the First Run/Include directory#include &quot;init_script.as&quot;// AS file is in a subdirectory of one of the above directories// The subdirectory is named &quot;FLA_includes&quot;#include &quot;FLA_includes/init_script.as&quot;// AS file is in a subdirectory of the script file directory// The subdirectory is named &quot;SCRIPT_includes&quot;#include &quot;SCRIPT_includes/init_script.as&quot;// AS file is in a directory at the same level as one of the above directories// AS file is in a directory at the same level as the directory// that contains the script file// The directory is named &quot;ALL_includes&quot;#include &quot;../ALL_includes/init_script.as&quot;// AS file is specified by an absolute path in Windows// Note use of forward slashes, not backslashes#include &quot;C:/Flash_scripts/init_script.as&quot;// AS file is specified by an absolute path on Macintosh#include &quot;Mac HD:Flash_scripts:init_script.as&quot;" />
   <page href="00004837.html" title="#initclip directive" text="#initclip directive#initclip order -- Do not place a semicolon (;) at the end of the line that contains the #initclip statement.Compiler directive; indicates the beginning of a block of initialization actions. When multiple clips are initialized at the same time, you can use the order parameter to specify which initialization occurs first. Initialization actions execute when a movie clip symbol is defined. If the movie clip is an exported symbol, the initialization actions execute before the actions on Frame 1 of the SWF file. Otherwise, they execute immediately before the frame actions of the frame that contains the first instance of the associated movie clip symbol.Initialization actions execute only once when a SWF file plays; use them for one-time initializations, such as class definition and registration.Parametersorder - A non-negative integer that specifies the execution order of blocks of #initclip code. This is an optional parameter. You must specify the value by using an integer literal (only decimal--not hexidecimal--values are allowed), and not by using a variable. If you include multiple #initclip blocks in a single movie clip symbol, then the compiler uses the last order value specified in that movie clip symbol for all #initclip blocks in that symbol.ExampleIn the following example, ActionScript is placed on Frame 1 inside a movie clip instance. A variables.txt text file is placed in the same directory.#initcliptrace(&quot;initializing app&quot;var variables:LoadVars = new LoadVars(variables.load(&quot;variables.txt&quot;variables.onLoad = function(success:Boolean) { trace(&quot;variables loaded:&quot;+success if (success) { for (i in variables) { trace(&quot;variables.&quot;+i+&quot; = &quot;+variables[i] } }};#endinitclip" />
   <page href="00004838.html" title="Constants" text="ModifiersConstantDescriptionfalseA unique Boolean value that represents the opposite of true.InfinitySpecifies the IEEE-754 value representing positive infinity.-InfinitySpecifies the IEEE-754 value representing negative infinity.NaNA predefined variable with the IEEE-754 value for NaN (not a number).newlineInserts a carriage return character ( r) that generates a blank line in text output generated by your code.nullA special value that can be assigned to variables or returned by a function if no data was provided.trueA unique Boolean value that represents the opposite of false.undefinedA special value, usually used to indicate that a variable has not yet been assigned a value.ConstantsA constant is a variable used to represent a property whose value never changes. This section describes global constants that are available to every script.Constants summary" />
   <page href="00004839.html" title="false constant" text="false constantA unique Boolean value that represents the opposite of true. When automatic data typing converts false to a number, it becomes 0; when it converts false to a string, it becomes &quot;false&quot;.ExampleThis example shows how automatic data typing converts false to a number and to a string:var bool1:Boolean = Boolean(false// converts it to the number 0trace(1 + bool1 // outputs 1// converts it to a stringtrace(&quot;String: &quot; + bool1 // outputs String: false" />
   <page href="00004840.html" title="Infinity constant" text="Infinity constantSpecifies the IEEE-754 value representing positive infinity. The value of this constant is the same as Number.POSITIVE_INFINITY.See alsoPOSITIVE_INFINITY (Number.POSITIVE_INFINITY property)" />
   <page href="00004841.html" title="-Infinity constant" text="-Infinity constantSpecifies the IEEE-754 value representing negative infinity. The value of this constant is the same as Number.NEGATIVE_INFINITY.See alsoNEGATIVE_INFINITY (Number.NEGATIVE_INFINITY property)" />
   <page href="00004842.html" title="NaN constant" text="NaN constantA predefined variable with the IEEE-754 value for NaN (not a number). To determine if a number is NaN, use isNaN().See alsoisNaN function, NaN (Number.NaN property)" />
   <page href="00004843.html" title="newline constant" text="newline constantInserts a carriage return character ( r) that generates a blank line in text output generated by your code. Use newline to make space for information that is retrieved by a function or statement in your code.ExampleThe following example shows how newline displays output from the trace() statement on multiple lines. var myName:String = &quot;Lisa&quot;, myAge:Number = 30;trace(myName+myAgetrace(&quot;-----&quot;trace(myName+newline+myAge// output:Lisa30-----Lisa30See alsotrace function" />
   <page href="00004844.html" title="null constant" text="null constantA special value that can be assigned to variables or returned by a function if no data was provided. You can use null to represent values that are missing or that do not have a defined data type.ExampleIn a numeric context, null evaluates to 0. Equality tests can be performed with null. In this statement, a binary tree node has no left child, so the field for its left child could be set to null.if (tree.left == null) { tree.left = new TreeNode(}" />
   <page href="00004845.html" title="true constant" text="true constantA unique Boolean value that represents the opposite of false. When automatic data typing converts true to a number, it becomes 1; when it converts true to a string, it becomes &quot;true&quot;.ExampleThe following example shows the use of true in an if statement:var shouldExecute:Boolean;// ...// code that sets shouldExecute to either true or false goes here// shouldExecute is set to true for this example:shouldExecute = true;if (shouldExecute == true) { trace(&quot;your statements here&quot;}// true is also implied, so the if statement could also be written:// if (shouldExecute) {// trace(&quot;your statements here&quot;// } The following example shows how automatic data typing converts true to the number 1:var myNum:Number;myNum = 1 + true;trace(myNum // output: 2See alsofalse constant, Boolean" />
   <page href="00004846.html" title="undefined constant" text="undefined constantA special value, usually used to indicate that a variable has not yet been assigned a value. A reference to an undefined value returns the special value undefined. The ActionScript code typeof(undefined) returns the string &quot;undefined&quot;. The only value of type undefined is undefined.In files published for Flash Player 6 or earlier, the value of String(undefined) is &quot;&quot; (an empty string). In files published for Flash Player 7 or later, the value of String(undefined) is &quot;undefined&quot; (undefined is converted to a string). In files published for Flash Player 6 or earlier, the value of Number(undefined) is 0. In files published for Flash Player 7 or later, the value of Number(undefined) is NaN.The value undefined is similar to the special value null. When null and undefined are compared with the equality (==) operator, they compare as equal. However, when null and undefined are compared with the strict equality (===) operator, they compare as not equal.ExampleIn the following example, the variable x has not been declared and therefore has the value undefined. In the first section of code, the equality operator (==) compares the value of x to the value undefined, and the appropriate result is sent to the Output panel. In the first section of code, the equality operator (==) compares the value of x to the value undefined, and the appropriate result is sent to the log file. In the second section of code, the equality (==) operator compares the values null and undefined. // x has not been declaredtrace(&quot;The value of x is &quot;+xif (x == undefined) { trace(&quot;x is undefined&quot;} else { trace(&quot;x is not undefined&quot;}trace(&quot;typeof (x) is &quot;+typeof (x)if (null == undefined) { trace(&quot;null and undefined are equal&quot;} else { trace(&quot;null and undefined are not equal&quot;}The following result is displayed in the Output panel. The value of x is undefinedx is undefinedtypeof (x) is undefinednull and undefined are equal" />
   <page href="00004847.html" title="Global Functions" text="ModifiersSignatureDescriptionArray([numElements], [elementN]) : ArrayCreates a new, empty array or converts specified elements to an array.Boolean(expression:Object) : BooleanConverts the parameter expression to a Boolean value and returns true or false.call(frame:Object)Deprecated since Flash Player 5. This action was deprecated in favor of the function statement.Executes the script in the called frame without moving the playhead to that frame.chr(number:Number) : StringDeprecated since Flash Player 5. This function was deprecated in favor of String.fromCharCode().Converts ASCII code numbers to characters.clearInterval(intervalID:Number)Cancels an interval created by a call to setInterval().duplicateMovieClip(target:Object, newname:String, depth:Number)Creates an instance of a movie clip while the SWF file is playing.escape(expression:String) : StringConverts the parameter to a string and encodes it in a URL-encoded format, where all nonalphanumeric characters are replaced with % hexadecimal sequences.eval(expression:Object) : ObjectAccesses variables, properties, objects, or movie clips by name.fscommand(command:String, parameters:String)Lets a SWF file communicate with the Flash Lite player or the environment for a mobile device (such as an operating system).fscommand2(command:String, parameters:String)Lets the SWF file communicate with the Flash Lite player or a host application on a mobile device.getProperty(my_mc:Object, property:Object) : ObjectDeprecated since Flash Player 5. This function was deprecated in favor of the dot syntax, which was introduced in Flash Player 5.Returns the value of the specified property for the movie clip my_mc.getTimer() : NumberReturns the number of milliseconds that have elapsed since the SWF file started playing.getURL(url:String, [window:String], [method:String])Loads a document from a specific URL into a window or passes variables to another application at a defined URL.getVersion() : StringReturns a string containing Flash Player version and platform information.gotoAndPlay([scene:String], frame:Object)Sends the playhead to the specified frame in a scene and plays from that frame.gotoAndStop([scene:String], frame:Object)Sends the playhead to the specified frame in a scene and stops it.ifFrameLoaded([scene:String], frame:Object, statement(s):Object)Deprecated since Flash Player 5. This function has been deprecated. Adobe recommends that you use the MovieClip._framesloaded property.Checks whether the contents of a specific frame are available locally.int(value:Number) : NumberDeprecated since Flash Player 5. This function was deprecated in favor of Math.round().Converts a decimal number to an integer value by truncating the decimal value.isFinite(expression:Object) : BooleanEvaluates expression and returns true if it is a finite number or false if it is infinity or negative infinity.isNaN(expression:Object) : BooleanEvaluates the parameter and returns true if the value is NaN (not a number).length(expression:String, variable:Object) : NumberDeprecated since Flash Player 5. This function, along with all the string functions, has been deprecated. Adobe recommends that you use the methods of the String class and the String.length property to perform the same operations.Returns the length of the specified string or variable.loadMovie(url:String, target:Object, [method:String])Loads a SWF or JPEG file into Flash Player while the original SWF file plays.loadMovieNum(url:String, level:Number, [method:String])Loads a SWF or JPEG file into a level in Flash Player while the originally loaded SWF file plays.loadVariables(url:String, target:Object, [method:String])Reads data from an external file, such as a text file or text generated by ColdFusion, a CGI script, Active Server Pages (ASP), PHP, or Perl script, and sets the values for variables in a target movie clip.loadVariablesNum(url:String, level:Number, [method:String])Reads data from an external file, such as a text file or text generated by a ColdFusion, CGI script, ASP, PHP, or Perl script, and sets the values for variables in a Flash Player level.mbchr(number:Number)Deprecated since Flash Player 5. This function was deprecated in favor of the String.fromCharCode() method.Converts an ASCII code number to a multibyte character.mblength(string:String) : NumberDeprecated since Flash Player 5. This function was deprecated in favor of the String.length property.Returns the length of the multibyte character string.mbord(character:String) : NumberDeprecated since Flash Player 5. This function was deprecated in favor of String.charCodeAt() method.Converts the specified character to a multibyte number.mbsubstring(value:String, index:Number, count:Number) : StringDeprecated since Flash Player 5. This function was deprecated in favor of String.substr() method.Extracts a new multibyte character string from a multibyte character string.nextFrame()Sends the playhead to the next frame.nextScene()Sends the playhead to Frame 1 of the next scene.Number(expression:Object) : NumberConverts the parameter expression to a number.Object([value:Object]) : ObjectCreates a new empty object or converts the specified number, string, or Boolean value to an object.on(mouseEvent:Object)Specifies the mouse event or keypress that triggers an action.onClipEvent(movieEvent:Object)Triggers actions defined for a specific instance of a movie clip.ord(character:String) : NumberDeprecated since Flash Player 5. This function was deprecated in favor of the methods and properties of the String class.Converts characters to ASCII code numbers.parseFloat(string:String) : NumberConverts a string to a floating-point number.parseInt(expression:String, [radix:Number]) : NumberConverts a string to an integer.play()Moves the playhead forward in the Timeline.prevFrame()Sends the playhead to the previous frame.prevScene()Sends the playhead to Frame 1 of the previous scene.random(value:Number) : NumberDeprecated since Flash Player 5. This function was deprecated in favor of Math.random().Returns a random integer between 0 and one less than the integer specified in the value parameter.removeMovieClip(target:Object)Deletes the specified movie clip.setInterval(functionName:Object, interval:Number, [param:Object], objectName:Object, methodName:String) : NumberCalls a function or a method or an object at periodic intervals while a SWF file plays.setProperty(target:Object, property:Object, expression:Object)Changes a property value of a movie clip as the movie clip plays.startDrag(target:Object, [lock:Boolean], [left,top,right,bottom:Number])Makes the target movie clip draggable while the movie plays.stop()Stops the SWF file that is currently playing.stopAllSounds()Stops all sounds currently playing in a SWF file without stopping the playhead.stopDrag()Stops the current drag operation.String(expression:Object) : StringReturns a string representation of the specified parameter.substring(string:String, index:Number, count:Number) : StringDeprecated since Flash Player 5. This function was deprecated in favor of String.substr().Extracts part of a string.targetPath(targetObject:Object) : StringReturns a string containing the target path of movieClipObject.tellTarget(target:String, statement(s):Object)Deprecated since Flash Player 5. Adobe recommends that you use dot (.) notation and the with statement.Applies the instructions specified in the statements parameter to the Timeline specified in the target parameter.toggleHighQuality()Deprecated since Flash Player 5. This function was deprecated in favor of _quality.Turns anti-aliasing on and off in Flash Player.trace(expression:Object)Evaluates the expression and outputs the result.unescape(string:String) : StringEvaluates the parameter x as a string, decodes the string from URL-encoded format (converting all hexadecimal sequences to ASCII characters), and returns the string.unloadMovie(target)Removes a movie clip that was loaded by means of loadMovie() from Flash Player.unloadMovieNum(level:Number)Removes a SWF or image that was loaded by means of loadMovieNum() from Flash Player.Global FunctionsThis section contains a set of built-in functions that are available in any part of a SWF file where ActionScript is used. These global functions cover a wide variety of common programming tasks such as working with data types (Boolean(), int(), and so on), producing debugging information (trace()), and communicating with Flash Player or the browser (fscommand()).Global Functions summary" />
   <page href="00004848.html" title="Array function" text="Unlike the Array class constructor, the Array() function does not use the keyword new .Array functionArray(): Array Array(numElements:Number): Array Array( [element0:Object [, element1, element2, ...elementN] ]) : ArrayCreates a new array of length zero or more, or an array populated by a list of specified elements, possibly of different data types. Lets you create one of the following:an empty arrayan array with a specific length but whose elements have undefined valuesan array whose elements have specific values.Using this function is similar to creating an array with the Array constructor (see &quot;Constructor for the Array class&quot;).You can pass a number (numElements) or a list of elements comprising one or more different types (element0, element1, ... elementN).Parameters that can accept more than one data type are listed as in the signature as type Object.ParametersnumElements [optional] - A positive integer that specifies the number of elements in the array. You can specify either numElements or the list of elements, not both.elementN [optional] - one or more parameters, element0, element1, ... , elementN, the values of which can be of any type. Parameters that can accept more than one data type are listed as type Object. You can specify either numElements or the list of elements, not both.ReturnsArray - An array.Examplevar myArray:Array = Array(myArray.push(12trace(myArray //traces 12myArray[4] = 7;trace(myArray //traces 12,undefined,undefined,undefined,7Usage 2: The following example creates an array of length 4 but with no elements defined:var myArray:Array = Array(4trace(myArray.length // traces 4trace(myArray // traces undefined,undefined,undefined,undefinedUsage 3: The following example creates an array with three defined elements:var myArray:Array = Array(&quot;firstElement&quot;, &quot;secondElement&quot;, &quot;thirdElement&quot;trace (myArray // traces firstElement,secondElement,thirdElementSee alsoArray" />
   <page href="00004849.html" title="Boolean function" text="Unlike the Boolean class constructor, the Boolean() function does not use the keyword new . Moreover, the Boolean class constructor initializes a Boolean object to false if no parameter is specified, while the Boolean() function returns undefined if no parameter is specified.Boolean functionBoolean(expression:Object) : BooleanConverts the parameter expression to a Boolean value and returns a value as described in the following list:If expression is a Boolean value, the return value is expression.If expression is a number, the return value is true if the number is not zero; otherwise the return value is false.If expression is a string, the return value is as follows:In files published for Flash Player 6 or earlier, the string is first converted to a number; the value is true if the number is not zero, false otherwise. In files published for Flash Player 7 or later, the result is true if the string has a length greater than zero; the value is false for an empty string.If expression is a string, the result is true if the string has a length greater than zero; the value is false for an empty string.If expression is undefined or NaN (not a number), the return value is false.If expression is a movie clip or an object, the return value is true.Parametersexpression:Object - An expression to convert to a Boolean value.ReturnsBoolean - A Boolean value.Exampletrace(Boolean(-1) // output: truetrace(Boolean(0) // output: falsetrace(Boolean(1) // output: truetrace(Boolean(true) // output: truetrace(Boolean(false) // output: falsetrace(Boolean(&quot;true&quot;) // output: truetrace(Boolean(&quot;false&quot;) // output: truetrace(Boolean(&quot;Craiggers&quot;) // output: truetrace(Boolean(&quot;&quot;) // output: falseIf files are published for Flash Player 6 and earlier, the results differ for three of the preceding examples:trace(Boolean(&quot;true&quot;) // output: falsetrace(Boolean(&quot;false&quot;) // output: falsetrace(Boolean(&quot;Craiggers&quot;) // output: falseThis example shows a significant difference between use of the Boolean() function and the Boolean class. The Boolean() function creates a Boolean value, and the Boolean class creates a Boolean object. Boolean values are compared by value, and Boolean objects are compared by reference.// Variables representing Boolean values are compared by valuevar a:Boolean = Boolean(&quot;a&quot; // a is truevar b:Boolean = Boolean(1 // b is truetrace(a==b // true// Variables representing Boolean objects are compared by referencevar a:Boolean = new Boolean(&quot;a&quot; // a is truevar b:Boolean = new Boolean(1 // b is truetrace(a == b // false See alsoBoolean" />
   <page href="00004850.html" title="call function" text="call functioncall(frame)Deprecated since Flash Player 5. This action was deprecated in favor of the function statement.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() action, the variables are interpreted as Timeline variables. Parametersframe:Object - The label or number of a frame in the Timeline.See alsoArray function, call (Function.call method)" />
   <page href="00004851.html" title="chr function" text="chr functionchr(number) : StringDeprecated since Flash Player 5. This function was deprecated in favor of String.fromCharCode().Converts ASCII code numbers to characters.Parametersnumber:Number - An ASCII code number.ReturnsString - The character value of the specified ASCII code.ExampleThe following example converts the number 65 to the letter A and assigns it to the variable myVar: myVar = chr(65See alsofromCharCode (String.fromCharCode method)" />
   <page href="00004852.html" title="clearInterval function" text="clearInterval functionclearInterval(intervalID:Number) : VoidCancels an interval created by a call to setInterval().ParametersintervalID:Number - A numeric (integer) identifier returned from a call to setInterval().ExampleThe following example first sets and then clears an interval call:function callback() { trace(&quot;interval called: &quot;+getTimer()+&quot; ms.&quot;}var intervalID:Number = setInterval(callback, 1000You need to clear the interval when you have finished using the function. Create a button called clearInt_btn and use the following ActionScript to clear setInterval():clearInt_btn.onRelease = function(){ clearInterval( intervalID  trace(&quot;cleared interval&quot;};See alsosetInterval function" />
   <page href="00004853.html" title="duplicateMovieClip function" text="duplicateMovieClip functionduplicateMovieClip(target:String, newname:String, depth:Number) : VoidduplicateMovieClip(target:MovieClip, newname:String, depth:Number) : VoidCreates an instance of a movie clip while the SWF file is playing. The playhead in duplicate movie clips always starts at Frame 1, regardless of where the playhead is in the original movie clip. Variables in the original movie clip are not copied into the duplicate movie clip. Use the removeMovieClip() function or method to delete a movie clip instance created with duplicateMovieClip().Parameterstarget:Object - The target path of the movie clip to duplicate. This parameter can be either a String (e.g. &quot;my_mc&quot;) or a direct reference to the movie clip instance (e.g. my_mc). Parameters that can accept more than one data type are listed as type Object.newname:String - A unique identifier for the duplicated movie clip.depth:Number - A unique depth level for the duplicated movie clip. The depth level is a stacking order for duplicated movie clips. This stacking order is similar to the stacking order of layers in the Timeline; movie clips with a lower depth level are hidden under clips with a higher stacking order. You must assign each duplicated movie clip a unique depth level to prevent it from replacing SWF files on occupied depths.ExampleIn the following example, a new movie clip instance is created called img_mc. An image is loaded into the movie clip, and then the img_mc clip is duplicated. The duplicated clip is called newImg_mc, and this new clip is moved on the Stage so it does not overlap the original clip, and the same image is loaded into the second clip.this.createEmptyMovieClip(&quot;img_mc&quot;, this.getNextHighestDepth()img_mc.loadMovie(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;duplicateMovieClip(img_mc, &quot;newImg_mc&quot;, this.getNextHighestDepth()newImg_mc._x = 200;newImg_mc.loadMovie(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;To remove the duplicate movie clip, you could add this code for a button called myButton_btn.this.myButton_btn.onRelease = function(){ removeMovieClip(newImg_mc};See alsoremoveMovieClip function, duplicateMovieClip (MovieClip.duplicateMovieClip method), removeMovieClip (MovieClip.removeMovieClip method)" />
   <page href="00004854.html" title="escape function" text="escape functionescape(expression:String) : StringConverts the parameter to a string and encodes it in a URL-encoded format, where all nonalphanumeric characters are replaced with % hexadecimal sequences. When used in a URL-encoded string, the percentage symbol (%) is used to introduce escape characters, and is not equivalent to the modulo operator (%). Parametersexpression:String - The expression to convert into a string and encode in a URL-encoded format.ReturnsString - URL-encoded string.ExampleThe following code produces the result someuser%40somedomain%2Ecom:var email:String = &quot;someuser@somedomain.com&quot;;trace(escape(email)In this example, the at symbol (@) was replaced with %40 and the dot symbol (.) was replaced with %2E. This is useful if you&#39;re trying to pass information to a remote server and the data has special characters in it (for example, &amp; or ?), as shown in the following code:var redirectUrl = &quot;http://www.somedomain.com?loggedin=true&amp;username=Gus&quot;;getURL(&quot;http://www.myothersite.com?returnurl=&quot;+ escape(redirectUrl)See alsounescape function" />
   <page href="00004855.html" title="eval function" text="eval functioneval(expression:Object) : Objecteval(expression:String) : ObjectAccesses variables, properties, objects, or movie clips by name. If expression is a variable or a property, the value of the variable or property is returned. If expression is an object or movie clip, a reference to the object or movie clip is returned. If the element named in expression cannot be found, undefined is returned.In Flash 4, eval() was used to simulate arrays; in Flash 5 or later, you should use the Array class to simulate arrays.In Flash 4, you can also use eval() to dynamically set and retrieve the value of a variable or instance name. However, you can also do this with the array access operator ([]).In Flash 5 or later, you cannot use eval() to dynamically set and retrieve the value of a variable or instance name, because you cannot useeval() on the left side of an equation. For example, replace the codeeval (&quot;var&quot; + i) = &quot;first&quot;;with this:this[&quot;var&quot;+i] = &quot;first&quot;or this:set (&quot;var&quot; + i, &quot;first&quot;Parametersexpression:Object - The name of a variable, property, object, or movie clip to retrieve. This parameter can be either a String or a direct reference to the object instance (i.e use of quotation marks (&quot; &quot;) is optional.)ReturnsObject - A value, reference to an object or movie clip, or undefined .ExampleThe following example uses eval() to set properties for dynamically named movie clips. This ActionScript sets the _rotation property for three movie clips, called square1_mc, square2_mc, and square3_mc.for (var i = 1; i &lt;= 3; i++) { setProperty(eval(&quot;square&quot;+i+&quot;_mc&quot;), _rotation, 5}You can also use the following ActionScript:for (var i = 1; i &lt;= 3; i++) { this[&quot;square&quot;+i+&quot;_mc&quot;]._rotation = -5;}See alsoArray, set variable statement" />
   <page href="00004856.html" title="fscommand function" text="CommandParametersPurposelaunchapplication-path, arg1, arg2,..., argnThis command launches another application on a mobile device. The name of the application its parameters are passed in as a single argument. Note: This feature is operating-system dependent. Please use this command carefully as it can call on the host device to perform an unsupported operation. Using it in this way could cause the host device to crash.This command is supported only when the Flash Lite player is running in stand-alone mode. It is not supported when the player is running in the context of another application (for example, as a plug-in to a browser).activateTextField&quot;&quot; (ignored)This command asynchronously activates the currently selected text field, making it active for user edits. Because it behaves asynchronously, this command is processed at the end of the frame. ActionScript that immediately follows the call to fscommand() executes first. If no text field is selected when the command is processed, nothing happens. This command gives focus to a text field previously passed to the Selection.setFocus() method and activates the text field for editing. This command has an effect only when the handset supports inline text editing.This command can be called as part of the Selection.onSetFocus() event listener callback. This causes text fields to become active for editing when they are selected.Note: Because the fscommand() function is executed asynchronously, the text field does not immediately become active; it becomes active at the end of the frame.fscommand functionfscommand(command:String, parameters:String) : VoidThe fscommand() function lets a SWF file communicate with the Flash Lite player or the environment for a mobile device (such as an operating system). The parameters define the name of the application being started and the parameters to it, separated by commas.Parameterscommand:String - A string passed to the host application for any use, or a command passed to the Flash Lite player.parameters:String - A string passed to the host application for any use, or a value passed to the Flash Lite player.ExampleIn the following example, the fscommand() function opens wap.yahoo.com on the services/Web browser on Series 60 phones:on(keyPress &quot;9&quot;) { status = fscommand(&quot;launch&quot;, &quot;z: system apps browser browser.app,http://wap.yahoo.com&quot;}" />
   <page href="00004857.html" title="fscommand2 function" text=" CommandDeprecated ByEscapeescape global function GetDateDaygetDate() method of Date objectGetDateMonthgetMonth() method of Date objectGetDateWeekdaygetDay() method of Date objectGetDateYeargetYear() method of Date objectGetLanguageSystem.capabilities.language propertyGetLocaleLongDategetLocaleLongDate() method of Date objectGetLocaleShortDategetLocaleShortDate() method of Date objectGetLocaleTimegetLocaleTime() method of Date objectGetTimeHoursgetHours() method of Date objectGetTimeMinutesgetMinutes() method of Date objectGetTimeSecondsgetSeconds() method of Date objectGetTimeZoneOffsetgetTimeZoneOffset() method of Date objectSetQualityMovieClip._qualityUnescapeunescape() global functionfscommand2 functionfscommand2(command:String, parameter1:String,...parameterN:String) : VoidLets the SWF file communicate with the Flash Lite player or a host application on a mobile device. To use fscommand2() to send a message to the Flash Lite player, you must use predefined commands and parameters. See the &quot;fscommand2 Commands&quot; section under &quot;ActionScript language elements&quot; for the values you can specify for the fscommand() function&#39;s commands and parameters. These values control SWF files that are playing in the Flash Lite player.The fscommand2() function is similar to the fscommand() function, with the following differences: The fscommand2()function can take any number of arguments. By contrast, fscommand() can take only one argument.Flash Lite executes fscommand2() immediately (in other words, within the frame), whereas fscommand() is executed at the end of the frame being processed.The fscommand2() function returns a value that can be used to report success, failure, or the result of the command.Note: None of the fscommand2() commands are available in Web players.Deprecated fscommand2() commandsSome fscommand2() commands from Flash Lite 1.1 have been deprecated in Flash Lite 2.0. The following table shows the deprecated fscommand2() commands:Parameterscommand:String - A string passed to the host application for any use, or a command passed to the Flash Lite player.parameters:String - A string passed to the host application for any use, or a value passed to the Flash Lite player." />
   <page href="00004858.html" title="getProperty function" text="getProperty functiongetProperty(my_mc:Object, property:Object) : ObjectDeprecated since Flash Player 5. This function was deprecated in favor of the dot syntax, which was introduced in Flash Player 5.Returns the value of the specified property for the movie clip my_mc.Parametersmy_mc:Object - The instance name of a movie clip for which the property is being retrieved.property:Object - A property of a movie clip.ReturnsObject - The value of the specified property.ExampleThe following example creates a new movie clip someClip_mc and shows the alpha value (_alpha) for the movie clip someClip_mc in the Output panel:this.createEmptyMovieClip(&quot;someClip_mc&quot;, 999trace(&quot;The alpha of &quot;+getProperty(someClip_mc, _name)+&quot; is: &quot;+getProperty(someClip_mc, _alpha)" />
   <page href="00004859.html" title="getTimer function" text="getTimer functiongetTimer() : NumberReturns the number of milliseconds that have elapsed since the SWF file started playing.ReturnsNumber - The number of milliseconds that have elapsed since the SWF file started playing.ExampleIn the following example, the getTimer() and setInterval() functions are used to create a simple timer:this.createTextField(&quot;timer_txt&quot;, this.getNextHighestDepth(), 0, 0, 100, 22function updateTimer():Void { timer_txt.text = getTimer(}var intervalID:Number = setInterval(updateTimer, 100" />
   <page href="00004860.html" title="getURL function" text="getURL functiongetURL(url:String [, window:String [, method:String] ]) : VoidLoads a document from a specific URL into a window or passes variables to another application at a defined URL. To test this function, make sure the file to be loaded is at the specified location. To use an absolute URL (for example, http://www.myserver.com), you need a network connection.Note: This function is not supported for BREW devices.Parametersurl:String - The URL from which to obtain the document.window:String [optional] - Specifies the window or HTML frame into which the document should load. You can enter the name of a specific window or select from the following reserved target names: _self specifies the current frame in the current window._blank specifies a new window._parent specifies the parent of the current frame._top specifies the top-level frame in the current window.method:String [optional] - A GET or POST method for sending variables. If there are no variables, omit this parameter. The GET method appends the variables to the end of the URL, and is used for small numbers of variables. The POST method sends the variables in a separate HTTP header and is used for sending long strings of variables.ExampleThis example loads an image into a movie clip. When the image is clicked, a new URL is loaded in a new browser window.var listenerObject:Object = new Object(listenerObject.onLoadInit = function(target_mc:MovieClip) { target_mc.onRelease = function() { getURL(&quot;http://www.macromedia.com/software/flash/flashpro/&quot;, &quot;_blank&quot; };};var logo:MovieClipLoader = new MovieClipLoader(logo.addListener(listenerObjectlogo.loadClip(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;, this.createEmptyMovieClip(&quot;macromedia_mc&quot;, this.getNextHighestDepth())In the following example, getURL() is used to send an e-mail message:myBtn_btn.onRelease = function(){ getURL(&quot;mailto:you@somedomain.com&quot;};You can also use GET or POST for sending variables. The following example uses GET to append variables to a URL:var firstName:String = &quot;Gus&quot;;var lastName:String = &quot;Richardson&quot;;var age:Number = 92;myBtn_btn.onRelease = function() { getURL(&quot;http://www.macromedia.com&quot;, &quot;_blank&quot;, &quot;GET&quot;};The following ActionScript uses POST to send variables in the HTTP header. Make sure you test your documents in a browser window, because otherwise your variables are sent using GET:var firstName:String = &quot;Gus&quot;;var lastName:String = &quot;Richardson&quot;;var age:Number = 92;getURL(&quot;http://www.macromedia.com&quot;, &quot;_blank&quot;, &quot;POST&quot;See alsoloadVariables function, send (XML.send method), sendAndLoad (XML.sendAndLoad method)" />
   <page href="00004861.html" title="getVersion function" text="getVersion functiongetVersion() : StringReturns a string containing Flash Player version and platform information. The getVersion function returns information only for Flash Player 5 or later versions of Flash Player.ReturnsString - A string containing Flash Player version and platform information.ExampleThe following examples trace the version number of the Flash Player playing the SWF file:var flashVersion:String = getVersion(trace(flashVersion // output: WIN 8,0,1,0trace($version // output: WIN 8,0,1,0trace(System.capabilities.version // output: WIN 8,0,1,0The following string is returned by the getVersion function:WIN 8,0,1,0This returned string indicates that the platform is Microsoft Windows, and the version number of Flash Player is major version 8, minor version 1 (8.1).See alsoos (capabilities.os property), version (capabilities.version property)" />
   <page href="00004862.html" title="gotoAndPlay function" text="gotoAndPlay functiongotoAndPlay( [scene:String,] frame:Object) : VoidSends the playhead to the specified frame in a scene and plays from that frame. If no scene is specified, the playhead goes to the specified frame in the current scene. You can use the scene parameter only on the root Timeline, not within Timelines for movie clips or other objects in the document.Parametersscene:String [optional] - A string specifying the name of the scene to which the playhead is sent.frame:Object - A number representing the frame number, or a string representing the label of the frame, to which the playhead is sent.ExampleIn the following example, a document has two scenes: sceneOne and sceneTwo. Scene one contains a frame label on Frame 10 called newFrame and two buttons, myBtn_btn and myOtherBtn_btn. This ActionScript is placed on Frame 1, Scene 1 of the main Timeline. stop(myBtn_btn.onRelease = function(){ gotoAndPlay(&quot;newFrame&quot;};myOtherBtn_btn.onRelease = function(){ gotoAndPlay(&quot;sceneTwo&quot;, 1};When the user clicks the buttons, the playhead moves to the specified location and continues playing.See alsogotoAndPlay (MovieClip.gotoAndPlay method), nextFrame function, play function, prevFrame function" />
   <page href="00004863.html" title="gotoAndStop function" text="gotoAndStop functiongotoAndStop( [scene:String,] frame:Object) : VoidSends the playhead to the specified frame in a scene and stops it. If no scene is specified, the playhead is sent to the frame in the current scene.You can use the scene parameter only on the root Timeline, not within Timelines for movie clips or other objects in the document.Parametersscene:String [optional] - A string specifying the name of the scene to which the playhead is sent.frame:Object - A number representing the frame number, or a string representing the label of the frame, to which the playhead is sent.ExampleIn the following example, a document has two scenes: sceneOne and sceneTwo. Scene one contains a frame label on Frame 10 called newFrame, and two buttons, myBtn_btn and myOtherBtn_btn. This ActionScript is placed on Frame 1, Scene 1 of the main Timeline:stop(myBtn_btn.onRelease = function(){ gotoAndStop(&quot;newFrame&quot;};myOtherBtn_btn.onRelease = function(){ gotoAndStop(&quot;sceneTwo&quot;, 1};When the user clicks the buttons, the playhead moves to the specified location and stops.See alsogotoAndStop (MovieClip.gotoAndStop method), stop function, play function, gotoAndPlay function" />
   <page href="00004864.html" title="ifFrameLoaded function" text="ifFrameLoaded functionifFrameLoaded( [scene,] frame) { statement(s }Deprecated since Flash Player 5. This function has been deprecated. Adobe recommends that you use the MovieClip._framesloaded property.Checks whether the contents of a specific frame are available locally. Use ifFrameLoaded to start playing a simple animation while the rest of the SWF file downloads to the local computer. The difference between using _framesloaded and ifFrameLoaded is that _framesloaded lets you add custom if or else statements. Parametersscene:String [optional] - A string that specifies the name of the scene that must be loaded.frame:Object - The frame number or frame label that must be loaded before the next statement is executed.statement(s):Object - The instructions to execute if the specified scene, or scene and frame, are loaded.See alsoaddListener (MovieClipLoader.addListener method)" />
   <page href="00004865.html" title="int function" text="int functionint(value) : NumberDeprecated since Flash Player 5. This function was deprecated in favor of Math.round().Converts a decimal number to an integer value by truncating the decimal value. This function is equivalent to Math.floor() if the value parameter is positive and Math.ceil() if the value parameter is negative.Parametersvalue:Number - A number to be rounded to an integer.ReturnsNumber - The truncated integer value.See alsoround (Math.round method), floor (Math.floor method), ceil (Math.ceil method)" />
   <page href="00004866.html" title="isFinite function" text="isFinite functionisFinite(expression:Object) : BooleanEvaluates expression and returns true if it is a finite number or false if it is infinity or negative infinity. The presence of infinity or negative infinity indicates a mathematical error condition such as division by 0.Parametersexpression:Object - A Boolean value, variable, or other expression to be evaluated.ReturnsBoolean - A Boolean value.ExampleThe following example shows return values for isFinite:isFinite(56)// returns trueisFinite(Number.POSITIVE_INFINITY)//returns false" />
   <page href="00004867.html" title="isNaN function" text="isNaN functionisNaN(expression:Object) : BooleanEvaluates the parameter and returns true if the value is NaN(not a number). This function is useful for checking whether a mathematical expression evaluates successfully to a number. Parametersexpression:Object - A Boolean, variable, or other expression to be evaluated.ReturnsBoolean - A Boolean value.ExampleThe following code illustrates return values for the isNaN() function:trace( isNaN(&quot;Tree&quot;) // returns truetrace( isNaN(56) // returns falsetrace( isNaN(Number.POSITIVE_INFINITY) )// returns falseThe following example shows how you can use isNAN() to check whether a mathematical expression contains an error:var dividend:Number;var divisor:Number;divisor = 1;trace( isNaN(dividend/divisor) // output: true // The output is true because the variable dividend is undefined. // Do not use isNAN() to check for division by 0 because it will return false.// A positive number divided by 0 equals Infinity (Number.POSITIVE_INFINITY).// A negative number divided by 0 equals -Infinity (Number.NEGATIVE_INFINITY).See alsoNaN constant, NaN (Number.NaN property)" />
   <page href="00004868.html" title="length function" text="length functionlength(expression)length(variable)Deprecated since Flash Player 5. This function, along with all the string functions, has been deprecated. Adobe recommends that you use the methods of the String class and the String.length property to perform the same operations.Returns the length of the specified string or variable.Parametersexpression:String - A string.variable:Object - The name of a variable.ReturnsNumber - The length of the specified string or variable.ExampleThe following example returns the length of the string &quot;Hello&quot;: length(&quot;Hello&quot; The result is 5.See also&quot; string delimiter operator, String, length (String.length property)" />
   <page href="00004869.html" title="loadMovie function" text="If you want to monitor the progress of the download, use MovieClipLoader.loadClip() instead of this function.loadMovie functionloadMovie(url:String, target:Object [, method:String]) : VoidloadMovie(url:String, target:String [, method:String]) : VoidLoads a SWF or JPEG file into Flash Player while the original SWF file plays. JPEG files saved in progressive format are not supported.The loadMovie() function lets you display several SWF files at once and switch among SWF files without loading another HTML document. Without the loadMovie() function, Flash Player displays a single SWF file.If you want to load a SWF or JPEG file into a specific level, use loadMovieNum() instead of loadMovie().When a SWF file is loaded into a target movie clip, you can use the target path of that movie clip to target the loaded SWF file. A SWF file or image loaded into a target inherits the position, rotation, and scale properties of the targeted movie clip. The upper left corner of the loaded image or SWF file aligns with the registration point of the targeted movie clip. Alternatively, if the target is the root Timeline, the upper left corner of the image or SWF file aligns with the upper left corner of the Stage.Use unloadMovie() to remove SWF files that were loaded with loadMovie().Parametersurl:String - The absolute or relative URL of the SWF or JPEG file to be loaded. A relative path must be relative to the SWF file at level 0. Absolute URLs must include the protocol reference, such as http:// or file:///.target:Object - A reference to a movie clip object or a string representing the path to a target movie clip. The target movie clip is replaced by the loaded SWF file or image.method:String [optional] - Specifies an HTTP method for sending variables. The parameter must be the string GET or POST . If there are no variables to be sent, omit this parameter. The GET method appends the variables to the end of the URL and is used for small numbers of variables. The POST method sends the variables in a separate HTTP header and is used for long strings of variables.ExampleUsage 1: The following example loads the SWF file circle.swf from the same directory and replaces a movie clip called mySquare that already exists on the Stage:loadMovie(&quot;circle.swf&quot;, mySquare// equivalent statement (Usage 1): loadMovie(&quot;circle.swf&quot;, _level0.mySquare// equivalent statement (Usage 2): loadMovie(&quot;circle.swf&quot;, &quot;mySquare&quot;The following example loads the SWF file circle.swf from the same directory, but replaces the main movie clip instead of the mySquare movie clip:loadMovie(&quot;circle.swf&quot;, this// Note that using &quot;this&quot; as a string for the target parameter will not work// equivalent statement (Usage 2): loadMovie(&quot;circle.swf&quot;, &quot;_level0&quot;The following loadMovie() statement loads the SWF file sub.swf from the same directory into a new movie clip called logo_mc that&#39;s created using createEmptyMovieClip():this.createEmptyMovieClip(&quot;logo_mc&quot;, 999loadMovie(&quot;sub.swf&quot;, logo_mcYou could add the following code to load a JPEG image called image1.jpg from the same directory as the SWF file loading sub.swf. The JPEG is loaded when you click a button called myBtn_btn. This code loads the JPEG into logo_mc. Therefore, it will replace sub.swf with the JPEG image.myBtn_btn.onRelease = function(){ loadMovie(&quot;image1.jpg&quot;, logo_mc};Usage 2: The following example loads the SWF file circle.swf from the same directory and replaces a movie clip called mySquare that already exists on the Stage:loadMovie(&quot;circle.swf&quot;, &quot;mySquare&quot;See also_level property, loadMovieNum function, loadMovie (MovieClip.loadMovie method), loadClip (MovieClipLoader.loadClip method), unloadMovie function" />
   <page href="00004870.html" title="loadMovieNum function" text="If you want to monitor the progress of the download, use MovieClipLoader.loadClip() instead of this function.  JPEG files saved in progressive format are not supported.loadMovieNum functionloadMovieNum(url:String, level:Number [, method:String]) : VoidLoads a SWF or JPEG file into a level in Flash Player while the originally loaded SWF file plays.Normally, Flash Player displays a single SWF file and then closes. The loadMovieNum() action lets you display several SWF files at once and switch among SWF files without loading another HTML document.If you want to specify a target instead of a level, use loadMovie() instead of loadMovieNum().Flash Player has a stacking order of levels starting with level 0. These levels are like layers of acetate; they are transparent except for the objects on each level. When you use loadMovieNum(), you must specify a level in Flash Player into which the SWF file will load. When a SWF file is loaded into a level, you can use the syntax, _levelN, where N is the level number, to target the SWF file.When you load a SWF file, you can specify any level number and you can load SWF files into a level that already has a SWF file loaded into it. If you do, the new SWF file will replace the existing SWF file. If you load a SWF file into level 0, every level in Flash Player is unloaded, and level 0 is replaced with the new file. The SWF file in level 0 sets the frame rate, background color, and frame size for all other loaded SWF files.The loadMovieNum() action also lets you load JPEG files into a SWF file while it plays. For images and SWF files, the upper left corner of the image aligns with the upper left corner of the Stage when the file loads. Also in both cases, the loaded file inherits rotation and scaling, and the original content is overwritten in the specified level. Use unloadMovieNum() to remove SWF files or images that were loaded with loadMovieNum().Parametersurl:String - The absolute or relative URL of the SWF or JPEG file to be loaded. A relative path must be relative to the SWF file at level 0. For use in the stand-alone Flash Player or for testing in test mode in the Flash authoring application, all SWF files must be stored in the same folder and the filenames cannot include folder or disk drive specifications.level:Number - An integer specifying the level in Flash Player into which the SWF file will load.method:String [optional] - Specifies an HTTP method for sending variables. The parameter must be the string GET or POST . If there are no variables to be sent, omit this parameter. The GET method appends the variables to the end of the URL and is used for small numbers of variables. The POST method sends the variables in a separate HTTP header and is used for long strings of variables.ExampleThe following example loads the JPEG image tim.jpg into level 2 of Flash Player: loadMovieNum(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;, 2See alsounloadMovieNum function, loadMovie function, loadClip (MovieClipLoader.loadClip method), _level property" />
   <page href="00004871.html" title="loadVariables function" text="loadVariables functionloadVariables(url:String, target:Object [, method:String]) : VoidReads data from an external file, such as a text file or text generated by ColdFusion, a CGI script, Active Server Pages (ASP), PHP, or Perl script, and sets the values for variables in a target movie clip. This action can also be used to update variables in the active SWF file with new values. The text at the specified URL must be in the standard MIME format application/x-www-form-urlencoded (a standard format used by CGI scripts). Any number of variables can be specified. For example, the following phrase defines several variables:company=Macromedia&amp;address=600+Townsend&amp;city=San+Francisco&amp;zip=94103In SWF files running in a version earlier than Flash Player 7, url must be in the same superdomain as the SWF file that is issuing this call. A superdomain is derived by removing the leftmost component of a file&#39;s URL. For example, a SWF file at www.someDomain.com can load data from a source at store.someDomain.com because both files are in the same superdomain of someDomain.com.In SWF files of any version running in Flash Player 7 or later, url must be in exactly the same domain as the SWF file that is issuing this call (see &quot;Flash Player security features&quot; in Using ActionScript in Flash). For example, a SWF file at www.someDomain.com can load data only from sources that are also at www.someDomain.com. If you want to load data from a different domain, you can place a cross-domain policy file on the server hosting the SWF file that is being accessed. For more information, see &quot;About allowing cross-domain data loading&quot; in Using ActionScript in Flash.If you want to load variables into a specific level, use loadVariablesNum() instead of loadVariables().Parametersurl:String - An absolute or relative URL where the variables are located. If the SWF file issuing this call is running in a web browser, url must be in the same domain as the SWF file; for details, see the Description section.target:Object - The target path to a movie clip that receives the loaded variables.method:String [optional] - Specifies an HTTP method for sending variables. The parameter must be the string GET or POST . If there are no variables to be sent, omit this parameter. The GET method appends the variables to the end of the URL and is used for small numbers of variables. The POST method sends the variables in a separate HTTP header and is used for long strings of variables.ExampleThe following example loads information from a text file called params.txt into the target_mc movie clip that is created using createEmptyMovieClip(). The setInterval() function is used to check the loading progress. The script checks for a variable in the params.txt file named done.this.createEmptyMovieClip(&quot;target_mc&quot;, this.getNextHighestDepth()loadVariables(&quot;params.txt&quot;, target_mcfunction checkParamsLoaded() { if (target_mc.done == undefined) { trace(&quot;not yet.&quot; } else { trace(&quot;finished loading. killing interval.&quot; trace(&quot;-------------&quot; for (i in target_mc) { trace(i+&quot;: &quot;+target_mc[i] } trace(&quot;-------------&quot; clearInterval(param_interval }}var param_interval = setInterval(checkParamsLoaded, 100The external file, params.txt, includes the following text:var1=&quot;hello&quot;&amp;var2=&quot;goodbye&quot;&amp;done=&quot;done&quot;See alsoloadVariablesNum function, loadMovie function, loadMovieNum function, getURL function, loadMovie (MovieClip.loadMovie method), loadVariables (MovieClip.loadVariables method), load (LoadVars.load method)" />
   <page href="00004872.html" title="loadVariablesNum function" text="loadVariablesNum functionloadVariablesNum(url:String, level:Number [, method:String]) : VoidReads data from an external file, such as a text file or text generated by ColdFusion, a CGI script, ASP, PHP, or a Perl script, and sets the values for variables in a Flash Player level. You can also use this function to update variables in the active SWF file with new values. The text at the specified URL must be in the standard MIME format application/x-www-form-urlencoded(a standard format used by CGI scripts). Any number of variables can be specified. For example, the following phrase defines several variables:company=Macromedia&amp;address=601+Townsend&amp;city=San+Francisco&amp;zip=94103In SWF files running in a version of the player earlier than Flash Player 7, url must be in the same superdomain as the SWF file that is issuing this call. A superdomain is derived by removing the leftmost component of a file&#39;s URL. For example, a SWF file at www.someDomain.com can load data from a source at store.someDomain.com, because both files are in the same superdomain of someDomain.com.In SWF files of any version running in Flash Player 7 or later, url must be in exactly the same domain as the SWF file that is issuing this call (see &quot;Flash Player security features&quot; in Using ActionScript in Flash). For example, a SWF file at www.someDomain.com can load data only from sources that are also at www.someDomain.com. If you want to load data from a different domain, you can place a cross-domain policy file on the server hosting the SWF file. For more information, see &quot;About allowing cross-domain data loading&quot; in Using ActionScript in Flash. If you want to load variables into a target MovieClip, use loadVariables() instead of loadVariablesNum().Parametersurl:String - An absolute or relative URL where the variables are located. If the SWF file issuing this call is running in a web browser, url must be in the same domain as the SWF file; for details, see the Description section.level:Number - An integer specifying the level in Flash Player to receive the variables.method:String [optional] - Specifies an HTTP method for sending variables. The parameter must be the string GET or POST . If there are no variables to be sent, omit this parameter. The GET method appends the variables to the end of the URL and is used for small numbers of variables. The POST method sends the variables in a separate HTTP header and is used for long strings of variables.ExampleThe following example loads information from a text file called params.txt into the main Timeline of the SWF at level 2 in Flash Player. The variable names of the text fields must match the variable names in the params.txt file. The setInterval() function is used to check the progress of the data being loaded into the SWF. The script checks for a variable in the params.txt file named done.loadVariablesNum(&quot;params.txt&quot;, 2function checkParamsLoaded() { if (_level2.done == undefined) { trace(&quot;not yet.&quot; } else { trace(&quot;finished loading. killing interval.&quot; trace(&quot;-------------&quot; for (i in _level2) { trace(i+&quot;: &quot;+_level2[i] } trace(&quot;-------------&quot; clearInterval(param_interval }}var param_interval = setInterval(checkParamsLoaded, 100// Params.txt includes the following textvar1=&quot;hello&quot;&amp;var2=&quot;goodbye&quot;&amp;done=&quot;done&quot;See alsogetURL function, loadMovie function, loadMovieNum function, loadVariables function, loadMovie (MovieClip.loadMovie method), loadVariables (MovieClip.loadVariables method), load (LoadVars.load method)" />
   <page href="00004873.html" title="mbchr function" text="mbchr functionmbchr(number)Deprecated since Flash Player 5. This function was deprecated in favor of the String.fromCharCode() method.Converts an ASCII code number to a multibyte character.Parametersnumber:Number - The number to convert to a multibyte character.See alsofromCharCode (String.fromCharCode method)" />
   <page href="00004874.html" title="mblength function" text="mblength functionmblength(string) : NumberDeprecated since Flash Player 5. This function was deprecated in favor of the String.length property.Returns the length of the multibyte character string.Parametersstring:String - The string to measure.ReturnsNumber - The length of the multibyte character string.See alsoString, length (String.length property)" />
   <page href="00004875.html" title="mbord function" text="mbord functionmbord(character) : NumberDeprecated since Flash Player 5. This function was deprecated in favor of String.charCodeAt() method.Converts the specified character to a multibyte number.Parameterscharacter:String - character The character to convert to a multibyte number.ReturnsNumber - The converted character.See alsocharCodeAt (String.charCodeAt method)" />
   <page href="00004876.html" title="mbsubstring function" text="mbsubstring functionmbsubstring(value, index, count) : StringDeprecated since Flash Player 5. This function was deprecated in favor of String.substr() method.Extracts a new multibyte character string from a multibyte character string. Parametersvalue:String - The multibyte string from which to extract a new multibyte string.index:Number - The number of the first character to extract.count:Number - The number of characters to include in the extracted string, not including the index character.ReturnsString - The string extracted from the multibyte character string.See alsosubstr (String.substr method)" />
   <page href="00004877.html" title="nextFrame function" text="nextFrame functionnextFrame() : VoidSends the playhead to the next frame.ExampleIn the following example, when the user presses the Right or Down arrow key, the playhead goes to the next frame and stops. If the user presses the Left or Up arrow key, the playhead goes to the previous frame and stops. The listener is initialized to wait for the arrow key to be pressed, and the init variable is used to prevent the listener from being redefined if the playhead returns to Frame 1.stop(if (init == undefined) { someListener = new Object( someListener.onKeyDown = function() { if (Key.isDown(Key.LEFT) || Key.isDown(Key.UP)) { _level0.prevFrame( } else if (Key.isDown(Key.RIGHT) || Key.isDown(Key.DOWN)) { _level0.nextFrame( } }; Key.addListener(someListener init = 1;}See alsoprevFrame function" />
   <page href="00004878.html" title="nextScene function" text="nextScene functionnextScene() : VoidSends the playhead to Frame 1 of the next scene.ExampleIn the following example, when a user clicks the button that is created at runtime, the playhead is sent to Frame 1 of the next scene. Create two scenes, and enter the following ActionScript on Frame 1 of Scene 1.stop(if (init == undefined) { this.createEmptyMovieClip(&quot;nextscene_mc&quot;, this.getNextHighestDepth() nextscene_mc.createTextField(&quot;nextscene_txt&quot;, this.getNextHighestDepth(), 200, 0, 100, 22 nextscene_mc.nextscene_txt.autoSize = true; nextscene_mc.nextscene_txt.border = true; nextscene_mc.nextscene_txt.text = &quot;Next Scene&quot;; this.createEmptyMovieClip(&quot;prevscene_mc&quot;, this.getNextHighestDepth() prevscene_mc.createTextField(&quot;prevscene_txt&quot;, this.getNextHighestDepth(), 00, 0, 100, 22 prevscene_mc.prevscene_txt.autoSize = true; prevscene_mc.prevscene_txt.border = true; prevscene_mc.prevscene_txt.text = &quot;Prev Scene&quot;; nextscene_mc.onRelease = function() { nextScene( }; prevscene_mc.onRelease = function() { prevScene( }; init = true;}Make sure you place a stop() action on Frame 1 of Scene 2.See alsoprevScene function" />
   <page href="00004879.html" title="Number function" text="Number functionNumber(expression) : NumberConverts the parameter expression to a number and returns a value as described in the following list:If expression is a number, the return value is expression.If expression is a Boolean value, the return value is 1 if expression is true, 0 if expression is false.If expression is a string, the function attempts to parse expression as a decimal number with an optional trailing exponent (that is, 1.57505e-3).If expression is NaN, the return value is NaN.If expression is undefined, the return value is as follows:&lt;br /&gt;- In files published for Flash Player 6 or earlier, the result is 0.&lt;br /&gt;- In files published for Flash Player 7 or later, the result is NaN.Parametersexpression:Object - An expression to convert to a number. Numbers or strings that begin with 0x are interpreted as hexadecimal values. Numbers or strings that begin with 0 are interpreted as octal values.ReturnsNumber - A number or NaN (not a number).ExampleIn the following example, a text field is created on the Stage at runtime:this.createTextField(&quot;counter_txt&quot;, this.getNextHighestDepth(), 0, 0, 100, 22counter_txt.autoSize = true;counter_txt.text = 0;function incrementInterval():Void { var counter:Number = counter_txt.text; // Without the Number() function, Flash would concatenate the value instead  // of adding values. You could also use &quot;counter_txt.text++;&quot; counter_txt.text = Number(counter) + 1;}var intervalID:Number = setInterval(incrementInterval, 1000See alsoNaN constant, Number, parseInt function, parseFloat function" />
   <page href="00004880.html" title="Object function" text="Object functionObject( [value] ) : ObjectCreates a new empty object or converts the specified number, string, or Boolean value to an object. This command is equivalent to creating an object using the Object constructor (see &quot;Constructor for the Object class&quot;). Parametersvalue:Object [optional] - A number, string, or Boolean value.ReturnsObject - An object.ExampleIn the following example, a new empty object is created, and then the object is populated with values:var company:Object = new Object(company.name = &quot;Macromedia, Inc.&quot;;company.address = &quot;600 Townsend Street&quot;;company.city = &quot;San Francisco&quot;;company.state = &quot;CA&quot;;company.postal = &quot;94103&quot;;for (var i in company) { trace(&quot;company.&quot;+i+&quot; = &quot;+company[i]}See alsoObject" />
   <page href="00004881.html" title="on handler" text="on handleron(mouseEvent:Object) { // your statements here } Specifies the mouse event or keypress that triggers an action. ParametersmouseEvent:Object - A mouseEvent is a trigger called an event . When the event occurs, the statements following it within curly braces ({ }) execute. Any of the following values can be specified for the mouseEvent parameter: press The mouse button is pressed while the pointer is over the button.release The mouse button is released while the pointer is over the button.releaseOutside While the pointer is over the button, the mouse button is pressed, rolled outside the button area, and released. Both the press and the dragOut events always precede a releaseOutside event. &lt;br /&gt;Note: This event is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.rollOut The pointer rolls outside the button area. &lt;br /&gt;Note: This event is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.rollOver The mouse pointer rolls over the button.dragOut While the pointer is over the button, the mouse button is pressed and then rolls outside the button area.dragOver While the pointer is over the button, the mouse button has been pressed, then rolled outside the button, and then rolled back over the button.keyPress &quot;&lt;key&gt; &quot; The specified keyboard key is pressed. For the key portion of the parameter, specify a key constant, as shown in the code hinting in the Actions Panel. You can use this parameter to intercept a key press, that is, to override any built-in behavior for the specified key. The button can be anywhere in your application, on or off the Stage. One limitation of this technique is that you can&#39;t apply the on() handler at runtime; you must do it at authoring time. Make sure that you select Control &gt; Disable Keyboard Shortcuts, or certain keys with built-in behavior won&#39;t be overridden when you test the application using Control &gt; Test Movie. For a list of key constants, see the Key class.ExampleIn the following script, the startDrag() function executes when the mouse is pressed, and the conditional script is executed when the mouse is released and the object is dropped:on (press) { startDrag(this}on (release) { trace(&quot;X:&quot;+this._x trace(&quot;Y:&quot;+this._y stopDrag(}See alsoonClipEvent handler, Key" />
   <page href="00004882.html" title="onClipEvent handler" text="onClipEvent handleronClipEvent(movieEvent:Object) { // your statements here }Triggers actions defined for a specific instance of a movie clip.ParametersmovieEvent:Object - The movieEvent is a trigger called an event . When the event occurs, the statements following it within curly braces ({}) are executed. Any of the following values can be specified for the movieEvent parameter: load The action is initiated as soon as the movie clip is instantiated and appears in the Timeline.unload The action is initiated 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.enterFrame The action is triggered continually at the frame rate of the movie clip. The actions associated with the enterFrame clip event are processed before any frame actions that are attached to the affected frames.mouseMove The action is initiated every time the mouse is moved. Use the _xmouse and _ymouse properties to determine the current mouse position.&lt;br /&gt;Note: This event is supported in Flash Lite only if System.capabilities.hasMouse is true.mouseDown The action is initiated when the left mouse button is pressed. &lt;br /&gt;Note: This event is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.mouseUp The action is initiated when the left mouse button is released.&lt;br /&gt;Note: This event is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.keyDown The action is initiated when a key is pressed. Use Key.getCode() to retrieve information about the last key pressed.keyUp The action is initiated when a key is released. Use the Key.getCode() method to retrieve information about the last key pressed.data The action is initiated when data is received in a loadVariables() or loadMovie() action. When specified with a loadVariables() action, the data event occurs only once, when the last variable is loaded. When specified with a loadMovie() action, the data event occurs repeatedly, as each section of data is retrieved.ExampleThe following example uses onClipEvent() with the keyDown movie event and is designed to be attached to a movie clip or button. The keyDown movie event is usually used with one or more methods and properties of the Key object. The following script uses Key.getCode() to find out which key the user has pressed; if the pressed key matches the Key.RIGHT property, the playhead is sent to the next frame; if the pressed key matches the Key.LEFT property, the playhead is sent to the previous frame. onClipEvent (keyDown) { if (Key.getCode() == Key.RIGHT) { this._parent.nextFrame( } else if (Key.getCode() == Key.LEFT) { this._parent.prevFrame( }}The following example uses onClipEvent() with the load and mouseMove movie events. The _xmouse and _ymouse properties track the position of the mouse each time the mouse moves, which appears in the text field that&#39;s created at runtime.onClipEvent (load) { this.createTextField(&quot;coords_txt&quot;, this.getNextHighestDepth(), 0, 0, 100, 22 coords_txt.autoSize = true; coords_txt.selectable = false;}onClipEvent (mouseMove) { coords_txt.text = &quot;X:&quot;+_root._xmouse+&quot;,Y:&quot;+_root._ymouse;}See alsoKey, _xmouse (MovieClip._xmouse property), _ymouse (MovieClip._ymouse property), Constants" />
   <page href="00004883.html" title="ord function" text="ord functionord(character) : NumberDeprecated since Flash Player 5. This function was deprecated in favor of the methods and properties of the String class.Converts characters to ASCII code numbers.Parameterscharacter:String - The character to convert to an ASCII code number.ReturnsNumber - The ASCII code number of the specified character.See alsoString, charCodeAt (String.charCodeAt method)" />
   <page href="00004884.html" title="parseFloat function" text="parseFloat functionparseFloat(string:String) : NumberConverts a string to a floating-point number. The function reads, or parses, and returns the numbers in a string until it reaches a character that is not a part of the initial number. If the string does not begin with a number that can be parsed, parseFloat() returns NaN. White space preceding valid integers is ignored, as are trailing nonnumeric characters.Parametersstring:String - The string to read and convert to a floating-point number.ReturnsNumber - A number or NaN (not a number).ExampleThe following examples use the parseFloat() function to evaluate various types of numbers: trace(parseFloat(&quot;-2&quot;) // output: -2trace(parseFloat(&quot;2.5&quot;) // output: 2.5trace(parseFloat(&quot; 2.5&quot;) // output: 2.5trace(parseFloat(&quot;3.5e6&quot;) // output: 3500000trace(parseFloat(&quot;foobar&quot;) // output: NaNtrace(parseFloat(&quot;3.75math&quot;) // output: 3.75trace(parseFloat(&quot;0garbage&quot;) // output: 0See alsoNaN constant, parseInt function" />
   <page href="00004885.html" title="parseInt function" text="parseInt functionparseInt(expression:String [, radix:Number]) : NumberConverts a string to an integer. If the specified string in the parameters cannot be converted to a number, the function returns NaN. Strings beginning with 0x are interpreted as hexadecimal numbers. Integers beginning with 0 or specifying a radix of 8 are interpreted as octal numbers. White space preceding valid integers is ignored, as are trailing nonnumeric characters.Parametersexpression:String - A string to convert to an integer.radix:Number [optional] - An integer representing the radix (base) of the number to parse. Legal values are from 2 to 36.ReturnsNumber - A number or NaN (not a number).ExampleThe examples in this section use the parseInt() function to evaluate various types of numbers. The following example returns 3:parseInt(&quot;3.5&quot;)The following example returns NaN:parseInt(&quot;bar&quot;)The following example returns 4:parseInt(&quot;4foo&quot;)The following example shows a hexadecimal conversion that returns 1016:parseInt(&quot;0x3F8&quot;)The following example shows a hexadecimal conversion using the optional radix parameter that returns 1000:parseInt(&quot;3E8&quot;, 16)The following example shows a binary conversion and returns 10, which is the decimal representation of the binary 1010:parseInt(&quot;1010&quot;, 2)The following examples show octal number parsing and return 511, which is the decimal representation of the octal 777:parseInt(&quot;0777&quot;)parseInt(&quot;777&quot;, 8)See alsoNaN constant, parseFloat function" />
   <page href="00004886.html" title="play function" text="play functionplay() : VoidMoves the playhead forward in the Timeline.ExampleIn the following example, there are two movie clip instances on the Stage with the instance names stop_mc and play_mc. The ActionScript stops the SWF file&#39;s playback when the stop_mc movie clip instance is clicked. Playback resumes when the play_mc instance is clicked. this.stop_mc.onRelease = function() { stop(};this.play_mc.onRelease = function() { play(};trace(&quot;frame 1&quot;See alsogotoAndPlay function, gotoAndPlay (MovieClip.gotoAndPlay method)" />
   <page href="00004887.html" title="prevFrame function" text="prevFrame functionprevFrame() : VoidSends the playhead to the previous frame. If the current frame is Frame 1, the playhead does not move.ExampleWhen the user clicks a button called myBtn_btn and the following ActionScript is placed on a frame in the Timeline for that button, the playhead is sent to the previous frame:stop(this.myBtn_btn.onRelease = function(){ prevFrame(};See alsonextFrame function, prevFrame (MovieClip.prevFrame method)" />
   <page href="00004888.html" title="prevScene function" text="prevScene functionprevScene() : VoidSends the playhead to Frame 1 of the previous scene.See alsonextScene function" />
   <page href="00004889.html" title="random function" text="random functionrandom(value) : NumberDeprecated since Flash Player 5. This function was deprecated in favor of Math.random().Returns a random integer between 0 and one less than the integer specified in the value parameter.Parametersvalue:Number - An integer.ReturnsNumber - A random integer.ExampleThe following use of random() returns a value of 0, 1, 2, 3, or 4: random(5See alsorandom (Math.random method)" />
   <page href="00004890.html" title="removeMovieClip function" text="removeMovieClip functionremoveMovieClip(target:Object)Deletes the specified movie clip.Parameterstarget:Object - The target path of a movie clip instance created with duplicateMovieClip() or the instance name of a movie clip created with MovieClip.attachMovie(), MovieClip.duplicateMovieClip(), or MovieClip.createEmptyMovieClip().ExampleThe following example creates a new movie clip called myClip_mc and duplicates the movie clip. The second movie clip is called newClip_mc. Images are loaded into both movie clips. When a button, button_mc, is clicked, the duplicated movie clip is removed from the Stage.this.createEmptyMovieClip(&quot;myClip_mc&quot;, this.getNextHighestDepth()myClip_mc.loadMovie(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;duplicateMovieClip(this.myClip_mc, &quot;newClip_mc&quot;, this.getNextHighestDepth()newClip_mc.loadMovie(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;newClip_mc._x = 200;this.button_mc.onRelease = function() { removeMovieClip(this._parent.newClip_mc};See alsoduplicateMovieClip function, duplicateMovieClip (MovieClip.duplicateMovieClip method), attachMovie (MovieClip.attachMovie method), removeMovieClip (MovieClip.removeMovieClip method), createEmptyMovieClip (MovieClip.createEmptyMovieClip method)" />
   <page href="00004891.html" title="setInterval function" text="setInterval functionsetInterval(functionName:Object, interval:Number [, param1:Object, param2, ..., paramN]) : Number setInterval(objectName:Object, methodName:String, interval:Number [, param1:Object, param2, ..., paramN]) : NumberCalls a function or a method or an object at periodic intervals while a SWF file plays. You can use an interval function to update variables from a database or to update a time display. If interval is greater than the SWF file&#39;s frame rate, the interval function is only called each time the playhead enters a frame; this minimizes the impact each time the screen is refreshed.Note: In Flash Lite 2.0, the interval passed into this method is ignored if it is less than the SWF file&#39;s frame rate and the interval function is called on the SWF file&#39;s frame rate interval only. If the interval is greater than the SWF file&#39;s frame rate, the event is called on the next frame after the interval has elapsed.ParametersfunctionName:Object - A function name or a reference to an anonymous function.interval:Number - The time in milliseconds between calls to the functionName or methodName parameter.param:Object [optional] - Parameters passed to the functionName or methodName parameter. Multiple parameters should be separated by commas: param1,param2, ...,paramNobjectName:Object - An object containing the method methodName. methodName:String - A method of objectName .ReturnsNumber - An identifying integer that you can pass to clearInterval() to cancel the interval.ExampleUsage 1: The following example calls an anonymous function every 1000 milliseconds (1 second). setInterval( function(){ trace(&quot;interval called&quot; }, 1000  Usage 2: The following example defines two event handlers and calls each of them. The first call to setInterval() calls the callback1() function, which contains a trace() statement. The second call to setInterval() passes the &quot;interval called&quot; string to the function callback2() as a parameter.function callback1() { trace(&quot;interval called&quot; }function callback2(arg) {  trace(arg}setInterval( callback1, 1000 setInterval( callback2, 1000, &quot;interval called&quot;  Usage 3: This example uses a method of an object. You must use this syntax when you want to call a method that is defined for an object. obj = new Object(obj.interval = function() {  trace(&quot;interval function called&quot; }setInterval( obj, &quot;interval&quot;, 1000 obj2 = new Object(obj2.interval = function(s) {  trace(s }setInterval( obj2, &quot;interval&quot;, 1000, &quot;interval function called&quot;  You must use the second form of the setInterval() syntax to call a method of an object, as shown in the following example:setInterval( obj2, &quot;interval&quot;, 1000, &quot;interval function called&quot; When working with this function, you need to be careful about the memory you use in a SWF file. For example, when you remove a movie clip from the SWF file, it will not remove any setInterval() function running within it. Always remove the setInterval() function by using clearInterval() when you have finished using it, as shown in the following example:// create an event listener object for our MovieClipLoader instancevar listenerObjectbject = new Object(listenerObject.onLoadInit = function(target_mc:MovieClip) { trace(&quot;start interval&quot; /* after the target movie clip loaded, create a callback which executes  about every 1000 ms (1 second) and calls the intervalFunc function. */ target_mc.myInterval = setInterval(intervalFunc, 1000, target_mc};function intervalFunc(target_mc) { // display a trivial message which displays the instance name and arbitrary text. trace(target_mc+&quot; has been loaded for &quot;+getTimer()/1000+&quot; seconds.&quot; /* when the target movie clip is clicked (and released) you clear the interval  and remove the movie clip. If you don&#39;t clear the interval before deleting  the movie clip, the function still calls itself every second even though the  movie clip instance is no longer present. */ target_mc.onRelease = function() { trace(&quot;clear interval&quot; clearInterval(this.myInterval // delete the target movie clip removeMovieClip(this };}var jpeg_mcl:MovieClipLoader = new MovieClipLoader(jpeg_mcl.addListener(listenerObjectjpeg_mcl.loadClip(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;,  this.createEmptyMovieClip(&quot;jpeg_mc&quot;, this.getNextHighestDepth()) If you work with setInterval() within classes, you need to be sure to use the this keyword when you call the function. The setInterval()function does not have access to class members if you do not use the keyword. This is illustrated in the following example. For a FLA file with a button called deleteUser_btn, add the following ActionScript to Frame 1:var me:User = new User(&quot;Gary&quot;this.deleteUser_btn.onRelease = function() { trace(&quot;Goodbye, &quot;+me.username clearInterval(me.intervalID delete me;}; Then create a file called User.as in the same directory as your FLA file. Enter the following ActionScript:class User { var intervalID:Number; var username:String; function User(param_username:String) { trace(&quot;Welcome, &quot;+param_username this.username = param_username; this.intervalID = setInterval(this, &quot;traceUsername&quot;, 1000, this.username } function traceUsername(str:String) { trace(this.username+&quot; is &quot;+getTimer()/1000+&quot; seconds old, happy birthday.&quot; }}See alsoclearInterval function" />
   <page href="00004892.html" title="setProperty function" text="setProperty functionsetProperty(target:Object, property:Object, expression:Object) : VoidChanges a property value of a movie clip as the movie clip plays.Parameterstarget:Object - The path to the instance name of the movie clip whose property is to be set.property:Object - The property to be set.expression:Object - Either the new literal value of the property, or an equation that evaluates to the new value of the property.ExampleThe following ActionScript creates a new movie clip and loads an image into it. The _xand _y coordinates are set for the clip using setProperty(). When you click the button called right_btn, the _x coordinate of a movie clip named params_mc is incremented by 20 pixels.this.createEmptyMovieClip(&quot;params_mc&quot;, 999params_mc.loadMovie(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;setProperty(this.params_mc, _y, 20setProperty(this.params_mc, _x, 20this.right_btn.onRelease = function() { setProperty(params_mc, _x, getProperty(params_mc, _x)+20};See alsogetProperty function" />
   <page href="00004893.html" title="startDrag function" text="startDrag functionstartDrag(target:Object [, lock:Boolean, left:Number, top:Number, right:Number, bottom:Number]) : VoidMakes 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. Note: This method is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.Parameterstarget:Object - The target path of the movie clip to drag.lock:Boolean [optional] - 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 ).left,top,right,bottom:Number [optional] - Values relative to the coordinates of the movie clip&#39;s parent that specify a constraint rectangle for the movie clip.ExampleThe 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(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;, this.createEmptyMovieClip(&quot;pic_mc&quot;, 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(listenerObjectSee alsostopDrag function, _droptarget (MovieClip._droptarget property), startDrag (MovieClip.startDrag method)" />
   <page href="00004894.html" title="stop function" text="stop functionstop() : VoidStops the SWF file that is currently playing. The most common use of this action is to control movie clips with buttons.See alsogotoAndStop function, gotoAndStop (MovieClip.gotoAndStop method)" />
   <page href="00004895.html" title="stopAllSounds function" text="stopAllSounds functionstopAllSounds() : VoidStops all sounds currently playing in a SWF file without stopping the playhead. Sounds set to stream will resume playing as the playhead moves over the frames in which they are located.ExampleThe following code creates a text field, in which the song&#39;s ID3 information appears. A new Sound object instance is created, and your MP3 is loaded into the SWF file. ID3 information is extracted from the sound file. When the user clicks stop_mc, the sound is paused. When the user clicks play_mc, the song resumes from its paused position.this.createTextField(&quot;songinfo_txt&quot;, this.getNextHighestDepth, 0, 0, Stage.width, 22var bg_sound:Sound = new Sound(bg_sound.loadSound(&quot;yourSong.mp3&quot;, truebg_sound.onID3 = function() { songinfo_txt.text = &quot;(&quot; + this.id3.artist + &quot;) &quot; + this.id3.album + &quot; - &quot; + this.id3.track + &quot; - &quot;  + this.id3.songname; for (prop in this.id3) { trace(prop+&quot; = &quot;+this.id3[prop] } trace(&quot;ID3 loaded.&quot;};this.play_mc.onRelease = function() { /* get the current offset. if you stop all sounds and click the play button, the MP3 continues from  where it was stopped, instead of restarting from the beginning. */ var numSecondsOffset:Number = (bg_sound.position/1000 bg_sound.start(numSecondsOffset};this.stop_mc.onRelease = function() { stopAllSounds(};See alsoSound" />
   <page href="00004896.html" title="stopDrag function" text="stopDrag functionstopDrag() : VoidStops the current drag operation.Note: This method is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following code, placed in the main Timeline, stops the drag action on the movie clip instance my_mc when the user releases the mouse button:my_mc.onPress = function () { startDrag(this}my_mc.onRelease = function() { stopDrag(}See alsostartDrag function, _droptarget (MovieClip._droptarget property), startDrag (MovieClip.startDrag method), stopDrag (MovieClip.stopDrag method)" />
   <page href="00004897.html" title="String function" text="String functionString(expression:Object) : StringReturns a string representation of the specified parameter, as described in the following list:If expression is a number, the return string is a text representation of the number.If expression is a string, the return string is expression.If expression is an object, the return value is a string representation of the object generated by calling the string property for the object or by calling Object.toString() if no such property exists.If expression is a Boolean value, the return string is &quot;true&quot; or &quot;false&quot;.If expression is a movie clip, the return value is the target path of the movie clip in slash (/) notation.If expression is undefined, the return values are as follows:In files published for Flash Player 6 or earlier, the result is an empty string (&quot;&quot;). In files published for Flash Player 7 or later, the result is undefined.Note:Slash notation is not supported by ActionScript 2.0.Parametersexpression:Object - An expression to convert to a string.ReturnsString - A string.ExampleIn the following example, you use ActionScript to convert specified expressions to a string:var string1:String = String(&quot;3&quot;var string2:String = String(&quot;9&quot;trace(string1+string2 // output: 39Because both parameters are strings, the values are concatenated rather than added.See alsotoString (Number.toString method), toString (Object.toString method), String, &quot; string delimiter operator" />
   <page href="00004898.html" title="substring function" text="substring functionsubstring(&quot;string&quot;, index, count) : StringDeprecated since Flash Player 5. This function was deprecated in favor of String.substr().Extracts part of a string. This function is one-based, whereas the String object methods are zero-based.Parametersstring:String - The string from which to extract the new string.index:Number - The number of the first character to extract.count:Number - The number of characters to include in the extracted string, not including the index character.ReturnsString - The extracted substring.See alsosubstr (String.substr method)" />
   <page href="00004899.html" title="targetPath function" text="targetPath functiontargetpath(targetObject:Object) : StringReturns a string containing the target path of a MovieClip, Button, or TextFieldobject. The target path is returned in dot (.) notation. To retrieve the target path in slash (/) notation, use the _target property.ParameterstargetObject:Object - Reference (for example, _root or _parent ) to the object for which the target path is being retrieved. This can be a MovieClip, Button, or TextField object.ReturnsString - A string containing the target path of the specified object.ExampleThe following example traces the target path of a movie clip as soon as it loads:this.createEmptyMovieClip(&quot;myClip_mc&quot;, this.getNextHighestDepth()trace(targetPath(myClip_mc) // _level0.myClip_mcSee alsoeval function" />
   <page href="00004900.html" title="tellTarget function" text="tellTarget functiontellTarget(&quot;target&quot;) { statement(s }Deprecated since Flash Player 5. Adobe recommends that you use dot (.) notation and the with statement.Applies the instructions specified in the statements parameter to the Timeline specified in the target parameter. The tellTarget action is useful for navigation controls. Assign tellTarget to buttons that stop or start movie clips elsewhere on the Stage. You can also make movie clips go to a particular frame in that clip. For example, you might assign tellTarget to buttons that stop or start movie clips on the Stage or prompt movie clips to jump to a particular frame.In Flash 5 or later, you can use dot (.) notation instead of the tellTarget action. You can use the with action to issue multiple actions to the same Timeline. You can use the with action to target any object, whereas the tellTarget action can target only movie clips.Parameterstarget:String - A string that specifies the target path of the Timeline to be controlled.statement(s):Object - The instructions to execute if the condition is true.ExampleThis tellTarget statement controls the movie clip instance ball on the main Timeline. Frame 1 of the ball instance is blank and has a stop() action so it isn&#39;t visible on the Stage. When you click the button with the following action, tellTarget tells the playhead in ball to go to Frame 2, where the animation starts:  on(release) { tellTarget(&quot;_parent.ball&quot;) { gotoAndPlay(2 } }The following example uses dot (.) notation to achieve the same results: on(release) { _parent.ball.gotoAndPlay(2 }If you need to issue multiple commands to the ball instance, you can use the with action, as shown in the following statement: on(release) { with(_parent.ball) { gotoAndPlay(2 _alpha = 15; _xscale = 50; _yscale = 50; } }See alsowith statement" />
   <page href="00004901.html" title="toggleHighQuality function" text="toggleHighQuality functiontoggleHighQuality()Deprecated since Flash Player 5. This function was deprecated in favor of _quality.Turns anti-aliasing on and off in Flash Player. Anti-aliasing smooths the edges of objects and slows down SWF playback. This action affects all SWF files in Flash Player.ExampleThe following code could be applied to a button that, when clicked, would toggle anti-aliasing on and off:  on(release) { toggleHighQuality( }See also_highquality property, _quality property" />
   <page href="00004902.html" title="trace function" text="trace functiontrace(expression:Object)You can use Flash Debug Player to capture output from the trace() function and write that output to the log file.Statement; evaluates the expression and displays the result in the Output panel in test mode.Use this statement to record programming notes or to display messages in the Output panel while testing a SWF file. Use the expression parameter to check whether a condition exists, or to display values in the Output panel. The trace() statement is similar to the alert function in JavaScript.You can use the Omit Trace Actions command in the Publish Settings dialog box to remove trace()actions from the exported SWF file. Parametersexpression:Object - An expression to evaluate. When a SWF file is opened in the Flash authoring tool (using the Test Movie command), the value of the expression parameter is displayed in the Output panel.ExampleThe following example uses a trace() statement to display in the Output panel the methods and properties of the dynamically created text field called error_txt:this.createTextField(&quot;error_txt&quot;, this.getNextHighestDepth(), 0, 0, 100, 22for (var i in error_txt) {trace(&quot;error_txt.&quot;+i+&quot; = &quot;+error_txt[i]}/* output:error_txt.styleSheet = undefinederror_txt.mouseWheelEnabled = trueerror_txt.condenseWhite = false...error_txt.maxscroll = 1error_txt.scroll = 1*/" />
   <page href="00004903.html" title="unescape function" text="unescape functionunescape(x:String) : StringEvaluates the parameter x as a string, decodes the string from URL-encoded format (converting all hexadecimal sequences to ASCII characters), and returns the string. Parametersstring:String - A string with hexadecimal sequences to escape.ReturnsString - A string decoded from a URL-encoded parameter.ExampleThe following example shows the escape-to-unescape conversion process:var email:String = &quot;user@somedomain.com&quot;;trace(emailvar escapedEmail:String = escape(emailtrace(escapedEmailvar unescapedEmail:String = unescape(escapedEmailtrace(unescapedEmail The following result is displayed in the Output panel.user@somedomain.comuser%40somedomain%2Ecomuser@somedomain.com" />
   <page href="00004904.html" title="unloadMovie function" text="unloadMovie function unloadMovie(target:MovieClip) : Void unloadMovie(target:String) : VoidRemoves a movie clip that was loaded by means of loadMovie() from Flash Player. To unload a movie clip that was loaded by means of loadMovieNum(), use unloadMovieNum() instead of unloadMovie().Parameterstarget - The target path of a movie clip. This parameter can be either a String (e.g. &quot;my_mc&quot;) or a direct reference to the movie clip instance (e.g. my_mc). Parameters that can accept more than one data type are listed as type Object.ExampleThe following example creates a new movie clip called pic_mc and loads an image into that clip. It is loaded using the MovieClipLoader class. When you click the image, the movie clip unloads from the SWF file:var pic_mcl:MovieClipLoader = new MovieClipLoader(pic_mcl.loadClip(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;, this.createEmptyMovieClip(&quot;pic_mc&quot;, this.getNextHighestDepth())var listenerObject:Object = new Object(listenerObject.onLoadInit = function(target_mc) { target_mc.onRelease = function() { unloadMovie(pic_mc /* or you could use the following, which refers to the movie clip referenced by &#39;target_mc&#39;. */ //unloadMovie(this };};pic_mcl.addListener(listenerObjectSee alsoloadMovie (MovieClip.loadMovie method), unloadClip (MovieClipLoader.unloadClip method)" />
   <page href="00004905.html" title="unloadMovieNum function" text="unloadMovieNum functionunloadMovieNum(level:Number) : VoidRemoves a SWF or image that was loaded by means of loadMovieNum() from Flash Player. To unload a SWF or image that was loaded with MovieClip.loadMovie(), use unloadMovie() instead of unloadMovieNum().Parameterslevel:Number - The level (_level N ) of a loaded movie.ExampleThe following example loads an image into a SWF file. When you click unload_btn, the loaded content is removed.loadMovieNum(&quot;yourimage.jpg&quot;, 1unload_btn.onRelease = function() { unloadMovieNum(1}See alsoloadMovieNum function, unloadMovie function, loadMovie (MovieClip.loadMovie method)" />
   <page href="00004906.html" title="Global Properties" text="ModifiersPropertyDescription$versionDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.version property.Contains the version number of Flash Lite._cap4WayKeyASDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.has4WayKeyAS property.Indicates whether Flash Lite executes ActionScript expressions attached to key event handlers associated with the Right, Left, Up, and Down Arrow keys._capCompoundSoundDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasCompoundSound property.Indicates whether Flash Lite can process compound sound data._capEmailDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasEmail property.Indicates whether the Flash Lite client can send e-mail messages by using the GetURL() ActionScript command._capLoadDataDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasDataLoading property.Indicates whether the host application can dynamically load additional data through calls to the loadMovie(), loadMovieNum(), loadVariables(), and loadVariablesNum() functions._capMFiDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasMFi property.Indicates whether the device can play sound data in the Melody Format for i-mode (MFi) audio format._capMIDIDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasMIDI property.Indicates whether the device can play sound data in the Musical Instrument Digital Interface (MIDI) audio format._capMMSDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasMMS property.Indicates whether Flash Lite can send Multimedia Messaging Service (MMS) messages by using the GetURL() ActionScript command. If so, this variable is defined and has a value of 1; if not, this variable is undefined._capSMAFDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasSMAF property.Indicates whether the device can play multimedia files in the Synthetic music Mobile Application Format (SMAF). If so, this variable is defined and has a value of 1; if not, this variable is undefined._capSMSDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasSMS property.Indicates whether Flash Lite can send Short Message Service (SMS) messages by using the GetURL() ActionScript command._capStreamSoundDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasStreamingAudio property.Indicates whether the device can play streaming (synchronized) sound._focusrectProperty (global specifies whether a yellow rectangle appears around the button or movie clip that has keyboard focus._forceframerateTells the Flash Lite player to render at the specified frame rate._globalA reference to the global object that holds the core ActionScript classes, such as String, Object, Math, and Array._highqualityDeprecated since Flash Player 5. This property was deprecated in favor of _quality.Specifies the level of anti-aliasing applied to the current SWF file._levelA reference to the root Timeline of _levelN.maxscrollDeprecated since Flash Player 5. This property was deprecated in favor of TextField.maxscroll.Indicates the line number of the top line of visible text in a text field when the bottom line in the field is also visible._parentSpecifies or returns a reference to the movie clip or object that contains the current movie clip or object._qualitySets or retrieves the rendering quality used for a movie clip._rootSpecifies or returns a reference to the root movie clip Timeline.scrollDeprecated since Flash Player 5. This property was deprecated in favor of TextField.scroll.Controls the display of information in a text field associated with a variable._soundbuftimeEstablishes the number of seconds of streaming sound to buffer.thisReferences an object or movie clip instance.Global PropertiesGlobal properties are available in every script, and are visible to every Timeline and scope in your document. For example, global properties allow access to the timelines of other loaded movie clips, both relative (_parent) and absolute (_root). They also let you restrict (this) or expand (super) scope. And, you can use global properties to adjust runtime settings like screen reader accessibility, playback quality, and sound buffer size.Global Properties summary" />
   <page href="00004907.html" title="$version property" text="$version property$versionDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.version property.String variable; contains the version number of Flash Lite. It contains a major number, minor number, build number, and an internal build number, which is generally 0 in all released versions. The major number reported for all Flash Lite 1.x products is 5. Flash Lite 1.0 has a minor number of 1; Flash Lite 1.1 has a minor number of 2. ExampleIn the Flash Lite 1.1 player, the following code sets the value of myVersion to &quot;5, 2, 12, 0&quot;: myVersion = $version; See alsoversion (capabilities.version property)" />
   <page href="00004908.html" title="_cap4WayKeyAS property" text="_cap4WayKeyAS property_cap4WayKeyASDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.has4WayKeyAS property.Numeric variable; indicates whether Flash Lite executes ActionScript expressions attached to key event handlers associated with the Right, Left, Up, and Down Arrow keys. This variable is defined and has a value of 1 only when the host application uses four-way key navigation mode to move between Flash controls (buttons and input text fields). Otherwise, this variable is undefined. When one of the four-way keys is pressed, if the value of the _cap4WayKeyAS variable is 1, Flash Lite first looks for a handler for that key. If it finds none, Flash control navigation occurs. However, if an event handler is found, no navigation action occurs for that key. For example, if a key press handler for the Down Arrow key is found, the user cannot navigate.ExampleThe following example sets canUse4Way to 1 in Flash Lite 1.1, but leaves it undefined in Flash Lite 1.0 (however, not all Flash Lite 1.1 phones support four-way keys, so this code is still dependent on the phone):canUse4Way = _cap4WayKeyAS; if (canUse4Way == 1) { msg = &quot;Use your directional joypad to navigate this application&quot;; } else { msg = &quot;Please use the 2 key to scroll up, the 6 key to scroll right, the 8 key to scroll down, and the 4 key to scroll left.&quot;; } See alsocapabilities (System.capabilities)" />
   <page href="00004909.html" title="_capCompoundSound property" text="_capCompoundSound property_capCompoundSoundDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasCompoundSound property.Numeric variable; indicates whether Flash Lite can process compound sound data. If so, this variable is defined and has a value of 1; if not, this variable is undefined. For example, a single Flash file can contain the same sound represented in both MIDI and MFi formats. The player will then play back data in the appropriate format based on the format supported by the device. This variable defines whether the Flash Lite player supports this ability on the current handset. ExampleIn the following example, useCompoundSound is set to 1 in Flash Lite 1.1, but is undefined in Flash Lite 1.0:useCompoundSound = _capCompoundSound;if (useCompoundSound == 1) { gotoAndPlay(&quot;withSound&quot;} else { gotoAndPlay(&quot;withoutSound&quot;See alsocapabilities (System.capabilities)" />
   <page href="00004910.html" title="_capEmail property" text="_capEmail property_capEmailDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasEmail property.Numeric variable; indicates whether the Flash Lite client can send e-mailmessages by using the GetURL() ActionScript command. If so, this variable is defined and has a value of 1; if not, this variable is undefined. ExampleIf the host application can send e-mail messages by using the GetURL() ActionScript command, the following example sets canEmail() to 1: canEmail = _capEmail;if (canEmail == 1) { getURL(&quot;mailto:someone@somewhere.com?subject=foo&amp;body=bar&quot;} See alsocapabilities (System.capabilities)" />
   <page href="00004911.html" title="_capLoadData property" text="_capLoadData property_capLoadDataDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasDataLoading property.Numeric variable; indicates whether the host application can dynamically load additional data through calls to the loadMovie(), loadMovieNum(), loadVariables(), and loadVariablesNum() functions. If so, this variable is defined and has a value of 1; if not, this variable is undefined. ExampleIf the host application can perform dynamic loading of movies and variables, the following example sets CanLoad to 1: canLoad = _capLoadData;if (canLoad == 1) { loadVariables(&quot;http://www.somewhere.com/myVars.php&quot;, GET} else { trace (&quot;client does not support loading dynamic data&quot;} See alsocapabilities (System.capabilities)" />
   <page href="00004912.html" title="_capMFi property" text="_capMFi property_capMFiDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasMFi property.Numeric variable; indicates whether the device can play sound data in the Melody Format for i-mode (MFi) audio format. If so, this variable is defined and has a value of 1; if not, this variable is undefined. ExampleIf the device can play MFi sound data, the following example sets canMFi to 1: canMFi = _capMFi;if (canMFi == 1) { // send movieclip buttons to frame with buttons that trigger events sounds tellTarget(&quot;buttons&quot;) { gotoAndPlay(2  }} See alsohasMFI (capabilities.hasMFI property)" />
   <page href="00004913.html" title="_capMIDI property" text="_capMIDI property_capMIDIDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasMIDI property.Numeric variable; indicates whether the device can play sound data in the Musical Instrument Digital Interface (MIDI) audio format. If so, this variable is defined and has a value of 1; if not, this variable is undefined. ExampleIf the device can play MIDI sound data, the following example sets _capMIDI to 1: canMIDI = _capMIDI;if (canMIDI == 1) { // send movieclip buttons to frame with buttons that trigger events sounds tellTarget(&quot;buttons&quot;) { gotoAndPlay(2  }} See alsocapabilities (System.capabilities)" />
   <page href="00004914.html" title="_capMMS property" text="_capMMS property_capMMSDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasMMS property.Numeric variable; indicates whether Flash Lite can send Multimedia Messaging Service (MMS) messages by using the GetURL() ActionScript command. If so, this variable is defined and has a value of 1; if not, this variable is undefined. ExampleThe following example sets canMMS to 1 in Flash Lite 1.1, but leaves it undefined in Flash Lite 1.0 (however, not all Flash Lite 1.1 phones can send MMS messages, so this code is still dependent on the phone): on(release) { canMMS = _capMMS; if (canMMS == 1) { // send an MMS myMessage = &quot;mms:4156095555?body=sample mms message&quot;; } else { // send an SMS myMessage = &quot;sms:4156095555?body=sample sms message&quot;; } getURL(myMessage} See alsocapabilities (System.capabilities)" />
   <page href="00004915.html" title="_capSMAF property" text="_capSMAF property_capSMAFDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasSMAF property.Numeric variable; indicates whether the device can play multimedia files in the Synthetic music Mobile Application Format (SMAF). If so, this variable is defined and has a value of 1; if not, this variable is undefined. ExampleThe following example sets canSMAF to 1 in Flash Lite 1.1, but leaves it undefined in Flash Lite 1.0 (however, not all Flash Lite 1.1 phones can send SMAF messages, so this code is still dependent on the phone): canSMAF = _capSMAF;if (canSMAF) { // send movieclip buttons to frame with buttons that trigger events sounds tellTarget(&quot;buttons&quot;) { gotoAndPlay(2  }} See alsocapabilities (System.capabilities)" />
   <page href="00004916.html" title="_capSMS property" text="_capSMS property_capSMSDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasSMS property.Numeric variable; indicates whether Flash Lite can send Short Message Service (SMS) messages by using the GetURL() ActionScript command. If so, this variable is defined and has a value of 1; if not, this variable is undefined. ExampleThe following example sets canSMS to 1 in Flash Lite 1.1, but leaves it undefined in Flash Lite 1.0 (however, not all Flash Lite 1.1 phones can send SMS messages, so this code is still dependent on the phone): on(release) { canSMS = _capSMS; if (canSMS) { // send an SMS myMessage = &quot;sms:4156095555?body=sample sms message&quot;; getURL(myMessage }} See alsocapabilities (System.capabilities)" />
   <page href="00004917.html" title="_capStreamSound property" text="_capStreamSound property_capStreamSoundDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasStreamingAudio property.Numeric variable; indicates whether the device can play streaming (synchronized) sound. If so, this variable is defined and has a value of 1; if not, this variable is undefined. ExampleThe following example plays streaming sound if canStreamSound is enabled: on(press) { canStreamSound = _capStreamSound; if (canStreamSound) { // play a streaming sound in a movieclip with this button tellTarget(&quot;music&quot;) { gotoAndPlay(2 }  } See alsocapabilities (System.capabilities)" />
   <page href="00004918.html" title="_focusrect property" text="_focusrect property_focusrect = Boolean;Specifies whether a yellow rectangle appears around the button or movie clip that has keyboard focus. If _focusrect is set to its default value of true, a yellow rectangle appears around the currently focused button or movie clip as the user presses the Tab key to navigate through objects in a SWF file. Specify false if you do not want to show the yellow rectangle. This is a property that can be overridden for specific instances. If the global _focusrect property is set to false, the default behavior for all buttons and movieclips is that keyboard navigation is limited to the Tab key. All other keys, including the Enter and arrow keys, are ignored. To restore full keyboard navigation, you must set _focusrect to true. To restore full keyboard functionality for a specific button or movieclip, you can override this global property by using either Button._focusrect or MovieClip._focusrect.Note: If you use a component, FocusManager overrides Flash Player&#39;s focus handling, including use of this global property.Note: For the Flash Lite 2.0 player, when the _focusrect property is disabled (such as Button.focusRect = false or MovieClip.focusRect = false ), the button or movie clip still receives all events. This behavior is different from the Flash player, for when the _focusrect property is disabled, the button or movie clip will receive the rollOver and rollOut events but will not receive the press and release events.Also for Flash Lite 2.0, you can change the color of the focus rectangle by using the fscommand2 SetFocusRectColor command. This behavior is different from Flash Player, where the color of the focus rectangle is restricted to yellow.ExampleThe following example demonstrates how to hide the yellow rectangle around any instances in a SWF file when they have focus in a browser window. Create some buttons or movie clips and add the following ActionScript in Frame 1 of the Timeline:_focusrect = false;See also_focusrect (Button._focusrect property), _focusrect (MovieClip._focusrect property)" />
   <page href="00004919.html" title="_forceframerate property" text="_forceframerate property_forceframerateIf set to true, this property tells the Flash Lite player to render at the specified frame rate. You can use this property for pseudo-synchronized sound when the content contains device sound. It is set to false by default, which causes Flash Lite to render normally. When set to true, the Flash Lite player might skip rendering certain frames to maintain the frame rate." />
   <page href="00004920.html" title="_global property" text="_global property_global.identifierA reference to the global object that holds the core ActionScript classes, such as String, Object, Math, and Array. For example, you could create a library that is exposed as a global ActionScript object, similar to the Math or Date object. Unlike Timeline-declared or locally declared variables and functions, global variables and functions are visible to every timeline and scope in the SWF file, provided they are not obscured by identifiers with the same names in inner scopes.Note: When setting the value of a global variable, you must use the fully qualified name of the variable, for instance, _global.variableName. Failure to do so creates a local variable of the same name that obscures the global variable you are attempting to set.ReturnsA reference to the global object that holds the core ActionScript classes, such as String, Object, Math, and Array.ExampleThe following example creates a top-level function, factorial(), that is available to every timeline and scope in a SWF file:_global.factorial = function(n:Number) { if (n&amp;lt;=1) { return 1; } else { return n*factorial(n-1 }}// Note: factorial 4 == 4*3*2*1 == 24trace(factorial(4) // output: 24The following example shows how the failure to use the fully qualified variable name when setting the value of a global variable leads to unexpected results: _global.myVar = &quot;global&quot;;trace(&quot;_global.myVar: &quot; + _global.myVar // _global.myVar: globaltrace(&quot;myVar: &quot; + myVar // myVar: globalmyVar = &quot;local&quot;;trace(&quot;_global.myVar: &quot; + _global.myVar // _global.myVar: globaltrace(&quot;myVar: &quot; + myVar // myVar: localSee alsoset variable statement" />
   <page href="00004921.html" title="_highquality property" text="_highquality property_highqualityDeprecated since Flash Player 5. This property was deprecated in favor of _quality.Specifies the level of anti-aliasing applied to the current SWF file. Specify 2 (best quality) to apply the best quality. Specify 1 (high quality) to apply anti-aliasing. Specify 0 (low quality) to prevent anti-aliasing. ExampleThe following ActionScript is placed on the main timeline, and sets the global quality property to apply anti-aliasing. _highquality = 1;See also_quality property" />
   <page href="00004922.html" title="_level property" text="_level property_levelNA reference to the root Timeline of _levelN. You must use loadMovieNum() to load SWF files into the Flash Player before you use the _level property to target them. You can also use _levelN to target a loaded SWF file at the level assigned by N. The initial SWF file loaded into an instance of the Flash Player is automatically loaded into _level0. The SWF file in _level0 sets the frame rate, background color, and frame size for all subsequently loaded SWF files. SWF files are then stacked in higher-numbered levels above the SWF file in _level0.You must assign a level to each SWF file that you load into the Flash Player using loadMovieNum(). You can assign levels in any order. If you assign a level that already contains a SWF file (including _level0), the SWF file at that level is unloaded and replaced by the new SWF file. ExampleThe following example stops the playhead in the main timeline of the SWF file sub.swf that is loaded into _level9. The sub.swf file contains animation and is in the same directory as the document that contains the following ActionScript:loadMovieNum(&quot;sub.swf&quot;, 9myBtn_btn.onRelease = function() { _level9.stop(};You could replace _level9.stop() in the previous example with the following code: _level9.gotoAndStop(5This action sends the playhead in the main Timeline of the SWF file in _level9 to Frame 5 instead of stopping the playhead.See alsoloadMovie function, swapDepths (MovieClip.swapDepths method)" />
   <page href="00004923.html" title="maxscroll property" text="maxscroll propertyvariable_name.maxscrollDeprecated since Flash Player 5. This property was deprecated in favor of TextField.maxscroll.Indicates the line number of the top line of visible text in a text field when the bottom line in the field is also visible. The maxscroll property works with the scroll property to control how information appears in a text field. This property can be retrieved, but not modified.See alsomaxscroll (TextField.maxscroll property), scroll (TextField.scroll property)" />
   <page href="00004924.html" title="_parent property" text="_parent property_parent.property_parent._parent.propertySpecifies or returns a reference to the movie clip or object that contains the current movie clip or object. The current object is the object 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.ExampleIn the following example, there is a movie clip on the Stage with the instance name square_mc. Within that movie clip is another movie clip with an instance name circle_mc. The following ActionScript lets you modify the circle_mc parent instance (which is square_mc) when the circle is clicked. When you are working with relative addressing (using _parent instead of _root), it might be easier to use the Insert Target Path button in the Actions panel at first.this.square_mc.circle_mc.onRelease = function() { this._parent._alpha -= 5;};See also_root property, targetPath function" />
   <page href="00004925.html" title="_quality property" text="ValueDescriptionGraphic Anti-AliasingBitmap Smoothing&quot;LOW&quot;Low rendering quality.Graphics are not anti-aliased. Bitmaps are not smoothed.&quot;MEDIUM&quot; Medium rendering quality. This setting is suitable for movies that do not contain text. Graphics are anti-aliased using a 2 x 2 pixel grid. Bitmaps are not smoothed.&quot;HIGH&quot; High rendering quality. This setting is the default rendering quality setting that Flash uses.Graphics are anti-aliased using a 4 x 4 pixel grid.  Bitmaps are not smoothed._quality property_quality:StringSets or retrieves the rendering quality used for a movie clip. Device fonts are always aliased and therefore are unaffected by the _quality property. The _quality property can be set to the following values: ExampleThe following example sets the rendering quality to LOW:_quality = &quot;LOW&quot;;" />
   <page href="00004926.html" title="_root property" text="_root property_root.movieClip_root.action_root.propertySpecifies or returns a reference to the root movie clip Timeline. If a movie clip has multiple levels, the root movie clip Timeline is on the level containing the currently executing script. For example, if a script in level 1 evaluates _root, _level1 is returned. Specifying _root is the same as using the deprecated slash notation (/) to specify an absolute path within the current level. Note: If a movie clip that contains _root is loaded into another movie clip, _root refers to the Timeline of the loading movie clip, not the Timeline that contains _root. If you want to ensure that _root refers to the Timeline of the loaded movie clip even if it is loaded into another movie clip, use MovieClip._lockroot.ParametersmovieClip:String - The instance name of a movie clip.action:String - An action or field.property:String - A property of the MovieClip object.ExampleThe following example stops the Timeline of the level containing the currently executing script:_root.stop(The following example traces variables and instances in the scope of _root:for (prop in _root) { trace(&quot;_root.&quot;+prop+&quot; = &quot;+_root[prop]}See also_lockroot (MovieClip._lockroot property), _parent property, targetPath function" />
   <page href="00004927.html" title="scroll property" text="scroll propertytextFieldVariableName.scroll = xDeprecated since Flash Player 5. This property was deprecated in favor of TextField.scroll.Controls the display of information in a text field associated with a variable. The scroll property defines where the text field begins displaying content; after you set it, Flash Player updates it as the user scrolls through the text field. The scroll property is useful for directing users to a specific paragraph in a long passage or creating scrolling text fields. This property can be retrieved and modified.ExampleThe following code is attached to an Up button that scrolls the text field named myText:  on (release) { myText.scroll = myText.scroll + 1; }See alsomaxscroll (TextField.maxscroll property), scroll (TextField.scroll property)" />
   <page href="00004928.html" title="_soundbuftime property" text="_soundbuftime property_soundbuftime:Number = integerEstablishes the number of seconds of streaming sound to buffer. The default value is 5 seconds.Parametersinteger:Number - The number of seconds before the SWF file starts to stream.ExampleThe following example streams an MP3 file and buffers the sound before it plays for the user. Two text fields are created at runtime to hold a timer and debugging information. The _soundbuftime property is set to buffer the MP3 for 10 seconds. A new Sound object instance is created for the MP3. // create text fields to hold debug information.this.createTextField(&quot;counter_txt&quot;, this.getNextHighestDepth(), 0, 0, 100, 22this.createTextField(&quot;debug_txt&quot;, this.getNextHighestDepth(), 0, 20, 100, 22// set the sound buffer to 10 seconds._soundbuftime = 10;// create the new sound object instance.var bg_sound:Sound = new Sound(// load the MP3 sound file and set streaming to true.bg_sound.loadSound(&quot;yourSound.mp3&quot;, true// function is triggered when the song finishes loading.bg_sound.onLoad = function() { debug_txt.text = &quot;sound loaded&quot;;};debug_txt.text = &quot;sound init&quot;;function updateCounter() { counter_txt.text++;}counter_txt.text = 0;setInterval(updateCounter, 1000" />
   <page href="00004929.html" title="this property" text="this propertythisReferences an object or movie clip instance. When a script executes, this references the movie clip instance that contains the script. When a field is called, this contains a reference to the object that contains the called field. Inside an on() event handler attached to a button, this refers to the Timeline that contains the button. Inside an onClipEvent() event handler attached to a movie clip, this refers to the Timeline of the movie clip itself. Because this is evaluated in the context of the script that contains it, you can&#39;t use this in a script to refer to a variable defined in a class file. Create ApplyThis.as, and enter the following code:class ApplyThis {var str:String = &quot;Defined in ApplyThis.as&quot;;function conctStr(x:String):String {return x+x;}function addStr():String {return str;}}Then, in a FLA or AS file, add the following ActionScript:var obj:ApplyThis = new ApplyThis(var abj:ApplyThis = new ApplyThis(abj.str = &quot;defined in FLA or AS&quot;;trace(obj.addStr.call(abj, null) //output: defined in FLA or AStrace(obj.addStr.call(this, null) //output: undefinedtrace(obj.addStr.call(obj, null) //output: Defined in applyThis.asSimilarly, to call a function defined in a dynamic class, you must use this to invoke the function in the proper scope:// incorrect version of Simple.as/*dynamic class Simple {function callfunc() {trace(func()}}*/// correct version of Simple.asdynamic class simple {function callfunc() {trace(this.func()}}Inside the FLA or AS file, add the following ActionScript:var obj:Simple = new Simple(obj.num = 0;obj.func = function() {return true;};obj.callfunc(// output: trueYou get a syntax error when you use the incorrect version of Simple.as.ExampleIn the following example, the keyword this references the Circle object:function Circle(radius:Number):Void { this.radius = radius; this.area = Math.PI*Math.pow(radius, 2}var myCircle = new Circle(4trace(myCircle.areaIn the following statement assigned to a frame inside a movie clip, the keyword this references the current movie clip.// sets the alpha property of the current movie clip to 20this._alpha = 20;In the following statement inside a MovieClip.onPress handler, the keyword this references the current movie clip:this.square_mc.onPress = function() { startDrag(this};this.square_mc.onRelease = function() { stopDrag(};See alsoConstants, onClipEvent handler" />
   <page href="00004930.html" title="Operators" text="OperatorDescription+ (addition)Adds numeric expressions or concatenates (combines) strings.+= (addition assignment)Assigns expression1 the value of expression1 + expression2.[] (array access)Initializes a new array or multidimensional array with the specified elements (a0 , and so on), or accesses elements in an array.= (assignment)Assigns the value of expression2 (the parameter on the right) to the variable, array element, or property in expression1.&amp; (bitwise AND)Converts expression1 and expression2 to 32-bit unsigned integers, and performs a Boolean AND operation on each bit of the integer parameters.&amp;= (bitwise AND assignment)Assigns expression1 the value of expression1&amp; expression2.&lt;&lt; (bitwise left shift)Converts expression1 and expression2 to 32-bit integers, and shifts all the bits in expression1 to the left by the number of places specified by the integer resulting from the conversion of expression2.&lt;&lt;= (bitwise left shift and assignment)This operator performs a bitwise left shift (&lt;&lt;=) operation and stores the contents as a result in expression1.~ (bitwise NOT)Also known as the one&#39;s complement operator or the bitwise complement operator.| (bitwise OR)Converts expression1 and expression2 to 32-bit unsigned integers, and returns a 1 in each bit position where the corresponding bits of either expression1 or expression2 are 1.|= (bitwise OR assignment)Assigns expression1 the value of expression1 | expression2.&gt;&gt; (bitwise right shift)Converts expression1 and expression2 to 32-bit integers, and shifts all the bits in expression1 to the right by the number of places specified by the integer that results from the conversion of expression2.&gt;&gt;= (bitwise right shift and assignment)This operator performs a bitwise right-shift operation and stores the contents as a result in expression1.&gt;&gt;&gt; (bitwise unsigned right shift)The same as the bitwise right shift (&gt;&gt; ) operator except that it does not preserve the sign of the original expression because the bits on the left are always filled with 0. Floating-point numbers are converted to integers by discarding any digits after the decimal point.&gt;&gt;&gt;= (bitwise unsigned right shift and assignment)Performs an unsigned bitwise right-shift operation and stores the contents as a result in expression1.^ (bitwise XOR)Converts expression1 and expression2 to 32-bit unsigned integers, and returns a 1 in each bit position where the corresponding bits in expression1 or expression2 , but not both, are 1.^= (bitwise XOR assignment)Assigns expression1 the value of expression1 ^ expression2./* (block comment delimiter)Indicates one or more lines of script comments., (comma)Evaluates expression1 , then expression2 , and so on.add (concatenation (strings))Deprecated since Flash Player 5. Adobe recommends you use the addition (+) operator when creating content for Flash Player 5 or later.Note: Flash Lite 2.0 also deprecates the add operator in favor of the addition (+) operator.Concatenates two or more strings.?: (conditional)Instructs Flash to evaluate expression1 , and if the value of expression1 is true , it returns the value of expression2 ; otherwise it returns the value of expression3.-- (decrement)A pre-decrement and post-decrement unary operator that subtracts 1 from the expression./ (division)Divides expression1 by expression2./= (division assignment)Assigns expression1 the value of expression1 / expression2.. (dot)Used to navigate movie clip hierarchies to access nested (child) movie clips, variables, or properties.== (equality)Tests two expressions for equality.eq (equality (strings))Deprecated since Flash Player 5. This operator was deprecated in favor of the == (equality) operator.Returns true if the string representation of expression1 is equal to the string representation of expression2, false otherwise.&gt; (greater than)Compares two expressions and determines whether expression1 is greater than expression2; if it is, the operator returns true.gt (greater than (strings))Deprecated since Flash Player 5. This operator was deprecated in favor of the &gt; (greater than) operator.Compares the string representation of expression1 with the string representation of expression2 and returns true if expression1 is greater than expression2, false otherwise.&gt;= (greater than or equal to)Compares two expressions and determines whether expression1 is greater than or equal to expression2 (true) or expression1 is less than expression2 (false).ge (greater than or equal to (strings))Deprecated since Flash Player 5. This operator was deprecated in favor of the &gt;= (greater than or equal to) operator.Returns true if expression1 is greater than or equal to expression2, false otherwise.++ (increment)A pre-increment and post-increment unary operator that adds 1 to expression .!= (inequality)Tests for the exact opposite of the equality (== ) operator.&lt;&gt; (inequality)Deprecated since Flash Player 5. This operator has been deprecated. Adobe recommends that you use the != (inequality) operator.Tests for the exact opposite of the equality (==) operator.instanceofTests whether object is an instance of classConstructor or a subclass of classConstructor.&lt; (less than)Compares two expressions and determines whether expression1 is less than expression2 ; if so, the operator returns true.lt (less than (strings))Deprecated since Flash Player 5. This operator was deprecated in favor of the &lt; (less than) operator.Returns true if expression1 is less than expression2, false otherwise.&lt;= (less than or equal to)Compares two expressions and determines whether expression1 is less than or equal to expression2 ; if it is, the operator returns true.le (less than or equal to (strings))Deprecated since Flash Player 5. This operator was deprecated in Flash 5 in favor of the &lt;= (less than or equal to) operator.Returns true if expression1 is less than or equal to expression2, false otherwise.// (line comment delimiter)Indicates the beginning of a script comment.&amp;&amp; (logical AND)Performs a Boolean operation on the values of one or both of the expressions.and (logical AND)Deprecated since Flash Player 5. Adobe recommends that you use the logical AND (&amp;&amp;) operator.Performs a logical AND (&amp;&amp;) operation in Flash Player 4.! (logical NOT)Inverts the Boolean value of a variable or expression.not (logical NOT)Deprecated since Flash Player 5. This operator was deprecated in favor of the! (logical NOT) operator.Performs a logical NOT (!) operation in Flash Player 4.|| (logical OR)Evaluates expression1 (the expression on the left side of the operator) and returns true if the expression evaluates to true.or (logical OR)Deprecated since Flash Player 5. This operator was deprecated in favor of the || (logical OR) operator.Evaluates condition1 and condition2, and if either expression is true, the whole expression is true.% (modulo)Calculates the remainder of expression1 divided by expression2.%= (modulo assignment)Assigns expression1 the value of expression1 % expression2.* (multiplication)Multiplies two numerical expressions.*= (multiplication assignment)Assigns expression1 the value of expression1 * expression2.newCreates a new, initially anonymous, object and calls the function identified by the constructor parameter.ne (not equal (strings))Deprecated since Flash Player 5. This operator was deprecated in favor of the != (inequality) operator.Returns true if expression1 is not equal to expression2; false otherwise.{} (object initializer)Creates a new object and initializes it with the specified name and value property pairs.() (parentheses)Performs a grouping operation on one or more parameters, performs sequential evaluation of expressions, or surrounds one or more parameters and passes them as parameters to a function outside the parentheses.=== (strict equality)Tests two expressions for equality; the strict equality (=== )operator performs in the same way as the equality (== ) operator, except that data types are not converted.!== (strict inequality)Tests for the exact opposite of the strict equality ( === ) operator.&quot; (string delimiter)When used before and after characters, quotation marks (&quot;) indicate that the characters have a literal value and are considered a string, not a variable, numerical value, or other ActionScript element.- (subtraction)Used for negating or subtracting.-= (subtraction assignment)Assigns expression1 the value of expression1 - expression2.: (type)Used for strict data typing; this operator specifies the variable type, function return type, or function parameter type.typeofThe typeof operator evaluate the expression and returns a string specifying whether the expression is a String, MovieClip, Object, Function, Number, or Boolean value.voidThe void operator evaluates an expression and then discards its value, returning undefined.OperatorsSymbolic operators are characters that specify how to combine, compare, or modify the values of an expression.Operators summary" />
   <page href="00004931.html" title="+ addition operator" text="+ addition operatorexpression1 + expression2Adds 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 floating-point numbers, the sum is a floating-point number.Note: Flash Lite 2.0 supports the addition (+) operator for adding numeric expressions and concatenating strings. Flash Lite 1.x only supports the addition (+) operator for adding numeric expressions (such as var1 = 1 + 2 // output: 3). For Flash Lite 1.x, you must use the add operator to concatenate strings.Operandsexpression1 - A number or string.expression2 - A number or string.ReturnsObject - A string, integer, or floating-point number.ExampleUsage 1: The following example concatenates two strings and displays the result in the Output panel. var name:String = &quot;Cola&quot;; var instrument:String = &quot;Drums&quot;; trace(name + &quot; plays &quot; + instrument // output: Cola plays Drums Note: Flash Lite 1.x does not support the addition (+) operator for concatenating strings. For Flash Lite 1.x, you must use the add operator to concatenate strings. 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 floating-point 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() function 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 The following example shows how numeric sums to the right of a string expression are not calculated: var a:String = 3 + 10 + &quot;asdf&quot;; trace(a // 13asdf var b:String = &quot;asdf&quot; + 3 + 10; trace(b // asdf310 " />
   <page href="00004932.html" title="+= addition assignment operator" text="+= addition assignment operatorexpression1 += expression2Assigns expression1 the value of expression1+ expression2. For example, the following two statements have the same result:  x += y; x = x + y;  This operator also performs string concatenation. All the rules of the addition (+) operator apply to the addition assignment (+=) operator.Operandsexpression1 : Number - A number or string.expression2 : Number - A number or string.ReturnsNumber - The result of the addition.ExampleUsage 1: This example uses the+= operator with a string expression and sends &quot;My name is Gilbert&quot; to the Output panel. var x1:String = &quot;My name is &quot;; x1 += &quot;Gilbert&quot;; trace(x1 // output: My name is Gilbert  Usage 2: The following example shows a numeric use of the addition assignment (+=) operator: var x:Number = 5; var y:Number = 10; x += y; trace(x // output: 15 See also+ addition operator" />
   <page href="00004933.html" title="[] array access operator" text="[] array access operatormyArray = [ a0, a1,...aN ]myArray[ i ] = valuemyObject [ propertyName ]Initializes a new array or multidimensional array with the specified elements (a0, and so on), or accesses elements in an array. The array access operator lets you dynamically set and retrieve instance, variable, and object names. It also lets you access object properties. Usage 1: An array is an object whose properties are called elements, which are each identified by a number called an index. When you create an array, you surround the elements with the array access ([]) operator (or brackets). An array can contain elements of various types. For example, the following array, called employee, has three elements; the first is a number and the second two are strings (inside quotation marks): var employee:Array = [15, &quot;Barbara&quot;, &quot;Jay&quot;];  You can nest brackets to simulate multidimensional arrays. You can nest arrays up to 256 levels deep. The following code creates an array called ticTacToe with three elements; each element is also an array with three elements: var ticTacToe:Array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; // Select Debug &gt; List Variables in test mode // to see a list of the array elements.  Usage 2: Surround the index of each element with brackets ([]) to access it directly; you can add a new element to an array, or you can change or retrieve the value of an existing element. The first index in an array is always 0, as shown in the following example: var my_array:Array = new Array( my_array[0] = 15; my_array[1] = &quot;Hello&quot;; my_array[2] = true;  You can use brackets ([]) to add a fourth element, as shown in the following example: my_array[3] = &quot;George&quot;;  You can use brackets ([]) to access an element in a multidimensional array. The first set of brackets identifies the element in the original array, and the second set identifies the element in the nested array. The following lines of code send the number 6 to the Output panel. var ticTacToe:Array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; trace(ticTacToe[1][2]// output: 6  Usage 3: You can use the array access ([]) operator instead of the eval() function to dynamically set and retrieve values for movie clip names or any property of an object. The following line of code sends the number 6 to the Output panel. name[&quot;mc&quot; + i] = &quot;left_corner&quot;; OperandsmyArray : Object - myArray The name of an array.a0, a1,...aN : Object - a0,a1,...aN Elements in an array; any native type or object instance, including nested arrays.i : Number - i An integer index greater than or equal to 0.myObject : Object - myObject The name of an object.propertyName : String - propertyName A string that names a property of the object.ReturnsObject - Usage 1: A reference to an array. Usage 2: A value from the array; either a native type or an object instance (including an Array instance). Usage 3: A property from the object; either a native type or an object instance (including an Array instance). ExampleThe following example shows two ways to create a new empty Array object; the first line uses brackets ([]): var my_array:Array = []; var my_array:Array = new Array( The following example creates an array called employee_array and uses the trace() statement to send the elements to the Output panel. In the fourth line, an element in the array is changed, and the fifth line sends the newly modified array to the Output panel: var employee_array = [&quot;Barbara&quot;, &quot;George&quot;, &quot;Mary&quot;]; trace(employee_array // output: Barbara,George,Mary employee_array[2] = &quot;Sam&quot;; trace(employee_array // output: Barbara,George,Sam  In the following example, the expression inside the brackets (&quot;piece&quot; + i ) is evaluated and the result is used as the name of the variable to be retrieved from the my_mc movie clip. In this example, the variable i must live on the same Timeline as the button. If the variable i is equal to 5, for example, the value of the variable piece5 in the my_mc movie clip is displayed in the Output panel: myBtn_btn.onRelease = function() {  x = my_mc[&quot;piece&quot;+i];  trace(x };  In the following example, the expression inside the brackets is evaluated, and the result is used as the name of the variable to be retrieved from movie clip name_mc: name_mc[&quot;A&quot; + i];  If you are familiar with the Flash 4 ActionScript slash syntax, you can use the eval() function to accomplish the same result: eval(&quot;name_mc.A&quot; &amp; i  You can use the following ActionScript to loop over all objects in the _root scope, which is useful for debugging: for (i in _root) {  trace(i+&quot;: &quot;+_root[i] }  You can also use the array access ([]) operator on the left side of an assignment statement to dynamically set instance, variable, and object names: employee_array[2] = &quot;Sam&quot;;See alsoArray, Object, eval function" />
   <page href="00004934.html" title="= assignment operator" text="= assignment operatorexpression1 = expression2Assigns the value of expression2 (the parameter on the right) to the variable, array element, or property in expression1. Assignment can be either by value or by reference. Assignment by value copies the actual value of expression2 and stores it in expression1. Assignment by value is used when a variable is assigned a number or string literal. Assignment by reference stores a reference to expression2 in expression1. Assignment by reference is commonly used with the new operator. Use of the new operator creates an object in memory and a reference to that location in memory is assigned to a variable.Operandsexpression1 : Object - A variable, element of an array, or property of an object.expression2 : Object - A value of any type.ReturnsObject - The assigned value, expression2 .ExampleThe following example uses assignment by value to assign the value of 5 to the variable x. var x:Number = 5;The following example uses assignment by value to assign the value &quot;hello&quot; to the variable x:var x:String;x = &quot; hello &quot;;The following example uses assignment by reference to create the moonsOfJupiter variable, which contains a reference to a newly created Array object. Assignment by value is then used to copy the value &quot;Callisto&quot; to the first element of the array referenced by the variable moonsOfJupiter: var moonsOfJupiter:Array = new Array(moonsOfJupiter[0] = &quot;Callisto&quot;;The following example uses assignment by reference to create a new object, and assign a reference to that object to the variable mercury. Assignment by value is then used to assign the value of 3030 to the diameter property of the mercury object:var mercury:Object = new Object( mercury.diameter = 3030; // in miles trace (mercury.diameter // output: 3030The following example builds upon the previous example by creating a variable named merkur (the German word for mercury) and assigning it the value of mercury. This creates two variables that reference the same object in memory, which means you can use either variable to access the object&#39;s properties. We can then change the diameter property to use kilometers instead of miles:var merkur:Object = mercury; merkur.diameter = 4878; // in kilometers trace (mercury.diameter // output: 4878See also== equality operator" />
   <page href="00004935.html" title="&amp; bitwise AND operator" text="&amp; bitwise AND operatorexpression1 &amp; expression2Converts expression1 and expression2 to 32-bit unsigned integers, and performs a Boolean AND operation on each bit of the integer parameters. Floating-point numbers are converted to integers by discarding any digits after the decimal point. The result is a new 32-bit integer. Positive integers are converted to an unsigned hex value with a maximum value of 4294967295 or 0xFFFFFFFF; values larger than the maximum have their most significant digits discarded when they are converted so the value is still 32-bit. Negative numbers are converted to an unsigned hex value using the two&#39;s complement notation, with the minimum being -2147483648 or 0x800000000; numbers less than the minimum are converted to two&#39;s complement with greater precision and then have the most significant dig its discarded as well. The return value is interpreted as a signed two&#39;s complement number, so the return is an integer in the range -2147483648 to 2147483647. Operandsexpression1 : Number - A number.expression2 : Number - A number.ReturnsNumber - The result of the bitwise operation.ExampleThe following example compares the bit representation of the numbers and returns 1 only if both bits at the same position are 1. In the following ActionScript code, you add 13 (binary 1101) and 11 (binary 1011) and return 1 only in the position where both numbers have a 1. var insert:Number = 13; var update:Number = 11; trace(insert &amp; update // output : 9 (or 1001 binary)  In the numbers 13 and 11 the result is 9 because only the first and last positions in both numbers have the number 1. The following example shows the behavior of the return value conversion: trace(0xFFFFFFFF // 4294967295 trace(0xFFFFFFFF &amp; 0xFFFFFFFF // -1 trace(0xFFFFFFFF &amp; -1 // -1 trace(4294967295 &amp; -1 // -1 trace(4294967295 &amp; 4294967295 // -1 See also&amp;= bitwise AND assignment operator, ^ bitwise XOR operator, ^= bitwise XOR assignment operator, | bitwise OR operator, |= bitwise OR assignment operator, ~ bitwise NOT operator" />
   <page href="00004936.html" title="&amp;= bitwise AND assignment operator" text="&amp;= bitwise AND assignment operatorexpression1 &amp;= expression2Assigns expression1 the value of expression1&amp; expression2. For example, the following two expressions are equivalent: x &amp;= y; x = x &amp; y; Operandsexpression1 : Number - A number.expression2 : Number - A number.ReturnsNumber - The value of expression1 &amp; expression2 .ExampleThe following example assigns the value 9 to x: var x:Number = 15; var y:Number = 9; trace(x &amp;= y // output: 9 See also&amp; bitwise AND operator, ^ bitwise XOR operator, ^= bitwise XOR assignment operator, | bitwise OR operator, |= bitwise OR assignment operator, ~ bitwise NOT operator" />
   <page href="00004937.html" title="&lt;&lt; bitwise left shift operator" text="&lt;&lt; bitwise left shift operatorexpression1 &lt;&lt; expression2Converts expression1 and expression2 to 32-bit integers, and shifts all the bits in expression1 to the left by the number of places specified by the integer resulting from the conversion of expression2. The bit positions that are emptied as a result of this operation are filled in with 0 and bits shifted off the left end are discarded. Shifting a value left by one position is the equivalent of multiplying it by 2. Floating-point numbers are converted to integers by discarding any digits after the decimal point. Positive integers are converted to an unsigned hex value with a maximum value of 4294967295 or 0xFFFFFFFF; values larger than the maximum have their most significant digits discarded when they are converted so the value is still 32-bit. Negative numbers are converted to an unsigned hex value via the two&#39;s complement notation, with the minimum being -2147483648 or 0x800000000; numbers less than the minimum are converted to two&#39;s complement with greater precision and also have the most significant digits discarded. The return value is interpreted as a two&#39;s complement number with sign, so the return value will be an integer in the range -2147483648 to 2147483647. Operandsexpression1 : Number - A number or expression to be shifted left.expression2 : Number - A number or expression that converts to an integer from 0 to 31.ReturnsNumber - The result of the bitwise operation.ExampleIn the following example, the integer 1 is shifted 10 bits to the left: x = 1 &lt;&lt; 10 The result of this operation is x = 1024. This is because 1 decimal equals 1 binary, 1 binary shifted left by 10 is 10000000000 binary, and 10000000000 binary is 1024 decimal. In the following example, the integer 7 is shifted 8 bits to the left: x = 7 &lt;&lt; 8 The result of this operation is x = 1792. This is because 7 decimal equals 111 binary, 111 binary shifted left by 8 bits is 11100000000 binary, and 11100000000 binary is 1792 decimal. If you trace the following example, you see that the bits have been pushed two spaces to the left: // 2 binary == 0010 // 8 binary == 1000 trace(2 &lt;&lt; 2 // output: 8 See also&gt;&gt;= bitwise right shift and assignment operator, &gt;&gt; bitwise right shift operator, &lt;&lt;= bitwise left shift and assignment operator, &gt;&gt;&gt; bitwise unsigned right shift operator, &gt;&gt;&gt;= bitwise unsigned right shift and assignment operator" />
   <page href="00004938.html" title="&lt;&lt;= bitwise left shift and assignment operator" text="&lt;&lt;= bitwise left shift and assignment operatorexpression1 &lt;&lt;= expression2This operator performs a bitwise left shift (&lt;&lt;=) operation and stores the contents as a result in expression1. The following two expressions are equivalent: A &lt;&lt;= BA = (A &lt;&lt; B)Operandsexpression1 : Number - A number or expression to be shifted left.expression2 : Number - A number or expression that converts to an integer from 0 to 31.ReturnsNumber - The result of the bitwise operation.ExampleIn the following example, you use the bitwise left shift and assignment (&lt;&lt;=) operator to shift all bits one space to the left:  var x:Number = 4; // shift all bits one slot to the left. x &lt;&lt;= 1; trace(x // output: 8 // 4 decimal = 0100 binary // 8 decimal = 1000 binary See also&lt;&lt; bitwise left shift operator, &gt;&gt;= bitwise right shift and assignment operator, &gt;&gt; bitwise right shift operator" />
   <page href="00004939.html" title="~ bitwise NOT operator" text="~ bitwise NOT operator~expressionAlso known as the one&#39;s complement operator or the bitwise complement operator. Converts the expressionto a 32-bit signed integer, and then applies a bitwise one&#39;s complement. That is, every bit that is a 0 is set to 1 in the result, and every bit that is a 1 is set to 0 in the result. The result is a signed 32-bit integer. For example, the hex value 0x7777 is represented as this binary number: 0111011101110111The bitwise negation of that hex value, ~0x7777, is this binary number: 1000100010001000In hexadecimal, this is 0x8888. Therefore, ~0x7777 is 0x8888.The most common use of bitwise operators is for representing flag bits (Boolean values packed into 1 bit each). Floating-point numbers are converted to integers by discarding any digits after the decimal point. Positive integers are converted to an unsigned hex value with a maximum value of 4294967295 or 0xFFFFFFFF; values larger than the maximum have their most significant digits discarded when they are converted so the value is still 32-bit. Negative numbers are converted to an unsigned hex value via the two&#39;s complement notation, with the minimum being -2147483648 or 0x800000000; numbers less than the minimum are converted to two&#39;s complement with greater precision and also have the most significant digits discarded. The return value is interpreted as a two&#39;s complement number with sign, so the return value is an integer in the range -2147483648 to 2147483647.Operandsexpression : Number - A number.ReturnsNumber - The result of the bitwise operation.ExampleThe following example demonstrates a use of the bitwise NOT (-) operator with flag bits: var ReadOnlyFlag:Number = 0x0001; // defines bit 0 as the read-only flag var flags:Number = 0; trace(flags /* To set the read-only flag in the flags variable,  the following code uses the bitwise OR: */flags |= ReadOnlyFlag; trace(flags /* To clear the read-only flag in the flags variable,  first construct a mask by using bitwise NOT on ReadOnlyFlag.  In the mask, every bit is a 1 except for the read-only flag.  Then, use bitwise AND with the mask to clear the read-only flag.  The following code constructs the mask and performs the bitwise AND: */ flags &amp;= ~ReadOnlyFlag; trace(flags // output: 0 1 0 See also&amp; bitwise AND operator, &amp;= bitwise AND assignment operator, ^ bitwise XOR operator, ^= bitwise XOR assignment operator, | bitwise OR operator, |= bitwise OR assignment operator" />
   <page href="00004940.html" title="| bitwise OR operator" text="| bitwise OR operatorexpression1 | expression2Converts expression1 and expression2 to 32-bit unsigned integers, and returns a 1 in each bit position where the corresponding bits of either expression1 or expression2 are 1. Floating-point numbers are converted to integers by discarding any digits after the decimal point. The result is a new 32-bit integer. Positive integers are converted to an unsigned hex value with a maximum value of 4294967295 or 0xFFFFFFFF; values larger than the maximum have their most significant digits discarded when they are converted so the value is still 32-bit. Negative numbers are converted to an unsigned hex value via the two&#39;s complement notation, with the minimum being -2147483648 or 0x800000000; numbers less than the minimum are converted to two&#39;s complement with greater precision and also have the most significant digits discarded. The return value is interpreted as a two&#39;s complement number with sign, so the return value will be an integer in the range -2147483648 to 2147483647. Operandsexpression1 : Number - A number.expression2 : Number - A number.ReturnsNumber - The result of the bitwise operation.ExampleThe following is an example of a bitwise OR (|) operation: // 15 decimal = 1111 binary var x:Number = 15; // 9 decimal = 1001 binary var y:Number = 9; // 1111 | 1001 = 1111 trace(x | y // returns 15 decimal (1111 binary)  Don&#39;t confuse the single | (bitwise OR) with || (logical OR).See also&amp; bitwise AND operator, &amp;= bitwise AND assignment operator, ^ bitwise XOR operator, ^= bitwise XOR assignment operator, |= bitwise OR assignment operator, ~ bitwise NOT operator" />
   <page href="00004941.html" title="|= bitwise OR assignment operator" text="|= bitwise OR assignment operatorexpression1 |= expression2Assigns expression1 the value of expression1 | expression2. For example, the following two statements are equivalent: x |= y; and x = x | y; Operandsexpression1 : Number - A number or variable.expression2 : Number - A number or variable.ReturnsNumber - The result of the bitwise operation.ExampleThe following example uses the bitwise OR assignment (|=) operator: // 15 decimal = 1111 binary var x:Number = 15; // 9 decimal = 1001 binary var y:Number = 9; // 1111 |= 1001 = 1111 trace(x |= y // returns 15 decimal (1111 binary) See also&amp; bitwise AND operator, &amp;= bitwise AND assignment operator, ^ bitwise XOR operator, ^= bitwise XOR assignment operator, | bitwise OR operator, |= bitwise OR assignment operator, ~ bitwise NOT operator" />
   <page href="00004942.html" title="&gt;&gt; bitwise right shift operator" text="&gt;&gt; bitwise right shift operatorexpression1 &gt;&gt; expression2Converts expression1 and expression2 to 32-bit integers, and shifts all the bits in expression1 to the right by the number of places specified by the integer that results from the conversion of expression2 . Bits that are shifted off the right end are discarded. To preserve the sign of the original expression , the bits on the left are filled in with 0 if the most significant bit (the bit farthest to the left) of expression1 is 0, and filled in with 1 if the most significant bit is 1. Shifting a value right by one position is the equivalent of dividing by 2 and discarding the remainder. Floating-point numbers are converted to integers by discarding any digits after the decimal point. Positive integers are converted to an unsigned hex value with a maximum value of 4294967295 or 0xFFFFFFFF; values larger than the maximum have their most significant digits discarded when they are converted so the value is still 32-bit. Negative numbers are converted to an unsigned hex value via the two&#39;s complement notation, with the minimum being -2147483648 or 0x800000000; numbers less than the minimum are converted to two&#39;s complement with greater precision and also have the most significant digits discarded. The return value is interpreted as a two&#39;s complement number with sign, so the return value will be an integer in the range -2147483648 to 2147483647. Operandsexpression1 : Number - A number or expression to be shifted right.expression2 : Number - A number or expression that converts to an integer from 0 to 31.ReturnsNumber - The result of the bitwise operation.ExampleThe following example converts 65535 to a 32-bit integer and shifts it 8 bits to the right: var x:Number = 65535 &gt;&gt; 8; trace(x // outputs 255 The following example shows the result of the previous example: var x:Number = 255; This is because 65535 decimal equals 1111111111111111 binary (sixteen 1s), 1111111111111111 binary shifted right by 8 bits is 11111111 binary, and 11111111 binary is 255 decimal. The most significant bit is 0 because the integers are 32-bit, so the fill bit is 0. The following example converts -1 to a 32-bit integer and shifts it 1 bit to the right:var x:Number = -1 &gt;&gt; 1;trace(x // outputs -1 The following example shows the result of the previous example: var x:Number = -1; This is because -1 decimal equals 11111111111111111111111111111111 binary (thirty-two 1s), shifting right by one bit causes the least significant (bit farthest to the right) to be discarded and the most significant bit to be filled in with 1. The result is 11111111111111111111111111111111 (thirty-two 1s) binary, which represents the 32-bit integer -1.See also&gt;&gt;= bitwise right shift and assignment operator" />
   <page href="00004943.html" title="&gt;&gt;= bitwise right shift and assignment operator" text="&gt;&gt;= bitwise right shift and assignment operatorexpression1 &gt;&gt;= expression2This operator performs a bitwise right-shift operation and stores the contents as a result in expression1. The following two statements are equivalent: A &gt;&gt;= B; and A = (A &gt;&gt; BOperandsexpression1 : Number - A number or expression to be shifted right.expression2 : Number - A number or expression that converts to an integer from 0 to 31.ReturnsNumber - The result of the bitwise operation.ExampleThe following commented code uses the bitwise right shift and assignment (&gt;&gt;=) operator. function convertToBinary(numberToConvert:Number):String {  var result:String = &quot;&quot;;  for (var i = 0; i&lt;32; i++) {  // Extract least significant bit using bitwise AND  var lsb:Number = numberToConvert &amp; 1;  // Add this bit to the result  string result = (lsb ? &quot;1&quot; : &quot;0&quot;)+result;  // Shift numberToConvert right by one bit, to see next bit  numberToConvert &gt;&gt;= 1;  }  return result; } trace(convertToBinary(479) // Returns the string 00000000000000000000000111011111 // This string is the binary representation of the decimal // number 479See also&gt;&gt; bitwise right shift operator" />
   <page href="00004944.html" title="&gt;&gt;&gt; bitwise unsigned right shift operator" text="&gt;&gt;&gt; bitwise unsigned right shift operatorexpression1 &gt;&gt;&gt; expression2The same as the bitwise right shift (&gt;&gt;) operator except that it does not preserve the sign of the original expression because the bits on the left are always filled with 0. Floating-point numbers are converted to integers by discarding any digits after the decimal point. Positive integers are converted to an unsigned hex value with a maximum value of 4294967295 or 0xFFFFFFFF; values larger than the maximum have their most significant digits discarded when they are converted so the value is still 32-bit. Negative numbers are converted to an unsigned hex value via the two&#39;s complement notation, with the minimum being -2147483648 or 0x800000000; numbers less than the minimum are converted to two&#39;s complement with greater precision and also have the most significant digits discarded. Operandsexpression1 : Number - A number or expression to be shifted right.expression2 : Number - A number or expression that converts to an integer between 0 and 31.ReturnsNumber - The result of the bitwise operation.ExampleThe following example converts -1 to a 32-bit integer and shifts it 1 bit to the right: var x:Number = -1 &gt;&gt;&gt; 1; trace(x // output: 2147483647 This is because -1 decimal is 11111111111111111111111111111111 binary (thirty-two 1s), and when you shift right (unsigned) by 1 bit, the least significant (rightmost) bit is discarded, and the most significant (leftmost) bit is filled with a 0. The result is 01111111111111111111111111111111 binary, which represents the 32-bit integer 2147483647. See also&gt;&gt;= bitwise right shift and assignment operator" />
   <page href="00004945.html" title="&gt;&gt;&gt;= bitwise unsigned right shift and assignment operator" text="&gt;&gt;&gt;= bitwise unsigned right shift and assignment operatorexpression1 &gt;&gt;&gt;= expression2Performs an unsigned bitwise right-shift operation and stores the contents as a result in expression1. The following two statements are equivalent: A &gt;&gt;&gt;= B; and A = (A &gt;&gt;&gt; B Operandsexpression1 : Number - A number or expression to be shifted right.expression2 : Number - A number or expression that converts to an integer from 0 to 31.ReturnsNumber - The result of the bitwise operation.ExampleSee also&gt;&gt;&gt; bitwise unsigned right shift operator, &gt;&gt;= bitwise right shift and assignment operator" />
   <page href="00004946.html" title="^ bitwise XOR operator" text="^ bitwise XOR operatorexpression1 ^ expression2Converts expression1 and expression2 to 32-bit unsigned integers, and returns a 1 in each bit position where the corresponding bits in expression1 or expression2, but not both, are 1. Floating-point numbers are converted to integers by discarding any digits after the decimal point. The result is a new 32-bit integer. Positive integers are converted to an unsigned hex value with a maximum value of 4294967295 or 0xFFFFFFFF; values larger than the maximum have their most significant digits discarded when they are converted so the value is still 32-bit. Negative numbers are converted to an unsigned hex value via the two&#39;s complement notation, with the minimum being -2147483648 or 0x800000000; numbers less than the minimum are converted to two&#39;s complement with greater precision and also have the most significant digits discarded. The return value is interpreted as a two&#39;s complement number with sign, so the return value will be an integer in the range -2147483648 to 2147483647. Operandsexpression1 : Number - A number.expression2 : Number - A number.ReturnsNumber - The result of the bitwise operation.ExampleThe following example uses the bitwise XOR operator on the decimals 15 and 9, and assigns the result to the variable x: // 15 decimal = 1111 binary // 9 decimal = 1001 binary var x:Number = 15 ^ 9; trace(x // 1111 ^ 1001 = 0110 // returns 6 decimal (0110 binary) See also&amp; bitwise AND operator, &amp;= bitwise AND assignment operator, ^= bitwise XOR assignment operator, | bitwise OR operator, |= bitwise OR assignment operator, ~ bitwise NOT operator" />
   <page href="00004947.html" title="^= bitwise XOR assignment operator" text="^= bitwise XOR assignment operatorexpression1 ^= expression2Assigns expression1 the value of expression1 ^ expression2. For example, the following two statements are equivalent: x ^= y x = x ^ y Operandsexpression1 : Number - Integers and variables.expression2 : Number - Integers and variables.ReturnsNumber - The result of the bitwise operation.ExampleThe following example shows a bitwise XOR assignment (^=) operation: // 15 decimal = 1111 binary var x:Number = 15; // 9 decimal = 1001 binary var y:Number = 9; trace(x ^= y // returns 6 decimal (0110 binary) See also&amp; bitwise AND operator, &amp;= bitwise AND assignment operator, ^ bitwise XOR operator, | bitwise OR operator, |= bitwise OR assignment operator, ~ bitwise NOT operator" />
   <page href="00004948.html" title="/* block comment delimiter operator" text="/* block comment delimiter operator/* comment *//* commentcomment */Indicates one or more lines of script comments. Any characters that appear between the opening comment tag (/*) and the closing comment tag (*/), are interpreted as a comment and ignored by the ActionScript interpreter. Use the // (comment delimiter) to identify single-line comments. Use the /* comment delimiter to identify comments on multiple successive lines. Leaving off the closing tag (*/) when using this form of comment delimiter returns an error message. Attempting to nest comments also returns an error message. After an opening comment tag (/*) is used, the first closing comment tag (*/) will end the comment, regardless of the number of opening comment tags (/*) placed between them.Operandscomment - Any characters.ExampleThe following script uses comment delimiters at the beginning of the script: /* records the X and Y positions of the ball and bat movie clips */ var ballX:Number = ball_mc._x; var ballY:Number = ball_mc._y; var batX:Number = bat_mc._x; var batY:Number = bat_mc._y;  The following attempt to nest comments will result in an error message: /* this is an attempt to nest comments. /* But the first closing tag will be paired with the first opening tag */ and this text will not be interpreted as a comment */ See also// line comment delimiter operator" />
   <page href="00004949.html" title=", comma operator" text=", comma operator(expression1 , expression2 [, expressionN... ])Evaluates expression1, then expression2, and so on. This operator is primarily used with the for loop statement and is often used with the parentheses () operator.Operandsexpression1 : Number - An expression to be evaluated.expression2 : Number - An expression to be evaluated.expressionN : Number - Any number of additional expressions to be evaluated.ReturnsObject - The value of expression1, expression2, and so on.ExampleThe following example uses the comma (,) operator in a for loop: for (i = 0, j = 0; i &lt; 3 &amp;&amp; j &lt; 3; i++, j+=2) {  trace(&quot;i = &quot; + i + &quot;, j = &quot; + j } // Output: // i = 0, j = 0 // i = 1, j = 2 The following example uses the comma (,) operator without the parentheses () operator and illustrates that the comma operator returns only the value of the first expression without the parentheses () operator: var v:Number = 0; v = 4, 5, 6; trace(v // output: 4  The following example uses the comma (,) operator with the parentheses () operator and illustrates that the comma operator returns the value of the last expression when used with the parentheses () operator: var v:Number = 0; v = (4, 5, 6 trace(v // output: 6  The following example uses the comma (,) operator without the parentheses () operator and illustrates that the comma operator sequentially evaluates all of the expressions but returns the value of the first expression. The second expression, z++, is evaluated and z is incremented by one. var v:Number = 0; var z:Number = 0; v = v + 4 , z++, v + 6; trace(v // output: 4 trace(z // output: 1  The following example is identical to the previous example except for the addition of the parentheses () operator and illustrates once again that, when used with the parentheses () operator, the comma (,) operator returns the value of the last expression in the series: var v:Number = 0; var z:Number = 0; v = (v + 4, z++, v + 6 trace(v // output: 6 trace(z // output: 1 See also() parentheses operator" />
   <page href="00004950.html" title="add concatenation (strings) operator" text="add concatenation (strings) operatorstring1 add string2Deprecated since Flash Player 5. Adobe recommends you use the addition (+) operator when creating content for Flash Player 5 or later.Note: Flash Lite 2.0 also deprecates the add operator in favor of the addition (+) operator.Concatenates two or more strings. The add (+) operator replaces the Flash 4 &amp; operator; Flash Player 4 files that use the &amp; operator are automatically converted to use the add (+) operator for string concatenation when brought into the Flash 5 or later authoring environment. You must use the add (+) operator to concatenate strings if you are creating content for Flash Player 4 or earlier versions of the Flash Player. Operandsstring1 : String - A string.string2 : String - A string.ReturnsString - The concatenated string.See also+ addition operator" />
   <page href="00004951.html" title="?: conditional operator" text="?: conditional operatorexpression1 ? expression2 : expression3Instructs Flash to evaluate expression1, and if the value of expression1 is true, it returns the value of expression2; otherwise it returns the value of expression3.Operandsexpression1 : Object - expression1 An expression that evaluates to a Boolean value; usually a comparison expression, such as x &lt; 5.expression2 : Object - Values of any type.expression3 : Object - Values of any type.ReturnsObject - The value of expression2 or expression3.ExampleThe following statement assigns the value of variable x to variable z because expression1 evaluates to true: var x:Number = 5; var y:Number = 10; var z = (x &lt; 6) ? x: y; trace (z // returns 5 The following example shows a conditional statement written in shorthand: var timecode:String = (new Date().getHours() &lt; 11) ? &quot;AM&quot; : &quot;PM&quot;; trace(timecode  The same conditional statement could also be written in longhand, as shown in the following example:  if (new Date().getHours() &lt; 11) {  var timecode:String = &quot;AM&quot;; } else {  var timecode:String = &quot;PM&quot;; } trace(timecode " />
   <page href="00004952.html" title="-- decrement operator" text="-- decrement operator--expressionexpression--A pre-decrement and post-decrement unary operator that subtracts 1 from the expression. The expression can be a variable, element in an array, or property of an object. The pre-decrement form of the operator (--expression) subtracts 1 from expression and returns the result. The post-decrement form of the operator (expression--) subtracts 1 from the expression and returns the initial value of expression (the value prior to the subtraction).Operandsexpression : Number - A number or a variable that evaluates to a number.ReturnsNumber - The result of the decremented value.ExampleThe pre-decrement form of the operator decrements x to 2 ( x - 1 = 2) and returns the result as y: var x:Number = 3; var y:Number = --x; //y is equal to 2 The post-decrement form of the operator decrements x to 2 (x - 1 = 2 ) and returns the original value of x as the result y: var x:Number = 3; var y:Number = x--; //y is equal to 3 The following example loops from 10 to 1, and each iteration of the loop decreases the counter variable i by 1. for (var i = 10; i&gt;0; i--) {  trace(i }" />
   <page href="00004953.html" title="/ division operator" text="/ division operatorexpression1 / expression2Divides expression1 by expression2. The result of the division operation is a double-precision floating-point number.Operandsexpression : Number - A number or a variable that evaluates to a number.ReturnsNumber - The floating-point result of the operation.ExampleThe following statement divides the current width and height of the Stage, and then displays the result in the Output panel. trace(Stage.width/2 trace(Stage.height/2  For a default Stage width and height of 550 x 400, the output is 275 and 150.See also% modulo operator" />
   <page href="00004954.html" title="/= division assignment operator" text="/= division assignment operatorexpression1 /= expression2Assigns expression1 the value of expression1 / expression2. For example, the following two statements are equivalent: x /= y; and x = x / y;Operandsexpression1 : Number - A number or a variable that evaluates to a number.expression2 : Number - A number or a variable that evaluates to a number.ReturnsNumber - A number.ExampleThe following code illustrates using the division assignment (/=) operator with variables and numbers: var x:Number = 10; var y:Number = 2; x /= y; trace(x // output: 5 See also/ division operator" />
   <page href="00004955.html" title=". dot operator" text=". dot operatorobject.property_or_methodinstancename.variableinstancename.childinstanceinstancename.childinstance.variableUsed to navigate movie clip hierarchies to access nested (child) movie clips, variables, or properties. The dot operator is also used to test or set the properties of an object or top-level class, execute a method of an object or top-level class, or create a data structure.Operandsobject : Object - An instance of a class. The object can be an instance of any of the built-in ActionScript classes or a custom class. This parameter is always to the left of the dot (.) operator.property_or_method - The name of a property or method associated with an object. All the valid methods and properties for the built-in classes are listed in the method and property summary tables for that class. This parameter is always to the right of the dot (.) operator.instancename : MovieClip - The instance name of a movie clip.variable -- The instance name to the left of the dot (.) operator can also represent a variable on the Timeline of the movie clip.childinstance : MovieClip - A movie clip instance that is a child of, or nested in, another movie clip.ReturnsObject - The method, property or movie clip named on the right side of the dot.ExampleThe following example identifies the current value of the variable hairColor in the movie clip person_mc: person_mc.hairColor  The Flash 4 authoring environment did not support dot syntax, but Flash MX 2004 files published for Flash Player 4 can use the dot operator. The preceding example is equivalent to the following (deprecated) Flash 4 syntax: /person_mc:hairColor  The following example creates a new movie clip within the _root scope. Then a text field is created inside the movie clip called container_mc. The text field&#39;s autoSize property is set to true and then populated with the current date. this.createEmptyMovieClip(&quot;container_mc&quot;, this.getNextHighestDepth() this.container_mc.createTextField(&quot;date_txt&quot;, this.getNextHighestDepth(), 0, 0, 100, 22 this.container_mc.date_txt.autoSize = true; this.container_mc.date_txt.text = new Date(  The dot (.) operator is used when targeting instances within the SWF file and when you need to set properties and values for those instances." />
   <page href="00004956.html" title="== equality operator" text="== equality operatorexpression1 == expression2Tests two expressions for equality. The result is true if the expressions are equal. The definition of equal depends on the data type of the parameter:Numbers and Boolean values are compared by value and are considered equal if they have the same value.String expressions are equal if they have the same number of characters and the characters are identical.Variables representing objects, arrays, and functions are compared by reference. Two such variables are equal if they refer to the same object, array, or function. Two separate arrays are never considered equal, even if they have the same number of elements.When comparing by value, if expression1 and expression2 are different data types, ActionScript will attempt to convert the data type of expression2 to match that of expression1.Operandsexpression1 : Object - A number, string, Boolean value, variable, object, array, or function.expression2 : Object - A number, string, Boolean value, variable, object, array, or function.ReturnsBoolean - The Boolean result of the comparison.ExampleThe following example uses the equality (==) operator with an if statement:  var a:String = &quot;David&quot;, b:String = &quot;David&quot;; if (a == b) {  trace(&quot;David is David&quot; }  The following examples show the results of operations that compare mixed types:  var x:Number = 5; var y:String = &quot;5&quot;; trace(x == y // output: true var x:String = &quot;5&quot;; var y:String = &quot;66&quot;; trace(x == y // output: false var x:String = &quot;chris&quot;; var y:String = &quot;steve&quot;; trace(x == y // output: false  The following examples show comparison by reference. The first example compares two arrays with identical length and elements. The equality operator will return false for these two arrays. Although the arrays appear equal, comparison by reference requires that they both refer to the same array. The second example creates the thirdArray variable, which points to the same array as the variable firstArray. The equality operator will return true for these two arrays because the two variables refer to the same array.  var firstArray:Array = new Array(&quot;one&quot;, &quot;two&quot;, &quot;three&quot; var secondArray:Array = new Array(&quot;one&quot;, &quot;two&quot;, &quot;three&quot; trace(firstArray == secondArray // will output false // Arrays are only considered equal // if the variables refer to the same array. var thirdArray:Array = firstArray; trace(firstArray == thirdArray // will output true See also! logical NOT operator, != inequality operator, !== strict inequality operator, &amp;&amp; logical AND operator, || logical OR operator, === strict equality operator" />
   <page href="00004957.html" title="eq equality (strings) operator" text="eq equality (strings) operatorexpression1 eq expression2Deprecated since Flash Player 5. This operator was deprecated in favor of the == (equality) operator.Compares two expressions for equality and returns a value of true if the string representation of expression1 is equal to the string representation of expression2, false otherwise. Operandsexpression1 : Object - Numbers, strings, or variables.expression2 : Object - Numbers, strings, or variables.ReturnsBoolean - The result of the comparison.See also== equality operator" />
   <page href="00004958.html" title="&gt; greater than operator" text="&gt; greater than operatorexpression1 &gt; expression2Compares two expressions and determines whether expression1 is greater than expression2; if it is, the operator returns true. If expression1 is less than or equal to expression2, the operator returns false. String expressions are evaluated using alphabetical order; all capital letters come before lowercase letters. Operandsexpression1 : Object - A number or string.expression2 : Object - A number or string.ReturnsBoolean - The Boolean result of the comparison.ExampleIn the following example, the greater than (&gt;) operator is used to determine whether the value of the text field score_txt is greater than 90:  if (score_txt.text&gt;90) {  trace(&quot;Congratulations, you win!&quot; } else {  trace(&quot;sorry, try again&quot; } " />
   <page href="00004959.html" title="gt greater than (strings) operator" text="gt greater than (strings) operatorexpression1 gt expression2Deprecated since Flash Player 5. This operator was deprecated in favor of the &gt; (greater than) operator.Compares the string representation of expression1 with the string representation of expression2 and returns true if expression1 is greater than expression2, false otherwise. Operandsexpression1 : Object - Numbers, strings, or variables.expression2 : Object - Numbers, strings, or variables.ReturnsBoolean - The Boolean result of the comparison.See also&gt; greater than operator" />
   <page href="00004960.html" title="&gt;= greater than or equal to operator" text="&gt;= greater than or equal to operatorexpression1 &gt;= expression2Compares two expressions and determines whether expression1 is greater than or equal to expression2 (true) or expression1 is less than expression2 (false).Operandsexpression1 : Object - A string, integer, or floating-point number.expression2 : Object - A string, integer, or floating-point number.ReturnsBoolean - The Boolean result of the comparison.ExampleIn the following example, the greater than or equal to (&gt;=) operator is used to determine whether the current hour is greater than or equal to 12: if (new Date().getHours() &gt;= 12) {  trace(&quot;good afternoon&quot; } else {  trace(&quot;good morning&quot; }" />
   <page href="00004961.html" title="ge greater than or equal to (strings) operator" text="ge greater than or equal to (strings) operatorexpression1 ge expression2Deprecated since Flash Player 5. This operator was deprecated in favor of the &gt;= (greater than or equal to) operator.Compares the string representation of expression1 with the string representation of expression2 and returns true if expression1 is greater than or equal to expression2, false otherwise.Operandsexpression1 : Object - Numbers, strings, or variables.expression2 : Object - Numbers, strings, or variables.ReturnsBoolean - The result of the comparison.See also&gt;= greater than or equal to operator" />
   <page href="00004962.html" title="++ increment operator" text="++ increment operator++expressionexpression++A pre-increment and post-increment unary operator that adds 1 to expression . The expression can be a variable, element in an array, or property of an object. The pre-increment form of the operator (++expression) adds 1 to expression and returns the result. The post-increment form of the operator (expression++) adds 1 to expression and returns the initial value of expression (the value prior to the addition). The pre-increment form of the operator increments x to 2 (x + 1 = 2) and returns the result as y:var x:Number = 1; var y:Number = ++x; trace(&quot;x:&quot;+x //traces x:2 trace(&quot;y:&quot;+y //traces y:2 The post-increment form of the operator increments x to 2 (x + 1 = 2) and returns the original value of x as the result y: var x:Number = 1; var y:Number = x++; trace(&quot;x:&quot;+x //traces x:2 trace(&quot;y:&quot;+y //traces y:1Operandsexpression : Number - A number or a variable that evaluates to a number.ReturnsNumber - The result of the increment.ExampleThe following example uses ++ as a post-increment operator to make a while loop run five times: var i:Number = 0; while (i++ &lt; 5) {  trace(&quot;this is execution &quot; + i } /* output:  this is execution 1  this is execution 2  this is execution 3  this is execution 4  this is execution 5 */ The following example uses ++ as a pre-increment operator: var a:Array = new Array( var i:Number = 0; while (i &lt; 10) {  a.push(++i } trace(a.toString() //traces: 1,2,3,4,5,6,7,8,9,10  This example also uses ++ as a pre-increment operator. var a:Array = []; for (var i = 1; i &lt;= 10; ++i) {  a.push(i } trace(a.toString() //traces: 1,2,3,4,5,6,7,8,9,10  This script shows the following result in the Output panel: 1,2,3,4,5,6,7,8,9,10 The following example uses ++ as a post-increment operator in a while loop: // using a while loop var a:Array = new Array( var i:Number = 0; while (i &lt; 10) {  a.push(i++ } trace(a.toString() //traces 0,1,2,3,4,5,6,7,8,9  The following example uses ++ as a post-increment operator in a for loop: // using a for loop var a:Array = new Array( for (var i = 0; i &lt; 10; i++) {  a.push(i } trace(a.toString() //traces 0,1,2,3,4,5,6,7,8,9  This script displays the following result in the Output panel: 0,1,2,3,4,5,6,7,8,9 " />
   <page href="00004963.html" title="!= inequality operator" text="!= inequality operatorexpression1 != expression2Tests for the exact opposite of the equality ( ==) operator. If expression1 is equal to expression2 , the result is false. As with the equality (==) operator, the definition of equal depends on the data types being compared, as illustrated in the following list: Numbers, strings, and Boolean values are compared by value. Objects, arrays, and functions are compared by reference. A variable is compared by value or by reference, depending on its type.  Comparison by value means what most people would expect equals to mean--that two expressions have the same value. For example, the expression (2 + 3) is equal to the expression (1 + 4) when compared by value. Comparison by reference means that two expressions are equal only if they both refer to the same object, array, or function. Values inside the object, array, or function are not compared. When comparing by value, if expression1 and expression2 are different data types, ActionScript will attempt to convert the data type of expression2 to match that of expression1.Operandsexpression1 : Object - A number, string, Boolean value, variable, object, array, or function.expression2 : Object - A number, string, Boolean value, variable, object, array, or function.ReturnsBoolean - The Boolean result of the comparison.ExampleThe following example illustrates the result of the inequality (!=) operator: trace(5 != 8 // returns true trace(5 != 5) //returns false  The following example illustrates the use of the inequality (!=) operator in an if statement: var a:String = &quot;David&quot;;var b:String = &quot;Fool&quot;;if (a != b) {  trace(&quot;David is not a fool&quot; } The following example illustrates comparison by reference with two functions: var a:Function = function() { trace(&quot;foo&quot; }; var b:Function = function() { trace(&quot;foo&quot; }; a( // foo b( // foo trace(a != b // true a = b; a( // foo b( // foo trace(a != b // false // trace statement output: foo foo true foo foo false  The following example illustrates comparison by reference with two arrays: var a:Array = [ 1, 2, 3 ]; var b:Array = [ 1, 2, 3 ]; trace(a // 1, 2, 3 trace(b // 1, 2, 3 trace(a!=b // true a = b; trace(a // 1, 2, 3 trace(b // 1, 2, 3 trace(a != b // false // trace statement output: 1,2,3 1,2,3 true 1,2,3 1,2,3 false See also! logical NOT operator, !== strict inequality operator, &amp;&amp; logical AND operator, || logical OR operator, == equality operator, === strict equality operator" />
   <page href="00004964.html" title="&lt;&gt; inequality operator" text="&lt;&gt; inequality operatorexpression1 &lt;&gt; expression2Deprecated since Flash Player 5. This operator has been deprecated. Adobe recommends that you use the != (inequality) operator.Tests for the exact opposite of the equality (==) operator. If expression1 is equal to expression2, the result is false. As with the equality (==)operator, the definition of equal depends on the data types being compared:Numbers, strings, and Boolean values are compared by value.Objects, arrays, and functions are compared by reference. Variables are compared by value or by reference depending on their type.Operandsexpression1 : Object - A number, string, Boolean value, variable, object, array, or function.expression2 : Object - A number, string, Boolean value, variable, object, array, or function.ReturnsBoolean - The Boolean result of the comparison.See also!= inequality operator" />
   <page href="00004965.html" title="instanceof operator" text="instanceof operatorobject instanceof classConstructorTests whether object is an instance of classConstructor or a subclass of classConstructor. The instanceof operator does not convert primitive types to wrapper objects. For example, the following code returns true:new String(&quot;Hello&quot;) instanceof String;Whereas the following code returns false:&quot;Hello&quot; instanceof String;Operandsobject : Object - An ActionScript object.classConstructor : Function - A reference to an ActionScript constructor function, such as String or Date.ReturnsBoolean - If object is an instance of or a subclass of classConstructor, instanceof returns true, otherwise it returns false. Also, _global instanceof Object returns false.See alsotypeof operator" />
   <page href="00004966.html" title="&lt; less than operator" text="&lt; less than operatorexpression1 &lt; expression2Compares two expressions and determines whether expression1 is less than expression2; if so, the operator returns true. If expression1 is greater than or equal to expression2, the operator returns false. String expressions are evaluated using alphabetical order; all capital letters come before lowercase letters.Operandsexpression1 : Number - A number or string.expression2 : Number - A number or string.ReturnsBoolean - The Boolean result of the comparison.ExampleThe following examples show true and false returns for both numeric and string comparisons: trace(3 &lt; 10 // true trace(10 &lt; 3 // false trace(&quot;Allen&quot; &lt; &quot;Jack&quot; // true trace(&quot;Jack&quot; &lt; &quot;Allen&quot; //false trace(&quot;11&quot; &lt; &quot;3&quot; // true trace(&quot;11&quot; &lt; 3 // false (numeric comparison) trace(&quot;C&quot; &lt; &quot;abc&quot; // true trace(&quot;A&quot; &lt; &quot;a&quot; // true " />
   <page href="00004967.html" title="lt less than (strings) operator" text="lt less than (strings) operatorexpression1 lt expression2Deprecated since Flash Player 5. This operator was deprecated in favor of the &lt; (less than) operator.Compares expression1 to expression2 and returns true if expression1 is less than expression2, false otherwise.Operandsexpression1 : Object - Numbers, strings, or variables.expression2 : Object - Numbers, strings, or variables.ReturnsBoolean - The result of the comparison.See also&lt; less than operator" />
   <page href="00004968.html" title="&lt;= less than or equal to operator" text="&lt;= less than or equal to operatorexpression1 &lt;= expression2Compares two expressions and determines whether expression1 is less than or equal to expression2; if it is, the operator returns true. If expression1 is greater than expression2, the operator returns false. String expressions are evaluated using alphabetical order; all capital letters come before lowercase letters.Operandsexpression1 : Object - A number or string.expression2 : Object - A number or string.ReturnsBoolean - The Boolean result of the comparison.ExampleThe following examples show true and false results for both numeric and string comparisons:  trace(5 &lt;= 10 // true trace(2 &lt;= 2 // true trace(10 &lt;= 3 // false trace(&quot;Allen&quot; &lt;= &quot;Jack&quot; // true trace(&quot;Jack&quot; &lt;= &quot;Allen&quot; // false trace(&quot;11&quot; &lt;= &quot;3&quot; // true trace(&quot;11&quot; &lt;= 3 // false (numeric comparison) trace(&quot;C&quot; &lt;= &quot;abc&quot; // true trace(&quot;A&quot; &lt;= a // true " />
   <page href="00004969.html" title="le less than or equal to (strings) operator" text="le less than or equal to (strings) operatorexpression1 le expression2Deprecated since Flash Player 5. This operator was deprecated in Flash 5 in favor of the &lt;= (less than or equal to) operator.Compares expression1 to expression2 and returns a value of true if expression1 is less than or equal to expression2, false otherwise.Operandsexpression1 : Object - Numbers, strings, or variables.expression2 : Object - Numbers, strings, or variables.ReturnsBoolean - The result of the comparison.See also&lt;= less than or equal to operator" />
   <page href="00004970.html" title="// line comment delimiter operator" text="// line comment delimiter operator// commentIndicates the beginning of a script comment. Any characters that appear between the comment delimiter (//) and the end-of-line character are interpreted as a comment and ignored by the ActionScript interpreter.Operandscomment - Any characters.ExampleThe following script uses comment delimiters to identify the first, third, fifth, and seventh lines as comments: // record the X position of the ball movie clip var ballX:Number = ball_mc._x; // record the Y position of the ball movie clip var ballY:Number = ball_mc._y; // record the X position of the bat movie clip var batX:Number = bat_mc._x; // record the Y position of the ball movie clip var batY:Number = bat_mc._y; See also/* block comment delimiter operator" />
   <page href="00004971.html" title="&amp;&amp; logical AND operator" text="&amp;&amp; logical AND operatorexpression1 &amp;&amp; expression2Performs a Boolean operation on the values of one or both of the expressions. Evaluates expression1 (the expression on the left side of the operator) and returns false if the expression evaluates to false. If expression1 evaluates to true, expression2 (the expression on the right side of the operator) is evaluated. If expression2 evaluates to true, the final result is true; otherwise, it is false. Expression Evaluates true&amp;&amp;true true true&amp;&amp;false false false&amp;&amp;false false false&amp;&amp;true false Operandsexpression1 : Number - A Boolean value or an expression that converts to a Boolean value.expression2 : Number - A Boolean value or an expression that converts to a Boolean value.ReturnsBoolean - A Boolean result of the logical operation.ExampleThe following example uses the logical AND (&amp;&amp;) operator to perform a test to determine if a player has won the game. The turns variable and the score variable are updated when a player takes a turn or scores points during the game. The script shows &quot;You Win the Game!&quot; in the Output panel when the player&#39;s score reaches 75 or higher in 3 turns or less. var turns:Number = 2; var score:Number = 77; if ((turns &lt;= 3) &amp;&amp; (score &gt;= 75)) {  trace(&quot;You Win the Game!&quot; } else {  trace(&quot;Try Again!&quot; } // output: You Win the Game! See also! logical NOT operator, != inequality operator, !== strict inequality operator, || logical OR operator, == equality operator, === strict equality operator" />
   <page href="00004972.html" title="and logical AND operator" text="and logical AND operatorcondition1 and condition2Deprecated since Flash Player 5. Adobe recommends that you use the logical AND (&amp;&amp;) operator.Performs a logical AND (&amp;&amp;) operation in Flash Player 4. If both expressions evaluate to true, the entire expression is true. Operandscondition1 : Boolean - condition1,condition2 Conditions or expressions that evaluate to true or false.condition2 : Boolean - condition1,condition2 Conditions or expressions that evaluate to true or false.ReturnsBoolean - A Boolean result of the logical operation.See also&amp;&amp; logical AND operator" />
   <page href="00004973.html" title="! logical NOT operator" text="! logical NOT operator! expressionInverts the Boolean value of a variable or expression. If expression is a variable with the absolute or converted value true, the value of !expression is false. If the expression x &amp;&amp; y evaluates to false, the expression !(x &amp;&amp; y) evaluates to true. The following expressions illustrate the result of using the logical NOT (!) operator: ! true returns false! false returns trueOperandsexpression : Boolean - An expression or a variable that evaluates to a Boolean value.ReturnsBoolean - The Boolean result of the logical operation.ExampleIn the following example, the variable happy is set to false. The if condition evaluates the condition !happy, and if the condition is true, the trace() statement sends a string to the Output panel. var happy:Boolean = false; if (!happy) {  trace(&quot;don&#39;t worry, be happy&quot; //traces don&#39;t worry, be happy }  The statement traces because !false equals true.See also!= inequality operator, !== strict inequality operator, &amp;&amp; logical AND operator, || logical OR operator, == equality operator, === strict equality operator" />
   <page href="00004974.html" title="not logical NOT operator" text="not logical NOT operatornot expressionDeprecated since Flash Player 5. This operator was deprecated in favor of the! (logical NOT) operator.Performs a logical NOT (!) operation in Flash Player 4.Operandsexpression : Object - A variable or other expression that converts to a Boolean value.ReturnsBoolean - The result of the logical operation.See also! logical NOT operator" />
   <page href="00004975.html" title="|| logical OR operator" text="|| logical OR operatorexpression1 || expression2Evaluates expression1 (the expression on the left side of the operator) and returns true if the expression evaluates to true. If expression1 evaluates to false, expression2 (the expression on the right side of the operator) is evaluated. If expression2 evaluates to false, the final result is false; otherwise, it is true. If you use a function call as expression2, the function will not be executed by that call if expression1 evaluates to true. The result is true if either or both expressions evaluate to true; the result is false only if both expressions evaluate to false. You can use the logical OR operator with any number of operands; if any operand evaluates to true, the result is true. Operandsexpression1 : Number - A Boolean value or an expression that converts to a Boolean value.expression2 : Number - A Boolean value or an expression that converts to a Boolean value.ReturnsBoolean - The result of the logical operation.ExampleThe following example uses the logical OR (||) operator in an if statement. The second expression evaluates to true, so the final result is true: var x:Number = 10; var y:Number = 250; var start:Boolean = false; if ((x &gt; 25) || (y &gt; 200) || (start)) {  trace(&quot;the logical OR test passed&quot; // output: the logical OR test passed }  The message the logical OR test passed appears because one of the conditions in the if statement is true (y&gt;200). Although the other two expressions evaluate to false, as long as one condition evaluates to true, the if block is executed. The following example demonstrates how using a function call as expression2 can lead to unexpected results. If the expression on the left of the operator evaluates to true, that result is returned without evaluating the expression on the right (the function fx2() is not called). function fx1():Boolean {  trace(&quot;fx1 called&quot;  return true; } function fx2():Boolean {  trace(&quot;fx2 called&quot;  return true; } if (fx1() || fx2()) {  trace(&quot;IF statement entered&quot;} /* The following is sent to the Output panel: /* The following is sent to the log file: fx1 called IF statement entered */ See also! logical NOT operator, != inequality operator, !== strict inequality operator, &amp;&amp; logical AND operator, == equality operator, === strict equality operator" />
   <page href="00004976.html" title="or logical OR operator" text="or logical OR operatorcondition1 or condition2Deprecated since Flash Player 5. This operator was deprecated in favor of the || (logical OR) operator.Evaluates condition1 and condition2, and if either expression is true, the whole expression is true.Operandscondition1 : Boolean - An expression that evaluates to true or false.condition2 : Boolean - An expression that evaluates to true or false.ReturnsBoolean - The result of the logical operation.See also|| logical OR operator, | bitwise OR operator" />
   <page href="00004977.html" title="% modulo operator" text="% modulo operatorexpression1 % expression2Calculates the remainder of expression1 divided by expression2. If either of the expression parameters are non-numeric, the modulo (%) operator attempts to convert them to numbers. The expression can be a number or string that converts to a numeric value. The sign of the result of modulo operation matches the sign of the dividend (the first number). For example, -4 % 3 and -4 % -3 both evaluate to -1.Operandsexpression1 : Number - A number or expression that evaluates to a number.expression2 : Number - A number or expression that evaluates to a number.ReturnsNumber - The result of the arithmetic operation.ExampleThe following numeric example uses the modulo (%) operator: trace(12%5 // traces 2 trace(4.3%2.1 // traces 0.0999999999999996 trace(4%4 // traces 0  The first trace returns 2, rather than 12/5 or 2.4, because the modulo (% ) operator returns only the remainder. The second trace returns 0.0999999999999996 instead of the expected 0.1 because of the limitations of floating-point accuracy in binary computing.See also/ division operator, round (Math.round method)" />
   <page href="00004978.html" title="%= modulo assignment operator" text="%= modulo assignment operatorexpression1 %= expression2Assigns expression1 the value of expression1 % expression2. The following two statements are equivalent: x %= y; and x = x % y; Operandsexpression1 : Number - A number or expression that evaluates to a number.expression2 : Number - A number or expression that evaluates to a number.ReturnsNumber - The result of the arithmetic operation.ExampleThe following example assigns the value 4 to the variable x: var x:Number = 14; var y:Number = 5; trace(x %= y // output: 4 See also% modulo operator" />
   <page href="00004979.html" title="* multiplication operator" text="* multiplication operatorexpression1 * expression2Multiplies two numerical expressions. If both expressions are integers, the product is an integer. If either or both expressions are floating-point numbers, the product is a floating-point number.Operandsexpression1 : Number - A number or expression that evaluates to a number.expression2 : Number - A number or expression that evaluates to a number.ReturnsNumber - An integer or floating-point number.ExampleUsage 1: The following statement multiplies the integers 2 and 3: trace(2*3 // output: 6  The result, 6, is an integer. Usage 2: This statement multiplies the floating-point numbers 2.0 and 3.1416: trace(2.0 * 3.1416 // output: 6.2832  The result, 6.2832, is a floating-point number." />
   <page href="00004980.html" title="*= multiplication assignment operator" text="*= multiplication assignment operatorexpression1 *= expression2Assigns expression1 the value of expression1 * expression2. For example, the following two expressions are equivalent: x *= y x = x * y Operandsexpression1 : Number - A number or expression that evaluates to a number.expression2 : Number - A number or expression that evaluates to a number.ReturnsNumber - The value of expression1 * expression2 . If an expression cannot be converted to a numeric value, it returns NaN (not a number).ExampleUsage 1: The following example assigns the value 50 to the variable x: var x:Number = 5; var y:Number = 10; trace(x *= y // output: 50  Usage 2: The second and third lines of the following example calculate the expressions on the right side of the equal sign and assign the results to x and y: var i:Number = 5; var x:Number = 4 - 6; var y:Number = i + 2; trace(x *= y // output: -14 See also* multiplication operator" />
   <page href="00004981.html" title="new operator" text="new operatornew constructor()Creates a new, initially anonymous, object and calls the function identified by the constructor parameter. The new operator passes to the function any optional parameters in parentheses, as well as the newly created object, which is referenced using the keyword this. The constructor function can then use this to set the variables of the object.Operandsconstructor : Object - A function followed by any optional parameters in parentheses. The function is usually the name of the object type (for example, Array, Number, or Object) to be constructed.ExampleThe following example creates the Book() function and then uses the new operator to create the objects book1 and book2.function Book(name, price){ this.name = name; this.price = price;}book1 = new Book(&quot;Confederacy of Dunces&quot;, 19.95book2 = new Book(&quot;The Floating Opera&quot;, 10.95The following example uses the new operator to create an Array object with 18 elements:golfCourse_array = new Array(18See also[] array access operator, {} object initializer operator" />
   <page href="00004982.html" title="ne not equal (strings) operator" text="ne not equal (strings) operatorexpression1 ne expression2Deprecated since Flash Player 5. This operator was deprecated in favor of the != (inequality) operator.Compares expression1 to expression2 and returns true if expression1 is not equal to expression2; false otherwise.Operandsexpression1 : Object - Numbers, strings, or variables.expression2 : Object - Numbers, strings, or variables.ReturnsBoolean - Returns true if expression1 is not equal to expression2; false otherwise.See also!= inequality operator" />
   <page href="00004983.html" title="{} object initializer operator" text="{} object initializer operatorobject = { name1 : value1 , name2 : value2 ,... nameN : valueN }{expression1; [...expressionN]}Creates a new object and initializes it with the specified name and value property pairs. Using this operator is the same as using the new Object syntax and populating the property pairs using the assignment operator. The prototype of the newly created object is generically named the Object object. This operator is also used to mark blocks of contiguous code associated with flow control statements (for, while, if, else, switch) and functions. Operandsobject : Object - The object to create. name1,2,...N The names of the properties. value1,2,...N The corresponding values for each name property.ReturnsObject - Usage 1: An Object object. Usage 2: Nothing, except when a function has an explicit return statement, in which case the return type is specified in the function implementation. ExampleThe first line of the following code creates an empty object using the object initializer ({}) operator; the second line creates a new object using a constructor function: var object:Object = {}; var object:Object = new Object(  The following example creates an object account and initializes the properties name, address, city, state, zip, and balance with accompanying values: var account:Object = {name:&quot;Macromedia, Inc.&quot;, address:&quot;600 Townsend Street&quot;, city:&quot;San Francisco&quot;, state:&quot;California&quot;, zip:&quot;94103&quot;, balance:&quot;1000&quot;}; for (i in account) {  trace(&quot;account.&quot; + i + &quot; = &quot; + account[i] }  The following example shows how array and object initializers can be nested within each other: var person:Object = {name:&quot;Gina Vechio&quot;, children:[&quot;Ruby&quot;, &quot;Chickie&quot;, &quot;Puppa&quot;]};  The following example uses the information in the previous example and produces the same result using constructor functions: var person:Object = new Object( person.name = &quot;Gina Vechio&quot;; person.children = new Array( person.children[0] = &quot;Ruby&quot;; person.children[1] = &quot;Chickie&quot;; person.children[2] = &quot;Puppa&quot;;  The previous ActionScript example can also be written in the following format: var person:Object = new Object( person.name = &quot;Gina Vechio&quot;; person.children = new Array(&quot;Ruby&quot;, &quot;Chickie&quot;, &quot;Puppa&quot; See alsoObject" />
   <page href="00004984.html" title="() parentheses operator" text="() parentheses operator(expression1 [, expression2])( expression1, expression2 )function ( parameter1,..., parameterN ) Performs a grouping operation on one or more parameters, performs sequential evaluation of expressions, or surrounds one or more parameters and passes them as parameters to a function outside the parentheses. Usage 1: Controls the order in which the operators execute in the expression. Parentheses override the normal precedence order and cause the expressions within the parentheses to be evaluated first. When parentheses are nested, the contents of the innermost parentheses are evaluated before the contents of the outer ones.Usage 2: Evaluates a series of expressions, separated by commas, in sequence, and returns the result of the final expression. Usage 3: Surrounds one or more parameters and passes them as parameters to the function outside the parentheses.Operandsexpression1 : Object - Numbers, strings, variables, or text.expression2 : Object - Numbers, strings, variables, or text.function : Function - The function to be performed on the contents of the parentheses.parameter1...parameterN : Object - A series of parameters to execute before the results are passed as parameters to the function outside the parentheses.ExampleUsage 1: The following statements show the use of parentheses to control the order in which expressions a re executed (the value of each expression appears in the Output panel): trace((2 + 3)*(4 + 5) // displays 45 trace((2 + 3) * (4 + 5) // writes 45 trace(2 + (3 * (4 + 5)) // // displays 29 trace(2 + (3 * (4 + 5)) // // writes 29 trace(2+(3*4)+5 // displays 19 trace(2 + (3 * 4) + 5 // writes 19  Usage 2: The following example evaluates the function foo(), and then the function bar(), and returns the result of the expression a + b: var a:Number = 1; var b:Number = 2; function foo() { a += b; } function bar() { b *= 10; } trace((foo(), bar(), a + b) // outputs 23  Usage 3: The following example shows the use of parentheses with functions: var today:Date = new Date( trace(today.getFullYear() // traces current year function traceParameter(param):Void { trace(param } traceParameter(2 * 2 //traces 4 See alsowith statement" />
   <page href="00004985.html" title="=== strict equality operator" text="=== strict equality operatorexpression1 === expression2Tests two expressions for equality; the strict equality (===)operator performs in the same way as the equality (==) operator, except that data types are not converted. The result is true if both expressions, including their data types, are equal. The definition of equal depends on the data type of the parameter:Numbers and Boolean values are compared by value and are considered equal if they have the same value.String expressions are equal if they have the same number of characters and the characters are identical.Variables representing objects, arrays, and functions are compared by reference. Two such variables are equal if they refer to the same object, array, or function. Two separate arrays are never considered equal, even if they have the same number of elements.Operandsexpression1 : Object - A number, string, Boolean value, variable, object, array, or function.expression2 : Object - A number, string, Boolean value, variable, object, array, or function.ReturnsBoolean - The Boolean result of the comparison.ExampleThe comments in the following code show the returned value of operations that use the equality and strict equality operators:  // Both return true because no conversion is done var string1:String = &quot;5&quot;; var string2:String = &quot;5&quot;; trace(string1 == string2 // true trace(string1 === string2 // true // Automatic data typing in this example converts 5 to &quot;5&quot; var string1:String = &quot;5&quot;; var num:Number = 5; trace(string1 == num // true trace(string1 === num // false // Automatic data typing in this example converts true to &quot;1&quot; var string1:String = &quot;1&quot;; var bool1:Boolean = true; trace(string1 == bool1 // true trace(string1 === bool1 // false // Automatic data typing in this example converts false to &quot;0&quot; var string1:String = &quot;0&quot;; var bool2:Boolean = false; trace(string1 == bool2 // true trace(string1 === bool2 // false  The following examples show how strict equality treats variables that are references differently than it treats variables that contain literal values. This is one reason to consistently use String literals and to avoid the use of the new operator with the String class.  // Create a string variable using a literal value var str:String = &quot;asdf&quot;; // Create a variable that is a reference var stringRef:String = new String(&quot;asdf&quot; // The equality operator does not distinguish among literals, variables, // and references trace(stringRef == &quot;asdf&quot; // true trace(stringRef == str // true trace(&quot;asdf&quot; == str // true // The strict equality operator considers variables that are references // distinct from literals and variables trace(stringRef === &quot;asdf&quot; // false trace(stringRef === str // false See also! logical NOT operator, != inequality operator, !== strict inequality operator, &amp;&amp; logical AND operator, || logical OR operator, == equality operator" />
   <page href="00004986.html" title="!== strict inequality operator" text="!== strict inequality operatorexpression1 !== expression2Tests for the exact opposite of the strict equality (=== )operator. The strict inequality operator performs the same as the inequality operator except that data types are not converted. If expression1 is equal to expression2, and their data types are equal, the result is false. As with the strict equality (===) operator, the definition of equal depends on the data types being compared, as illustrated in the following list: Numbers, strings, and Boolean values are compared by value. Objects, arrays, and functions are compared by reference. A variable is compared by value or by reference, depending on its type. Operandsexpression1 : Object - A number, string, Boolean value, variable, object, array, or function.expression2 : Object - A number, string, Boolean value, variable, object, array, or function.ReturnsBoolean - The Boolean result of the comparison.ExampleThe comments in the following code show the returned value of operations that use the equality (==), strict equality (===), and strict inequality (!==) operators: var s1:String = &quot;5&quot;; var s2:String = &quot;5&quot;; var s3:String = &quot;Hello&quot;; var n:Number = 5; var b:Boolean = true; trace(s1 == s2 // true trace(s1 == s3 // false trace(s1 == n // true trace(s1 == b // false trace(s1 === s2 // true trace(s1 === s3 // false trace(s1 === n // false trace(s1 === b // false trace(s1 !== s2 // false trace(s1 !== s3 // true trace(s1 !== n // true trace(s1 !== b // true See also! logical NOT operator, != inequality operator, &amp;&amp; logical AND operator, || logical OR operator, == equality operator, === strict equality operator" />
   <page href="00004987.html" title="&quot; string delimiter operator" text="&quot; string delimiter operator&quot;text&quot;When used before and after characters, quotation marks (&quot;) indicate that the characters have a literal value and are considered a string, not a variable, numerical value, or other ActionScript element.Operandstext : String - A sequence of zero or more characters.ExampleThe following example uses quotation marks (&quot;) to indicate that the value of the variable yourGuess is the literal string &quot;Prince Edward Island&quot; and not the name of a variable. The value of province is a variable, not a literal; to determine the value of province, the value of yourGuess must be located.  var yourGuess:String = &quot;Prince Edward Island&quot;; submit_btn.onRelease = function() { trace(yourGuess }; // displays Prince Edward Island in the Output panel // writes Prince Edward Island to the log file See alsoString, String function" />
   <page href="00004988.html" title="- subtraction operator" text="- subtraction operator(Negation) -expression(Subtraction) expression1 - expression2Used for negating or subtracting. Usage 1: When used for negating, it reverses the sign of the numerical expression. Usage 2: When used for subtracting, it performs an arithmetic subtraction on two numerical expressions, subtracting expression2 from expression1. When both expressions are integers, the difference is an integer. When either or both expressions are floating-point numbers, the difference is a floating-point number.Operandsexpression1 : Number - A number or expression that evaluates to a number.expression2 : Number - A number or expression that evaluates to a number.ReturnsNumber - An integer or floating-point number.ExampleUsage 1: The following statement reverses the sign of the expression 2 + 3: trace(-(2+3) // output: -5  Usage 2: The following statement subtracts the integer 2 from the integer 5: trace(5-2 // output: 3  The result, 3, is an integer. Usage 3: The following statement subtracts the floating-point number 1.5 from the floating-point number 3.25: trace(3.25-1.5 // output: 1.75  The result, 1.75, is a floating-point number." />
   <page href="00004989.html" title="-= subtraction assignment operator" text="-= subtraction assignment operatorexpression1 -= expression2Assigns expression1 the value of expression1- expression2. For example, the following two statements are equivalent: x -= y ; x = x - y;String expressions must be converted to numbers; otherwise, NaN (not a number) is returned.Operandsexpression1 : Number - A number or expression that evaluates to a number.expression2 : Number - A number or expression that evaluates to a number.ReturnsNumber - The result of the arithmetic operation.ExampleThe following example uses the subtraction assignment (-=) operator to subtract 10 from 5 and assign the result to the variable x:  var x:Number = 5; var y:Number = 10; x -= y; trace(x // output: -5  The following example shows how strings are converted to numbers:  var x:String = &quot;5&quot;; var y:String = &quot;10&quot;; x -= y; trace(x // output: -5 See also- subtraction operator" />
   <page href="00004990.html" title=": type operator" text=": type operator[ modifiers ] var variableName : typefunction functionName () : type { ... }function functionName ( parameter1:type , ... , parameterN:type ) [ :type ]{ ... } Used for strict data typing; this operator specifies the variable type, function return type, or function parameter type. When used in a variable declaration or assignment, this operator specifies the variable&#39;s type; when used in a function declaration or definition, this operator specifies the function&#39;s return type; when used with a function parameter in a function definition, this operator specifies the variable type expected for that parameter.Types are a compile-time-only feature. All types are checked at compile time, and errors are generated when there is a mismatch. Mismatches can occur during assignment operations, function calls, and class member dereferencing using the dot (.) operator. To avoid type mismatch errors, use strict data typing.Types that you can use include all native object types, classes and interfaces that you define, and Function and Void. The recognized native types are Boolean, Number, and String. All built-in classes are also supported as native types.OperandsvariableName : Object - An identifier for a variable. type A native data type, class name that you have defined, or interface name. functionName An identifier for a function. parameter An identifier for a function parameter.ExampleUsage 1: The following example declares a public variable named userName whose type is String and assigns an empty string to it: var userName:String = &quot;&quot;;  Usage 2: The following example shows how to specify a function&#39;s parameter type by defining a function named randomInt() that takes a parameter named integer of type Number: function randomInt(integer:Number):Number {  return Math.round(Math.random()*integer } trace(randomInt(8)  Usage 3: The following example defines a function named squareRoot() that takes a parameter named val of the Number type and returns the square root of val, also a Number type: function squareRoot(val:Number):Number {  return Math.sqrt(val } trace(squareRoot(121) See alsoset variable statement, Array function" />
   <page href="00004991.html" title="typeof operator" text="Expression TypeResult String string Movie clip movieclip Button object Text field object Number number Boolean boolean Object object Function functiontypeof operatortypeof(expression)The typeof operator evaluate the expression and returns a string specifying whether the expression is a String, MovieClip, Object, Function, Number, or Boolean value.Operandsexpression : Object - A string, movie clip, button, object, or function.ReturnsString - A String representation of the type of expression. The following table shows the results of the typeof operator on each type of expression. See alsoinstanceof operator" />
   <page href="00004992.html" title="void operator" text="void operatorvoid expressionThe void operator evaluates an expression and then discards its value, returning undefined. The void operator is often used in comparisons using the == operator to test for undefined values.Operandsexpression : Object - An expression to be evaluated." />
   <page href="00004993.html" title="Statements" text="StatementDescriptionbreakAppears within a loop (for , for..in, do..while or while) or within a block of statements associated with a particular case within a switch statement.caseDefines a condition for the switch statement.classDefines a custom class, which lets you instantiate objects that share methods and properties that you define.continueJumps past all remaining statements in the innermost loop and starts the next iteration of the loop as if control had passed through to the end of the loop normally.defaultDefines the default case for a switch statement.deleteDestroys the object reference specified by the reference parameter, and returns true if the reference is successfully deleted; false otherwise.do..whileSimilar to a while loop, except that the statements are executed once before the initial evaluation of the condition.dynamicSpecifies that objects based on the specified class can add and access dynamic properties at runtime.elseSpecifies the statements to run if the condition in the if statement returns false.else ifEvaluates a condition and specifies the statements to run if the condition in the initial if statement returns false.extendsDefines a class that is a subclass of another class; the latter is the superclass.forEvaluates the init (initialize) expression once and then starts a looping sequence.for..inIterates over the properties of an object or elements in an array and executes the statement for each property or element.functionComprises a set of statements that you define to perform a certain task.getPermits implicit getting of properties associated with objects based on classes you have defined in external class files.ifEvaluates a condition to determine the next action in a SWF file.implementsSpecifies that a class must define all the methods declared in the interface (or interfaces) being implemented.importLets you access classes without specifying their fully qualified names.interfaceDefines an interface.intrinsicAllows compile-time type checking of previously defined classes.privateSpecifies that a variable or function is available only to the class that declares or defines it or to subclasses of that class.publicSpecifies that a variable or function is available to any caller.returnSpecifies the value returned by a function.setPermits implicit setting of properties associated with objects based on classes you have defined in external class files.set variableAssigns a value to a variable.staticSpecifies that a variable or function is created only once per class rather than being created in every object based on that class.superInvokes the superclass&#39; version of a method or constructor.switchCreates a branching structure for ActionScript statements.throwGenerates, or throws , an error that can be handled, or caught , by a catch{} code block.try..catch..finallyEnclose a block of code in which an error can occur, and then respond to the error.varUsed to declare local or Timeline variables.whileEvaluates a condition and if the condition evaluates to true , runs a statement or series of statements before looping back to evaluate the condition again.withLets you specify an object (such as a movie clip) with the object parameter and evaluate expressions and actions inside that object with the statement(s) parameter.StatementsStatements are language elements that perform or specify an action. For example, the return statement returns a result as a value of the function in which it executes. The if statement evaluates a condition to determine the next action that should be taken. The switch statement creates a branching structure for ActionScript statements.Statements summary" />
   <page href="00004994.html" title="break statement" text="break statementbreakAppears within a loop (for , for..in, do..while or while) or within a block of statements associated with a particular case within a switch statement. When used in a loop, the break statement instructs Flash to skip the rest of the loop body, stop the looping action, and execute the statement following the loop statement. When used in a switch, the break statement instructs Flash to skip the rest of the statements in that case block and jump to the first statement following the enclosing switch statement. In nested loops, the break statement only skips the rest of the immediate loop and does not break out of the entire series of nested loops. For breaking out of an entire series of nested loops, see try..catch..finally.ExampleThe following example uses the break statement to exit an otherwise infinite loop: var i:Number = 0;while (true) {  trace(i  if (i &gt;= 10) {  break; // this will terminate/exit the loop  }  i++; }  which traces the following output: 0 1 2 3 4 5 6 7 8 9 10See also_forceframerate property" />
   <page href="00004995.html" title="case statement" text="case statement case expression : statement(s)Defines a condition for the switch statement. If the expression parameter equals the expression parameter of the switch statement using strict equality (===), then Flash Player will execute statements in the statement(s) parameter until it encounters a break statement or the end of the switch statement. If you use the case statement outside a switch statement, it produces an error and the script doesn&#39;t compile.Note: You should always end the statement(s) parameter with a break statement. If you omit the break statement from the statement(s) parameter, it continues executing with the next case statement instead of exiting the switch statement.Parametersexpression:String - Any expression.ExampleThe following example defines conditions for the switch statement thisMonth. If thisMonth equals the expression in the case statement, the statement executes. var thisMonth:Number = new Date().getMonth( switch (thisMonth) {  case 0 :  trace(&quot;January&quot;  break;  case 1 :  trace(&quot;February&quot;  break;  case 5 :  case 6 :  case 7 :  trace(&quot;Some summer month&quot;  break;  case 8 :  trace(&quot;September&quot;  break;  default :  trace(&quot;some other month&quot; }See alsobreak statement" />
   <page href="00004996.html" title="class statement" text="class statement [dynamic] class className [ extends superClass ] [ implements interfaceName[, interfaceName... ] ] { // class definition here}Defines a custom class, which lets you instantiate objects that share methods and properties that you define. For example, if you are developing an invoice-tracking system, you could create an invoice class that defines all the methods and properties that each invoice should have. You would then use the new invoice() command to create invoice objects. The name of the class must match the name of the external file that contains the class. The name of the external file must be the name of the class with the file extension .as appended. For example, if you name a class Student, the file that defines the class must be named Student.as.If a class is within a package, the class declaration must use the fully qualified class name of the form base.sub1.sub2.MyClass. Also, the class&#39;s AS file must be stored within the path in a directory structure that reflects the package structure, such as base/sub1/sub2/MyClass.as. If a class definition is of the form &quot;class MyClass,&quot; it is in the default package and the MyClass.as file should be in the top level of some directory in the path.For this reason, it&#39;s good practice to plan your directory structure before you begin creating classes. Otherwise, if you decide to move class files after you create them, you have to modify the class declaration statements to reflect their new location.You cannot nest class definitions; that is, you cannot define additional classes within a class definition.To indicate that objects can add and access dynamic properties at runtime, precede the class statement with the dynamic keyword. To declare that a class implements an interface, use the implements keyword. To create subclasses of a class, use the extends keyword. (A class can extend only one class, but can implement several interfaces.) You can use implements and extends in a single statement. The following examples show typical uses of the implements and extends keywords:class C implements Interface_i, Interface_j // OK class C extends Class_d implements Interface_i, Interface_j // OK class C extends Class_d, Class_e // not OK ParametersclassName:String - The fully qualified name of the class.ExampleThe following example creates a class called Plant. The Plant constructor takes two parameters. // Filename Plant.as class Plant {  // Define property names and types  var leafType:String;  var bloomSeason:String;  // Following line is constructor  // because it has the same name as the class  function Plant(param_leafType:String, param_bloomSeason:String) {  // Assign passed values to properties when new Plant object is created  this.leafType = param_leafType;  this.bloomSeason = param_bloomSeason;  }  // Create methods to return property values, because best practice  // recommends against directly referencing a property of a class  function getLeafType():String {  return leafType;  }  function getBloomSeason():String {  return bloomSeason;  } } In an external script file or in the Actions panel, use the new operator to create a Plant object. var pineTree:Plant = new Plant(&quot;Evergreen&quot;, &quot;N/A&quot; // Confirm parameters were passed correctly trace(pineTree.getLeafType() trace(pineTree.getBloomSeason()  The following example creates a class called ImageLoader. The ImageLoader constructor takes three parameters. // Filename ImageLoader.as class ImageLoader extends MovieClip {  function ImageLoader(image:String, target_mc:MovieClip, init:Object) {  var listenerObject:Object = new Object(  listenerObject.onLoadInit = function(target) {  for (var i in init) {  target[i] = init[i];  } };  var JPEG_mcl:MovieClipLoader = new MovieClipLoader(  JPEG_mcl.addListener(listenerObject  JPEG_mcl.loadClip(image, target_mc  } }  In an external script file or in the Actions panel, use the new operator to create an ImageLoader object. var jakob_mc:MovieClip = this.createEmptyMovieClip(&quot;jakob_mc&quot;, this.getNextHighestDepth() var jakob:ImageLoader = new ImageLoader(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;, jakob_mc, {_x:10, _y:10, _alpha:70, _rotation:-5}See alsodynamic statement" />
   <page href="00004997.html" title="continue statement" text="continue statementcontinueJumps past all remaining statements in the innermost loop and starts the next iteration of the loop as if control had passed through to the end of the loop normally. It has no effect outside a loop.ExampleIn the following while loop, continue causes the Flash interpreter to skip the rest of the loop body and jump to the top of the loop, where the condition is tested: trace(&quot;example 1&quot; var i:Number = 0; while (i &lt; 10) {  if (i % 3 == 0) {  i++;  continue;  }  trace(i  i++; }In the following do..while loop, continue causes the Flash interpreter to skip the rest of the loop body and jump to the bottom of the loop, where the condition is tested:trace(&quot;example 2&quot; var i:Number = 0; do {  if (i % 3 == 0) {  i++;  continue;  }  trace(i  i++; } while (i &lt; 10 In a for loop, continue causes the Flash interpreter to skip the rest of the loop body. In the following example, if the i modulo 3 equals 0, then the trace(i) statement is skipped:trace(&quot;example 3&quot; for (var i = 0; i &lt; 10; i++) {  if (i % 3 == 0) {  continue;  }  trace(i }In the following for..in loop, continue causes the Flash interpreter to skip the rest of the loop body and jump back to the top of the loop, where the next value in the enumeration is processed:for (i in _root) {  if (i == &quot;$version&quot;) {  continue;  }  trace(i }See alsodo..while statement" />
   <page href="00004998.html" title="default statement" text="default statementdefault: statementsDefines the default case for a switch statement. The statements execute if the expression parameter of the switch statement doesn&#39;t equal (using the strict equality [===] operation) any of the expression parameters that follow the case keywords for a given switch statement. A switch is not required to have a default case statement. A default case statement does not have to be last in the list. If you use a default statement outside a switch statement, it produces an error and the script doesn&#39;t compile.Parametersstatements:String - Any statements.ExampleIn the following example, the expression A does not equal the expressions B or D, so the statement following the default keyword is run and the trace() statement is sent to the Output panel. var dayOfWeek:Number = new Date().getDay( switch (dayOfWeek) {  case 1 :  trace(&quot;Monday&quot;  break;  case 2 :  trace(&quot;Tuesday&quot;  break;  case 3 :  trace(&quot;Wednesday&quot;  break;  case 4 :  trace(&quot;Thursday&quot;  break;  case 5 :  trace(&quot;Friday&quot;  break;  default :  trace(&quot;Weekend&quot; }See alsoswitch statement" />
   <page href="00004999.html" title="delete statement" text="delete statementdelete referenceDestroys the object reference specified by the reference parameter, and returns true if the reference is successfully deleted; false otherwise. This operator is useful for freeing memory used by scripts. You can use the delete operator to remove references to objects. After all references to an object are removed, Flash Player takes care of removing the object and freeing the memory used by that object. Although delete is an operator, it is typically used as a statement, as shown in the following example:delete x;The delete operator can fail and return false if the reference parameter does not exist or cannot be deleted. You cannot delete predefined objects and properties, nor can you delete variables that are declared within a function with the var statement. You cannot use the delete operator to remove movie clips.ReturnsBoolean - A Boolean value.Parametersreference:Object - The name of the variable or object to eliminate.ExampleUsage 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 = &quot;Jon&quot;; account.balance = 10000; trace(account.name //output: Jon delete account; trace(account.name //output: undefined Usage 2: The following example deletes a property of an object:// create the new object &quot;account&quot; var account:Object = new Object( // assign property name to the account account.name = &quot;Jon&quot;; // delete the property delete account.name; Usage 3: The following example deletes an object property:var my_array:Array = new Array( my_array[0] = &quot;abc&quot;; // my_array.length == 1 my_array[1] = &quot;def&quot;; // my_array.length == 2 my_array[2] = &quot;ghi&quot;; // 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 = &quot;Jody&quot;; // copy the reference variable into a new variable // and delete ref1 ref2 = ref1; delete ref1; trace(&quot;ref1.name &quot;+ref1.name //output: ref1.name undefined trace(&quot;ref2.name &quot;+ref2.name //output: ref2.name 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 alsoset variable statement" />
   <page href="00005000.html" title="do..while statement" text="do..while statementdo { statement(s) } while (condition)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.Parameterscondition:Boolean - The condition to evaluate. The statement(s) within the do block of code will execute as long as the condition parameter evaluates to true .ExampleThe following example uses a do..while loop to evaluate whether a condition is true, and traces myVar until myVar is greater than 5. When myVar is greater than 5, the loop ends. var myVar:Number = 0; do {  trace(myVar  myVar++; } while (myVar &lt; 5 /* output: 0 1 2 3 4*/See alsobreak statement" />
   <page href="00005001.html" title="dynamic statement" text="dynamic statementdynamic class className [ extends superClass ] [ implements interfaceName[, interfaceName... ] ] { // class definition here }Specifies that objects based on the specified class can add and access dynamic properties at runtime. Type checking on dynamic classes is less strict than type checking on nondynamic classes, because members accessed inside the class definition and on class instances are not compared with those defined in the class scope. Class member functions, however, can still be type checked for return type and parameter types. This behavior is especially useful when you work with MovieClip objects, because there are many different ways of adding properties and objects to a movie clip dynamically, such as MovieClip.createEmptyMovieClip() and MovieClip.createTextField(). Subclasses of dynamic classes are also dynamic.ExampleIn the following example, class Person2 has not yet been marked as dynamic, so calling an undeclared function on it generates an error at compile time: class Person2 {  var name:String;  var age:Number;  function Person2(param_name:String, param_age:Number) {  trace (&quot;anything&quot;  this.name = param_name;  this.age = param_age;  } } In a FLA or AS file that&#39;s in the same directory, add the following ActionScript to Frame 1 on the Timeline: // Before dynamic is added var craig:Person2 = new Person2(&quot;Craiggers&quot;, 32 for (i in craig) {  trace(&quot;craig.&quot; + i + &quot; = &quot; + craig[i] } /* output:craig.age = 32 craig.name = Craiggers */ If you add an undeclared function, dance , an error is generated, as shown in the following example: trace(&quot;&quot; craig.dance = true; for (i in craig) {  trace(&quot;craig.&quot; + i + &quot; = &quot; + craig[i] } /* output: **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 14: There is no property with the name &#39;dance&#39;. craig.dance = true; Total ActionScript Errors: 1 Reported Errors: 1 */ Add the dynamic keyword to the Person2 class, so that the first line appears as follows: dynamic class Person2 {  Test the code again, and you see the following output: craig.dance = true craig.age = 32 craig.name = CraiggersSee alsoclass statement" />
   <page href="00005002.html" title="else statement" text="else statementif (condition){ statement(s } else { statement(s }Specifies the statements to run if the condition in the if statement returns false. The curly braces ({}) used to enclose the block of statements to be executed by the else statement are not necessary if only one statement will execute.Parameterscondition:Boolean - An expression that evaluates to true or false.ExampleIn the following example, the else condition is used to check whether the age_txt variable is greater than or less than 18: if (age_txt.text&gt;=18) { trace(&quot;welcome, user&quot; } else { trace(&quot;sorry, junior&quot; userObject.minor = true; userObject.accessAllowed = false; }In the following example, curly braces ({}) are not necessary because only one statement follows the else statement:if (age_txt.text&gt;18) { trace(&quot;welcome, user&quot; } else trace(&quot;sorry, junior&quot;See alsoifFrameLoaded function" />
   <page href="00005003.html" title="else if statement" text="else if statementif (condition){ statement(s }  else if (condition){ statement(s}Evaluates a condition and specifies the statements to run if the condition in the initial if statement returns false. If the else if condition returns true, the Flash interpreter runs the statements that follow the condition inside curly braces ({}). If the else if condition is false, Flash skips the statements inside the curly braces and runs the statements following the curly braces. Use the elseif statement to create branching logic in your scripts. If there are multiple branches, you should consider using a switch statement.Parameterscondition:Boolean - An expression that evaluates to true or false.ExampleThe following example uses else if statements to compare score_txtto a specified value: if (score_txt.text&gt;90) { trace(&quot;A&quot; } else if (score_txt.text&gt;75) { trace(&quot;B&quot; } else if (score_txt.text&gt;60) { trace(&quot;C&quot; } else { trace(&quot;F&quot; }See alsoifFrameLoaded function" />
   <page href="00005004.html" title="extends statement" text="extends statementUsage 1: class className extends otherClassName {}Usage 2: interface interfaceName extends otherInterfaceName {} Note: To use this keyword, you must specify ActionScript 2.0 and Flash Player 6 or later in the Flash tab of your FLA file&#39;s Publish Settings dialog box. This keyword is supported only when used in external script files, not in scripts written in the Actions panel.Defines a class that is a subclass of another class; the latter is the superclass. The subclass inherits all the methods, properties, functions, and so on that are defined in the superclass. Interfaces can also be extended using the extends keyword. An interface that extends another interface includes all the original interface&#39;s method declarations.ParametersclassName:String - The name of the class you are defining.ExampleIn the following example, the Car class extends the Vehicle class so that all its methods, properties, and functions are inherited. If your script instantiates a Car object, methods from both the Car class and the Vehicle class can be used. The following example shows the contents of a file called Vehicle.as, which defines the Vehicle class: class Vehicle {  var numDoors:Number;  var color:String;  function Vehicle(param_numDoors:Number, param_color:String) {  this.numDoors = param_numDoors;  this.color = param_color;  }  function start():Void {  trace(&quot;[Vehicle] start&quot;  }  function stop():Void {  trace(&quot;[Vehicle] stop&quot;  }  function reverse():Void {  trace(&quot;[Vehicle] reverse&quot;  } }The following example shows a second AS file, called Car.as, in the same directory. This class extends the Vehicle class, modifying it in three ways. First, the Car class adds a variable fullSizeSpare to track whether the car object has a full-size spare tire. Second, it adds a new method specific to cars, activateCarAlarm(), that activates the car&#39;s anti-theft alarm. Third, it overrides the stop() function to add the fact that the Car class uses an anti-lock braking system to stop.class Car extends Vehicle {  var fullSizeSpare:Boolean;  function Car(param_numDoors:Number, param_color:String, param_fullSizeSpare:Boolean) {  this.numDoors = param_numDoors;  this.color = param_color;  this.fullSizeSpare = param_fullSizeSpare;  }  function activateCarAlarm():Void {  trace(&quot;[Car] activateCarAlarm&quot;  }  function stop():Void {  trace(&quot;[Car] stop with anti-lock brakes&quot;  } }The following example instantiates a Car object, calls a method defined in the Vehicle class (start()), then calls the method overridden by the Car class (stop()), and finally calls a method from the Car class (activateCarAlarm()):var myNewCar:Car = new Car(2, &quot;Red&quot;, true myNewCar.start( // output: [Vehicle] start myNewCar.stop( // output: [Car] stop with anti-lock brakes myNewCar.activateCarAlarm( // output: [Car] activateCarAlarmA subclass of the Vehicle class can also be written using the keyword super, which the subclass can use to access properties and methods of the superclass. The following example shows a third AS file, called Truck.as, again in the same directory. The Truck class uses the super keyword in the constructor and again in the overridden reverse() function.class Truck extends Vehicle { var numWheels:Number; function Truck(param_numDoors:Number, param_color:String, param_numWheels:Number) {  super(param_numDoors, param_color  this.numWheels = param_numWheels;  }  function reverse():Void {  beep(  super.reverse(  }  function beep():Void {  trace(&quot;[Truck] make beeping sound&quot;  } }The following example instantiates a Truck object, calls a method overridden by the Truck class (reverse()), then calls a method defined in the Vehicle class (stop()): var myTruck:Truck = new Truck(2, &quot;White&quot;, 18 myTruck.reverse( // output: [Truck] make beeping sound [Vehicle] reverse myTruck.stop( // output: [Vehicle] stopSee alsoclass statement" />
   <page href="00005005.html" title="for statement" text="for statement for(init; condition; next) { statement(s}Evaluates the init (initialize) expression once and then starts a looping sequence. The looping sequence begins by evaluating the condition expression. If the condition expression evaluates to true, statement is executed and the next expression is evaluated. The looping sequence then begins again with the evaluation of the condition expression. The curly braces ({}) used to enclose the block of statements to be executed by the for statement are not necessary if only one statement will execute.Parametersinit - An expression to evaluate before beginning the looping sequence; usually an assignment expression. A var statement is also permitted for this parameter.ExampleThe following example uses for to add the elements in an array: var my_array:Array = new Array( for (var i:Number = 0; i &lt; 10; i++) {  my_array[i] = (i + 5) * 10; } trace(my_array // output: 50,60,70,80,90,100,110,120,130,140  The following example uses for to perform the same action repeatedly. In the code, the for loop adds the numbers from 1 to 100. var sum:Number = 0; for (var i:Number = 1; i &lt;= 100; i++) {  sum += i; } trace(sum // output: 5050 The following example shows that curly braces ({}) are not necessary if only one statement will execute: var sum:Number = 0; for (var i:Number = 1; i &lt;= 100; i++)  sum += i; trace(sum // output: 5050See also++ increment operator" />
   <page href="00005006.html" title="for..in statement" text="for..in statement for (variableIterant in object) { ]statement(s} Iterates over the properties of an object or elements in an array and executes the statement for each property or element. Methods of an object are not enumerated by the for..in action. Some properties cannot be enumerated by the for..in action. For example, movie clip properties, such as _x and _y, are not enumerated. In external class files, static members are not enumerable, unlike instance members.The for..in statement iterates over properties of objects in the iterated object&#39;s prototype chain. Properties of the object are enumerated first, then properties of its immediate prototype, then properties of the prototype&#39;s prototype, and so on. The for..in statement does not enumerate the same property name twice. If the object child has prototype parent and both contain the property prop, the for..in statement called on child enumerates prop from child but ignores the one in parent.The curly braces ({}) used to enclose the block of statements to be executed by the for..in statement are not necessary if only one statement will execute.If you write a for..in loop in a class file (an external AS file), then instance members are not available for the loop, but static members are. However, if you write a for..in loop in a FLA file for an instance of the class, then instance members are available but static ones are not.ParametersvariableIterant:String - The name of a variable to act as the iterant, referencing each property of an object or element in an array.ExampleThe following example shows using for..in to iterate over the properties of an object: var myObject:Object = {firstName:&quot;Tara&quot;, age:27, city:&quot;San Francisco&quot;}; for (var prop in myObject) {  trace(&quot;myObject.&quot;+prop+&quot; = &quot;+myObject[prop] } //output myObject.firstName = Tara myObject.age = 27 myObject.city = San Francisco The following example shows using for..in to iterate over the elements of an array: var myArray:Array = new Array(&quot;one&quot;, &quot;two&quot;, &quot;three&quot; for (var index in myArray)  trace(&quot;myArray[&quot;+index+&quot;] = &quot; + myArray[index] // output: myArray[2] = three myArray[1] = two myArray[0] = one The following example uses the typeof operator with for..in to iterate over a particular type of child: for (var name in this) {  if (typeof (this[name]) == &quot;movieclip&quot;) {  trace(&quot;I have a movie clip child named &quot;+name  } }Note: If you have several movie clips, the output consists of the instance names of those clips. The following example enumerates the children of a movie clip and sends each to Frame 2 in their respective Timelines. The RadioButtonGroup movie clip is a parent with several children, _RedRadioButton_, _GreenRadioButton_, and _BlueRadioButton_. for (var name in RadioButtonGroup) { RadioButtonGroup[name].gotoAndStop(2 }" />
   <page href="00005007.html" title="function statement" text="function statementUsage 1: (Declares a named function.)function functionname([parameter0, parameter1,...parameterN]){statement(s)}Usage 2: (Declares an anonymous function and returns a reference to it.)function ([parameter0, parameter1,...parameterN]){ statement(s) } Comprises a set of statements that you define to perform a certain task. You can define a function in one location and invoke, or call, it from different scripts in a SWF file. When you define a function, you can also specify parameters for the function. Parameters are placeholders for values on which the function operates. You can pass different parameters to a function each time you call it so you can reuse a function in different situations. Use the return statement in a function&#39;s statement(s) to cause a function to generate, or return, a value.You can use this statement to define a function with the specified functionname, parameters, and statement(s). When a script calls a function, the statements in the function&#39;s definition are executed. Forward referencing is permitted; within the same script, a function may be declared after it is called. A function definition replaces any prior definition of the same function. You can use this syntax wherever a statement is permitted. You can also use this statement to create an anonymous function and return a reference to it. This syntax is used in expressions and is particularly useful for installing methods in objects.For additional functionality, you can use the arguments object in your function definition. Some common uses of the arguments object are creating a function that accepts a variable number of parameters and creating a recursive anonymous function.ReturnsString - Usage 1: The declaration form does not return anything. Usage 2: A reference to the anonymous function.Parametersfunctionname:String - The name of the declared function.ExampleThe following example defines the function sqr, which accepts one parameter and returns the Math.pow(x, 2) of the parameter: function sqr(x:Number) {  return Math.pow(x, 2 } var y:Number = sqr(3 trace(y // output: 9 If the function is defined and used in the same script, the function definition may appear after using the function: var y:Number = sqr(3 trace(y // output: 9 function sqr(x:Number) {  return Math.pow(x, 2 } The following function creates a LoadVars object and loads params.txt into the SWF file. When the file successfully loads, variables loaded traces: var myLV:LoadVars = new LoadVars( myLV.load(&quot;params.txt&quot; myLV.onLoad = function(success:Boolean) {  trace(&quot;variables loaded&quot; }" />
   <page href="00005008.html" title="get statement" text="get statementfunction get property () { // 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 file&#39;s Publish Settings dialog box. This keyword is supported only when used in external script files, not in scripts written in the Actions panel.Permits implicit getting of properties associated with objects based on classes you have defined in external class files. Using implicit get methods lets you access properties of objects without accessing the property directly. Implicit get/set methods are syntactic shorthand for the Object.addProperty() method in ActionScript 1.Parametersproperty:String - The word you use to refer to the property that get accesses; this value must be the same as the value used in the corresponding set command.ExampleIn the following example, you define a Team class. The Team class includes get/set methods that let you retrieve and set properties within the class: class Team {  var teamName:String;  var teamCode:String;  var teamPlayers:Array = new Array(  function Team(param_name:String, param_code:String) {  this.teamName = param_name;  this.teamCode = param_code;  }  function get name():String {  return this.teamName;  }  function set name(param_name:String):Void {  this.teamName = param_name;  } } Enter the following ActionScript in a frame on the Timeline: var giants:Team = new Team(&quot;San Fran&quot;, &quot;SFO&quot; trace(giants.name giants.name = &quot;San Francisco&quot;; trace(giants.name /* output: San Fran San Francisco */When you trace giants.name, you use the get method to return the value of the property.See alsoaddProperty (Object.addProperty method)" />
   <page href="00005009.html" title="if statement" text="if statementif(condition) { statement(s }Evaluates a condition to determine the next action in a SWF file. If the condition is true, Flash runs the statements that follow the condition inside curly braces ({}). If the condition is false, Flash skips the statements inside the curly braces and runs the statements following the curly braces. Use the if statement along with the else and else if statements to create branching logic in your scripts. The curly braces ({}) used to enclose the block of statements to be executed by the if statement are not necessary if only one statement will execute.Parameterscondition:Boolean - An expression that evaluates to true or false.ExampleIn the following example, the condition inside the parentheses evaluates the variable name to see if it has the literal value &quot;Erica&quot;. If it does, the play() function inside the curly braces runs. if(name == &quot;Erica&quot;){  play( }The following example uses an if statement to evaluate how long it takes a user to click the submit_btninstance in a SWF file. If a user clicks the button more than 10 seconds after the SWF file plays, the condition evaluates to true and the message inside the curly braces ({}) appears in a text field that&#39;s created at runtime (using createTextField()). If the user clicks the button less than 10 seconds after the SWF file plays, the condition evaluates to false and a different message appears.this.createTextField(&quot;message_txt&quot;, this.getNextHighestDepth, 0, 0, 100, 22 message_txt.autoSize = true; var startTime:Number = getTimer( this.submit_btn.onRelease = function() {  var difference:Number = (getTimer() - startTime) / 1000;  if (difference &gt; 10) {  this._parent.message_txt.text = &quot;Not very speedy, you took &quot;+difference+&quot; seconds.&quot;;  }  else {  this._parent.message_txt.text = &quot;Very good, you hit the button in &quot;+difference+&quot; seconds.&quot;;  } };See alsoelse statement" />
   <page href="00005010.html" title="implements statement" text="implements statementmyClass implements interface01 [, interface02 , ...] Note: To use this keyword, you must specify ActionScript 2.0 and Flash Player 6 or later in the Flash tab of your FLA file&#39;s Publish Settings dialog box. This keyword is supported only when used in external script files, not in scripts written in the Actions panel.Specifies that a class must define all the methods declared in the interface (or interfaces) being implemented.ExampleSee interface.See alsoclass statement" />
   <page href="00005011.html" title="import statement" text="import statementimport className import packageName.*Note: To use this keyword, you must specify ActionScript 2.0 and Flash Player 6 or later in the Flash tab of your FLA file&#39;s Publish Settings dialog box. This statement is supported in the Actions panel as well as in external class files.Lets you access classes without specifying their fully qualified names. For example, if you want to use a custom class macr.util.users.UserClass in a script, you must refer to it by its fully qualified name or import it; if you import it, you can refer to it by the class name: // before importing var myUser:macr.util.users.UserClass = new macr.util.users.UserClass( // after importing import macr.util.users.UserClass; var myUser:UserClass = new UserClass(If there are several class files in the package (working_directory/macr/utils/users) that you want to access, you can import them all in a single statement, as shown in the following example:import macr.util.users.*;You must issue the import statement before you try to access the imported class without fully specifying its name.If you import a class but don&#39;t use it in your script, the class isn&#39;t exported as part of the SWF file. This means you can import large packages without being concerned about the size of the SWF file; the bytecode associated with a class is included in a SWF file only if that class is actually used.The import statement applies only to the current script (frame or object) in which it&#39;s called. For example, suppose on Frame 1 of a Flash document you import all the classes in the macr.util package. On that frame, you can reference classes in that package by their simple names:// On Frame 1 of a FLA: import macr.util.*; var myFoo:foo = new foo(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.ParametersclassName:String - The fully qualified name of a class you have defined in an external class file.Example" />
   <page href="00005012.html" title="interface statement" text="interface statementinterface InterfaceName [extends InterfaceName ] {}Note: To use this keyword, you must specify ActionScript 2.0 and Flash Player 6 or later in the Flash tab of your FLA file&#39;s Publish Settings dialog box. This keyword is supported only when used in external script files, not in scripts written in the Actions panel.Defines an interface. An interface is similar to a class, with the following important differences: Interfaces contain only declarations of methods, not their implementation. That is, every class that implements an interface must provide an implementation for each method declared in the interface.Only public members are allowed in an interface definition; instance and class members are not permitted.The get and set statements are not allowed in interface definitions.ExampleThe following example shows several ways to define and implement interfaces: (in top-level package .as files Ia, B, C, Ib, D, Ic, E) // filename Ia.as interface Ia {  function k():Number; // method declaration only  function n(x:Number):Number; // without implementation } // filename B.as class B implements Ia {  function k():Number { return 25; }  function n(x:Number):Number { return x + 5; } } // external script or Actions panel // script file var mvar:B = new B( trace(mvar.k() // 25 trace(mvar.n(7) // 12 // filename c.as class C implements Ia {  function k():Number { return 25; } } // error: class must implement all interface methods // filename Ib.as interface Ib {  function o():Void; } class D implements Ia, Ib {  function k():Number { return 15; }  function n(x:Number):Number { return x * x; }  function o():Void { trace(&quot;o&quot; } } // external script or Actions panel // script file mvar = new D( trace(mvar.k() // 15 trace(mvar.n(7) // 49 trace(mvar.o() // &quot;o&quot; interface Ic extends Ia {  function p():Void; } class E implements Ib, Ic {  function k():Number { return 25; }  function n(x:Number):Number { return x + 5; }  function o():Void { trace(&quot;o&quot; }  function p():Void { trace(&quot;p&quot; } } See alsoclass statement" />
   <page href="00005013.html" title="intrinsic statement" text="intrinsic statementintrinsic class className [extends superClass] [implements interfaceName [, interfaceName...] ] { //class definition here}Allows compile-time type checking of previously defined classes. Flash uses intrinsic class declarations to enable compile-time type checking of built-in classes such as Array, Object, and String. This keyword indicates to the compiler that no function implementation is required, and that no bytecode should be generated for it.The intrinsic keyword can also be used with variable and function declarations. Flash uses this keyword to enable compile-time type checking for global functions and properties.The intrinsic keyword was created specifically to enable compile-time type checking for built-in classes and objects, and global variables and functions. This keyword was not meant for general purpose use, but may be of some value to developers seeking to enable compile-time type checking with previously defined classes, especially if the classes are defined using ActionScript 1.0.This keyword is supported only when used in external script files, not in scripts written in the Actions panel.ExampleThe following example shows how to enable compile-time file checking for a previously defined ActionScript 1.0 class. The code will generate a compile-time error because the call myCircle.setRadius() sends a String value as a parameter instead of a Number value. You can avoid the error by changing the parameter to a Number value (for example, by changing &quot;10&quot; to 10).// The following code must be placed in a file named Circle.as // that resides within your classpath:intrinsic class Circle { var radius:Number; function Circle(radius:Number function getArea():Number; function getDiameter():Number; function setRadius(param_radius:Number):Number;}// This ActionScript 1.0 class definition may be placed in your FLA file.// Circle class is defined using ActionScript 1.0function Circle(radius) { this.radius = radius; this.getArea = function(){ return Math.PI*this.radius*this.radius; }; this.getDiameter = function() { return 2*this.radius; }; this.setRadius = function(param_radius) { this.radius = param_radius; }}// ActionScript 2.0 code that uses the Circle classvar myCircle:Circle = new Circle(5trace(myCircle.getArea()trace(myCircle.getDiameter()myCircle.setRadius(&quot;10&quot;trace(myCircle.radiustrace(myCircle.getArea()trace(myCircle.getDiameter()See alsoclass statement" />
   <page href="00005014.html" title="private statement" text="private statement class someClassName{ private var name; private 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 file&#39;s Publish Settings dialog box. This keyword is supported only when used in external script files, not in scripts written in the Actions panel.Specifies that a variable or function is available only to the class that declares or defines it or to subclasses of that class. By default, a variable or function is available to any caller. Use this keyword if you want to restrict access to a variable or function. You can use this keyword only in class definitions, not in interface definitions.Parametersname:String - The name of the variable or function that you want to specify as private.ExampleThe following example demonstrates how you can hide certain properties within a class using the private keyword. Create a new AS file called Login.as. class Login {  private var loginUserName:String;  private var loginPassword:String;  public function Login(param_username:String, param_password:String) {  this.loginUserName = param_username;  this.loginPassword = param_password;  }  public function get username():String {  return this.loginUserName;  }  public function set username(param_username:String):Void {  this.loginUserName = param_username;  }  public function set password(param_password:String):Void {  this.loginPassword = param_password;  } }In the same directory as Login.as, create a new FLA or AS document. Enter the following ActionScript in Frame 1 of the Timeline.import Login; var gus:Login = new Login(&quot;Gus&quot;, &quot;Smith&quot; trace(gus.username // output: Gus trace(gus.password // output: undefined trace(gus.loginPassword // errorBecause loginPassword is a private variable, you cannot access it from outside the Login.as class file. Attempts to access the private variable generate an error message.See alsopublic statement" />
   <page href="00005015.html" title="public statement" text="public statementclass someClassName{ public var name; public 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 file&#39;s Publish Settings dialog box. This keyword is supported only when used in external script files, not in scripts written in the Actions panel.Specifies that a variable or function is available to any caller. Because variables and functions are public by default, this keyword is used primarily for stylistic reasons. For example, you might want to use it for reasons of consistency in a block of code that also contains private or static variables.Parametersname:String - The name of the variable or function that you want to specify as public.ExampleThe following example shows how you can use public variables in a class file. Create a new class file called User.as and enter the following code: class User {  public var age:Number;  public var name:String; }Then create a new FLA or AS file in the same directory, and enter the following ActionScript in Frame 1 of the Timeline:import User; var jimmy:User = new User( jimmy.age = 27; jimmy.name = &quot;jimmy&quot;;If you change one of the public variables in the User class to a private variable, an error is generated when trying to access the property.See alsoprivate statement" />
   <page href="00005016.html" title="return statement" text="return statementreturn[expression]Specifies the value returned by a function. The return statement evaluates expressionand returns the result as a value of the function in which it executes. The return statement causes execution to return immediately to the calling function. If the return statement is used alone, it returns undefined.You can&#39;t return multiple values. If you try to do so, only the last value is returned. In the following example, c is returned:return a, b, c ;If you need to return multiple values, you might want to use an array or object instead.ReturnsString - The evaluated expression parameter, if provided.Parametersexpression - A string, number, Boolean, array, or object to evaluate and return as a value of the function. This parameter is optional.ExampleThe following example uses the return statement inside the body of the sum() function to return the added value of the three parameters. The next line of code calls sum() and assigns the returned value to the variable newValue. function sum(a:Number, b:Number, c:Number):Number {  return (a + b + c } var newValue:Number = sum(4, 32, 78 trace(newValue // output: 114See alsoArray function" />
   <page href="00005017.html" title="set statement" text="set statementfunction set property(varName) {  // 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 file&#39;s Publish Settings dialog box. This keyword is supported only when used in external script files, not in scripts written in the Actions panel.Permits implicit setting of properties associated with objects based on classes you have defined in external class files. Using implicit set methods lets you modify the value of an object&#39;s property without accessing the property directly. Implicit get/set methods are syntactic shorthand for the Object.addProperty() method in ActionScript 1.Parametersproperty:String - Word that refers to the property that set will access; this value must be the same as the value used in the corresponding get command.ExampleThe following example creates a Login class that demonstrates how the set keyword can be used to set private variables: class Login {  private var loginUserName:String;  private var loginPassword:String;  public function Login(param_username:String, param_password:String) {  this.loginUserName = param_username;  this.loginPassword = param_password;  }  public function get username():String {  return this.loginUserName;  }  public function set username(param_username:String):Void {  this.loginUserName = param_username;  }  public function set password(param_password:String):Void {  this.loginPassword = param_password;  } }In a FLA or AS file that is in the same directory as Login.as, enter the following ActionScript in Frame 1 of the Timeline:var gus:Login = new Login(&quot;Gus&quot;, &quot;Smith&quot; trace(gus.username // output: Gus gus.username = &quot;Rupert&quot;; trace(gus.username // output: RupertIn the following example, the get function executes when the value is traced. The set function triggers only when you pass it a value, as shown in the line:gus.username = &quot;Rupert&quot;;See alsogetProperty function" />
   <page href="00005018.html" title="set variable statement" text="set variable statementset(&quot;variableString&quot;,expression)Assigns a value to a variable. A variable is a container that holds data. The container is always the same, but the contents can change. By changing the value of a variable as the SWF file plays, you can record and save information about what the user has done, record values that change as the SWF file plays, or evaluate whether a condition is true or false. Variables can hold any data type (for example, String, Number, Boolean, Object, or MovieClip). The Timeline of each SWF file and movie clip has its own set of variables, and each variable has its own value independent of variables on other Timelines.Strict data typing is not supported inside a set statement. If you use this statement to set a variable to a value whose data type is different from the data type associated with the variable in a class file, no compiler error is generated.A subtle but important distinction to bear in mind is that the parameter variableString is a string, not a variable name. If you pass an existing variable name as the first parameter to set() without enclosing the name in quotation marks (&quot;&quot;), the variable is evaluated before the value of expression is assigned to it. For example, if you create a string variable named myVariable and assign it the value &quot;Tuesday,&quot; and then forget to use quotation marks, you will inadvertently create a new variable named Tuesday that contains the value you intended to assign to myVariable:var myVariable:String = &quot;Tuesday&quot;; set (myVariable, &quot;Saturday&quot; trace(myVariable // outputs Tuesday trace(Tuesday // outputs SaturdayYou can avoid this situation by using quotation marks (&quot;&quot;):set (&quot;myVariable&quot;, &quot;Saturday&quot;trace(myVariable //outputs SaturdayParametersvariableString:String - A string that names a variable to hold the value of the expression parameter.ExampleIn the following example, you assign a value to a variable. You are assigning the value of &quot;Jakob&quot; to the name variable. set(&quot;name&quot;, &quot;Jakob&quot; trace(nameThe following code loops three times and creates three new variables, called caption0, caption1, and caption2: for (var i = 0; i &lt; 3; i++) {  set(&quot;caption&quot; + i, &quot;this is caption &quot; + i } trace(caption0 trace(caption1 trace(caption2See alsoset variable statement" />
   <page href="00005019.html" title="static statement" text="static statementclass 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 file&#39;s Publish Settings dialog box. This keyword is supported only when used in external script files, not in scripts written in the Actions panel.Specifies that a variable or function is created only once per class rather than being created in every object based on that class. 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, but only through a non-static function that accesses the static member.You can use this keyword in class definitions only, not in interface definitions.Parametersname:String - The name of the variable or function that you want to specify as static.ExampleThe following example demonstrates how you can use the static keyword to create a counter that tracks how many instances of the class have been created. Because the numInstances variable is static, it will be created only once for the entire class, not for every single instance. Create a new AS file called Users.as and enter the following code: class Users {  private static var numInstances:Number = 0;  function Users() {  numInstances++;  }  static function get instances():Number {  return numInstances;  } }Create a FLA or AS document in the same directory, and enter the following ActionScript in Frame 1 of the Timeline:trace(Users.instances var user1:Users = new Users( trace(Users.instances var user2:Users = new Users( trace(Users.instances See alsoprivate statement" />
   <page href="00005020.html" title="super statement" text="super statementsuper.method([arg1, ..., argN])super([arg1, ..., argN])the first syntax style may be used within the body of an object method to invoke the superclass version of a method, and can optionally pass parameters (arg1 ... argN) to the superclass method. This is useful for creating subclass methods that add additional behavior to superclass methods, but also invoke the superclass methods to perform their original behavior.The second syntax style may be used within the body of a constructor function to invoke the superclass version of the constructor function and may optionally pass it parameters. This is useful for creating a subclass that performs additional initialization, but also invokes the superclass constructor to perform superclass initialization.ReturnsBoth forms invoke a function. The function may return any value.Parametersmethod:Function - The method to invoke in the superclass.argN - Optional parameters that are passed to the superclass version of the method (syntax 1) or to the constructor function of the superclass (syntax 2)." />
   <page href="00005021.html" title="switch statement" text="switch statementswitch (expression){caseClause: [defaultClause:] }Creates a branching structure for ActionScript statements. As with the if statement, the switch statement tests a condition and executes statements if the condition returns a value oftrue. All switch statements should include a default case. The default case should include a break statement that prevents a fall-through error if another case is added later. When a case falls through, it doesn&#39;t have a break statement.Parametersexpression - Any expression.ExampleIn the following example, if the String.fromCharCode(Key.getAscii()) parameter evaluates to A, the trace() statement that follows case &quot;A&quot; executes; if the parameter evaluates to a, the trace() statement that follows case &quot;a&quot;executes; and so on. If no case expression matches the String.fromCharCode(Key.getAscii()) parameter, the trace() statement that follows the default keyword executes. var listenerObj:Object = new Object(listenerObj.onKeyDown = function() {  switch (String.fromCharCode(Key.getAscii())) {  case &quot;A&quot; :  trace(&quot;you pressed A&quot;  break;  case &quot;a&quot; :  trace(&quot;you pressed a&quot;  break;  case &quot;E&quot; :  case &quot;e&quot; :  trace(&quot;you pressed E or e&quot;  break;  case &quot;I&quot; :  case &quot;i&quot; :  trace(&quot;you pressed I or i&quot;  break;  default :  trace(&quot;you pressed some other key&quot;  break;  } };Key.addListener(listenerObjSee also=== strict equality operator" />
   <page href="00005022.html" title="throw statement" text="throw statementthrow expressionGenerates, or throws, an error that can be handled, or caught, by a catch{} code block. If an exception is not caught by a catch block, the string representation of the thrown value is sent to the Output panel. Typically, you throw instances of the Error class or its subclasses (see the Example section).Parametersexpression:Object - An ActionScript expression or object.ExampleIn this example, a function named checkEmail() checks whether the string that is passed to it is a properly formatted e-mail address. If the string does not contain an @ symbol, the function throws an error. function checkEmail(email:String) {  if (email.indexOf(&quot;@&quot;) == -1) {  throw new Error(&quot;Invalid email address&quot;  } } checkEmail(&quot;someuser_theirdomain.com&quot;The following code then calls the checkEmail() function within a try code block. If the email_txtstring does not contain a valid e-mail address, the error message appears in a text field (error_txt).try {  checkEmail(&quot;Joe Smith&quot; } catch (e) {  error_txt.text = e.toString( }In the following example, a subclass of the Error class is thrown. The checkEmail() function is modified to throw an instance of that subclass. // Define Error subclass InvalidEmailError // In InvalidEmailError.as: class InvalidEmailAddress extends Error { var message = &quot;Invalid email address.&quot;; }In a FLA or AS file, enter the following ActionScript in Frame 1 of the Timeline:import InvalidEmailAddress; function checkEmail(email:String) {  if (email.indexOf(&quot;@&quot;) == -1) {  throw new InvalidEmailAddress(  } } try {  checkEmail(&quot;Joe Smith&quot; } catch (e) {  this.createTextField(&quot;error_txt&quot;, this.getNextHighestDepth(), 0, 0, 100, 22  error_txt.autoSize = true;  error_txt.text = e.toString( }See alsoError" />
   <page href="00005023.html" title="try..catch..finally statement" text="try..catch..finally statement try {// ... try block ... } finally { // ... finally block ... } try { // ... try block ... }  catch(error [:ErrorType1]) // ... catch block ... }  [catch(error[:ErrorTypeN]) { // ... catch block ... }]  [finally { // ... finally block ... }]Enclose a block of code in which an error can occur, and then respond to the error. If any code within the try code block throws an error (using the throw statement), control passes to the catch block, if one exists, and then to the finally code block, if one exists. The finally block always executes, regardless of whether an error was thrown. If code within the try block doesn&#39;t throw an error (that is, if the try block completes normally), then the code in the finally block is still executed. The finally block executes even if the try block exits using a return statement. A try block must be followed by a catch block, a finally block, or both. A single try block can have multiple catch blocks but only one finally block. You can nest try blocks as many levels deep as desired.The error parameter specified in a catch handler must be a simple identifier such as e or theException or x. The variable in a catch handler can also be typed. When used with multiple catch blocks, typed errors let you catch multiple types of errors thrown from a single try block.If the exception thrown is an object, the type will match if the thrown object is a subclass of the specified type. If an error of a specific type is thrown, the catch block that handles the corresponding error is executed. If an exception that is not of the specified type is thrown, the catch block does not execute and the exception is automatically thrown out of the try block to a catch handler that matches it. If an error is thrown within a function, and the function does not include a catch handler, then the ActionScript interpreter exits that function, as well as any caller functions, until a catch block is found. During this process, finally handlers are called at all levels.Parameterserror:Object - The expression thrown from a throw statement, typically an instance of the Error class or one of its subclasses.ExampleThe following example shows how to create a try..finally statement. Because code in the finally block is guaranteed to execute, it is typically used to perform any necessary clean-up after a try block executes. In the following example, setInterval()calls a function every 1000 millisecond (1 second). If an error occurs, an error is thrown and is caught by the catch block. The finally block is always executed whether or not an error occurs. Because setInterval() is used, clearInterval() must be placed in the finally block to ensure that the interval is cleared from memory. myFunction = function () {  trace(&quot;this is myFunction&quot; }; try {  myInterval = setInterval(this, &quot;myFunction&quot;, 1000  throw new Error(&quot;my error&quot; } catch (myError:Error) {  trace(&quot;error caught: &quot;+myError } finally {  clearInterval(myInterval  trace(&quot;error is cleared&quot; }In the following example, the finally block is used to delete an ActionScript object, regardless of whether an error occurred. Create a new AS file called Account.as.class Account {  var balance:Number = 1000;  function getAccountInfo():Number {  return (Math.round(Math.random() * 10) % 2  } }In the same directory as Account.as, create a new AS or FLA document and enter the following ActionScript in Frame 1 of the Timeline:import Account; var account:Account = new Account(try {  var returnVal = account.getAccountInfo(  if (returnVal != 0) {  throw new Error(&quot;Error getting account information.&quot;  } } finally {  if (account != null) {  delete account;  } }The following example demonstrates a try..catch statement. The code within the try block is executed. If an exception is thrown by any code within the try block, control passes to the catch block, which shows the error message in a text field using the Error.toString() method. In the same directory as Account.as, create a new FLA document and enter the following ActionScript in Frame 1 of the Timeline:import Account; var account:Account = new Account( try {  var returnVal = account.getAccountInfo(  if (returnVal != 0) {  throw new Error(&quot;Error getting account information.&quot;  }  trace(&quot;success&quot; } catch (e) {  this.createTextField(&quot;status_txt&quot;, this.getNextHighestDepth(), 0, 0, 100, 22  status_txt.autoSize = true;  status_txt.text = e.toString( }The following example shows a try code block with multiple, typed catch code blocks. Depending on the type of error that occurred, the try code block throws a different type of object. In this case, myRecordSet is an instance of a (hypothetical) class named RecordSet whose sortRows() method can throw two types of errors, RecordSetException and MalformedRecord.In the following example, the RecordSetException and MalformedRecord objects are subclasses of the Error class. Each is defined in its own AS class file. // In RecordSetException.as: class RecordSetException extends Error {  var message = &quot;Record set exception occurred.&quot;; } // In MalformedRecord.as: class MalformedRecord extends Error {  var message = &quot;Malformed record exception occurred.&quot;; }Within the RecordSet class&#39;s sortRows() method, one of these previously defined error objects is thrown, depending on the type of exception that occurred. The following example shows how this code might look:class RecordSet {  function sortRows() {  var returnVal:Number = randomNum(  if (returnVal == 1) {  throw new RecordSetException(  }  else if (returnVal == 2) {  throw new MalformedRecord(  }  } function randomNum():Number {  return Math.round(Math.random() * 10) % 3;  }}Finally, in another AS file or FLA script, the following code invokes the sortRows() method on an instance of the RecordSet class. It defines catch blocks for each type of error that is thrown by sortRows()import RecordSet; var myRecordSet:RecordSet = new RecordSet(try {  myRecordSet.sortRows(  trace(&quot;everything is fine&quot; } catch (e:RecordSetException) {  trace(e.toString() } catch (e:MalformedRecord) {  trace(e.toString() }See alsoError" />
   <page href="00005024.html" title="var statement" text="var statementvar variableName [= value1][...,variableNameN[=valueN]] Used to declare local variables. If you declare variables inside a function, the variables are local. They are defined for the function and expire at the end of the function call. More specifically, a variable defined using var is local to the code block containing it. Code blocks are demarcated by curly braces ({}). If you declare variables outside a function, the variables are available througout the timeline containing the statement.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. You can declare multiple variables in one statement, separating the declarations with commas (although this syntax may reduce clarity in your code):var first:String = &quot;Bart&quot;, middle:String = &quot;J.&quot;, last:String = &quot;Bartleby&quot;;Note: You must also use var when declaring properties inside class definitions in external scripts. Class files also support public, private, and static variable scopes. ParametersvariableName:String - An identifier.ExampleThe following ActionScript creates a new array of product names. Array.push adds an element onto the end of the array. If you want to use strict typing, it is essential that you use the var keyword. Without var before product_array, you get errors when you try to use strict typing. var product_array:Array = new Array(&quot;MX 2004&quot;, &quot;Studio&quot;, &quot;Dreamweaver&quot;, &quot;Flash&quot;, &quot;ColdFusion&quot;, &quot;Contribute&quot;, &quot;Breeze&quot; product_array.push(&quot;Flex&quot; trace(product_array // output: MX 2004,Studio,Dreamweaver,Flash,ColdFusion,Contribute,Breeze,Flex" />
   <page href="00005025.html" title="while statement" text="while statementwhile(condition) { statement(s }Evaluates a condition and if the condition evaluates to true, runs a statement or series of statements before looping back to evaluate the condition again. After the condition evaluates to false, the statement or series of statements is skipped and the loop ends. The while statement performs the following series of steps. Each repetition of steps 1 through 4 is called an iteration of the loop. The condition is retested at the beginning of each iteration, as shown in the following steps:The expression condition is evaluated.If condition evaluates to true or a value that converts to the Boolean value true, such as a nonzero number, go to step 3. Otherwise, the while statement is completed and execution resumes at the next statement after the while loop.Run the statement block statement(s).Go to step 1.Looping is commonly used to perform an action while a counter variable is less than a specified value. At the end of each loop, the counter is incremented until the specified value is reached. At that point, the condition is no longer true, and the loop ends.The curly braces ({}) used to enclose the block of statements to be executed by the while statement are not necessary if only one statement will execute.Parameterscondition:Boolean - An expression that evaluates to true or false.ExampleIn the following example, the while statement is used to test an expression. When the value of i is less than 20, the value of i is traced. When the condition is no longer true, the loop exits. var i:Number = 0; while (i &lt; 20) {  trace(i  i += 3; } The following result is displayed in the Output panel. 0 3 6 9 1215 18See alsocontinue statement" />
   <page href="00005026.html" title="with statement" text="with statementwith (object:Object) { statement(s }Lets you specify an object (such as a movie clip) with the object parameter and evaluate expressions and actions inside that object with the statement(s) parameter. This prevents you from having to repeatedly write the object&#39;s name or the path to the object. The object parameter becomes the context in which the properties, variables, and functions in the statement(s) parameter are read. For example, if object is my_array, and two of the properties specified are length and concat, those properties are automatically read as my_array.length and my_array.concat. In another example, if object is state.california, any actions or statements inside the with statement are called from inside the california instance.To find the value of an identifier in the statement(s) parameter, ActionScript starts at the beginning of the scope chain specified by the object and searches for the identifier at each level of the scope chain, in a specific order. The scope chain used by the with statement to resolve identifiers starts with the first item in the following list and continues to the last item:The object specified in the object parameter in the innermost with statement.The object specified in the object parameter in the outermost with statement. The Activation object. (A temporary object that is automatically created when a function is called that holds the local variables called in the function.)The movie clip that contains the currently executing script.The Global object (built-in objects such as Math and String).To set a variable inside a with statement, you must have declared the variable outside the with statement, or you must enter the full path to the Timeline on which you want the variable to live. If you set a variable in a with statement without declaring it, the with statement will look for the value according to the scope chain. If the variable doesn&#39;t already exist, the new value will be set on the Timeline from which the with statement was called.Instead of using with(), you can use direct paths. If you find that paths are long and cumbersome to type, you can create a local variable and store the path in the variable, which you can then reuse in your code, as shown in the following ActionScript:var shortcut = this._parent._parent.name_txt; shortcut.text = &quot;Hank&quot;; shortcut.autoSize = true;Parametersobject:Object - An instance of an ActionScript object or movie clip.ExampleThe following example sets the _x and _y properties of the someOther_mc instance, and then instructs someOther_mc to go to Frame 3 and stop. with (someOther_mc) {  _x = 50;  _y = 100;  gotoAndStop(3 }  The following code snippet shows how to write the preceding code without using a with statement. someOther_mc._x = 50; someOther_mc._y = 100; someOther_mc.gotoAndStop(3The with statement is useful for accessing multiple items in a scope chain list simultaneously. In the following example, the built-in Math object is placed at the front of the scope chain. Setting Math as a default object resolves the identifiers cos, sin, and PI to Math.cos, Math.sin, and Math.PI, respectively. The identifiers a, x, y, and r are not methods or properties of the Math object, but because they exist in the object activation scope of the function polar(), they resolve to the corresponding local variables.function polar(r:Number):Void {  var a:Number, x:Number, y:Number;  with (Math) {  a = PI * pow(r, 2  x = r * cos(PI  y = r * sin(PI / 2  }  trace(&quot;area = &quot; + a  trace(&quot;x = &quot; + x  trace(&quot;y = &quot; + y } polar(3 The following result is displayed in the Output panel. area = 28.2743338823081 x = -3 y = 3 " />
   <page href="00005027.html" title="fscommand2 Commands" text="CommandDescriptionExtendBacklightDurationExtends the duration of a backlight for a specified period of time.FullScreenSets the size of the display area to be used for rendering.GetBatteryLevelReturns the current battery level.GetDeviceSets a parameter that identifies the device on which Flash Lite is running.GetDeviceIDSets a parameter that represents the unique identifier of the device (for example, the serial number).GetFreePlayerMemoryReturns the amount of heap memory, in kilobytes, currently available to Flash Lite.GetMaxBatteryLevelReturns the maximum battery level of the device.GetMaxSignalLevelReturns the maximum signal strength level as a numeric value.GetMaxVolumeLevelReturns the maximum volume level of the device as a numeric value.GetNetworkConnectionNameReturns the name of the active or default network connection.GetNetworkConnectStatusReturns a value that indicates the current network connection status.GetNetworkGenerationReturns the generation of the current mobile wireless network (such as 2G or second generation of mobile wireless).GetNetworkNameSets a parameter to the name of the current network.GetNetworkRequestStatusReturns a value indicating the status of the most recent HTTP request.GetNetworkStatusReturns a value indicating the network status of the phone (that is, whether there is a network registered and whether the phone is currently roaming).GetPlatformSets a parameter that identifies the current platform, which broadly describes the class of device.GetPowerSourceReturns a value that indicates whether the power source is currently supplied from a battery or from an external power source.GetSignalLevelReturns the current signal strength as a numeric value.GetSoftKeyLocationReturns a value that indicates the location of soft keys on the device.GetTotalPlayerMemoryReturns the total amount of heap memory, in kilobytes, allocated to Flash Lite.GetVolumeLevelReturns the current volume level of the device as a numeric value.QuitCauses the Flash Lite Player to stop playback and exit.ResetSoftKeysResets the soft keys to their original settings.SetFocusRectColorSets the color of the focus rectangle to any color.SetInputTextTypeSpecifies the mode in which the input text field should be opened.SetSoftKeysRemaps the softkeys of a mobile device.StartVibrateStarts the phone&#39;s vibration feature.StopVibrateStops the current vibration, if any.fscommand2 CommandsThe following commands are available for the fscommand2() function. For a description of the fscommand2() function, see fscommand2 Function under &quot;Global Functions.&quot;fscommand2 Commands" />
   <page href="00005028.html" title="ExtendBacklightDuration fscommand2 Command" text="CommandParametersValue ReturnedExtendBacklightDurationduration The backlight duration, in seconds. Maximum value of 60 seconds.-1: Not supported &lt;br /&gt;0: An error occurred, and the operation could not be completed. &lt;br /&gt;1: Success ExtendBacklightDuration fscommand2 CommandExtendBacklightDurationExtends the duration of a backlight for a specified period of time. If the duration is greater than zero, this command specifies the amount of time in seconds (maximum of 60 seconds) that the backlight should be kept on. If the time elapses without an additional call to this command, the backlight behavior reverts to the default duration. If duration is zero, the backlight behavior immediately reverts to the default behavior.Note: This feature is system dependent. For example, some systems limit the total duration that the backlight can be extended.Note: This command is not supported for BREW devices.ExampleThe following example extends the duration of the backlight for 45 seconds:status = FSCommand2(&quot;ExtendBacklightDuration&quot;, 45)" />
   <page href="00005029.html" title="FullScreen fscommand2 Command" text="CommandParametersValue ReturnedFullScreensize-1: Not supported&lt;br /&gt;0: SupportedFullScreen fscommand2 CommandFullScreenSets the size of the display area to be used for rendering. The size can be a defined variable or a constant string value, with one of these values: true (full screen) or false (less than full screen). Any other value is treated as the value false. Note: This command is supported only when Flash Lite is running in stand-alone mode. It is not supported when the player is running in the context of another application (for example, as a plug-in to a browser).ExampleThe following example sets the size of the display area to the full screen:status = fscommand2(&quot;FullScreen&quot;, true" />
   <page href="00005030.html" title="GetBatteryLevel fscommand2 Command" text="CommandParametersValue ReturnedGetBatteryLevelNone.-1: Not supported &lt;br /&gt;Other numeric values: The current battery level.GetBatteryLevel fscommand2 CommandGetBatteryLevelReturns the current battery level. It is a numeric value that ranges from 0 to the maximum value returned by the GetMaxBatteryLevel variable.Note: This command is not supported for BREW devices.ExampleThe following example sets the battLevel variable to the current level of the battery:battLevel = fscommand2(&quot;GetBatteryLevel&quot; " />
   <page href="00005031.html" title="GetDevice fscommand2 Command" text="CommandParametersValue ReturnedGetDevicedevice String to receive the identifier of the device. It can be either the name of a variable or a string value that contains the name of a variable.-1: Not supported. &lt;br /&gt;0: Supported.GetDevice fscommand2 CommandGetDeviceSets a parameter that identifies the device on which Flash Lite is running. This identifier is typically the model name.ExampleThe following example assigns the device identifier to the device variable: status = fscommand2(&quot;GetDevice&quot;, &quot;device&quot;Some sample results and the devices they signify follow:D506i A Mitsubishi 506i phone. DFOMA1 A Mitsubishi FOMA1 phone. F506i A Fujitsu 506i phone. FFOMA1 A Fujitsu FOMA1 phone. N506i An NEC 506i phone. NFOMA1 An NEC FOMA1 phone. Nokia3650 A Nokia 3650 phone. p506i A Panasonic 506i phone. PFOMA1 A Panasonic FOMA1 phone. SH506i A Sharp 506i phone. SHFOMA1 A Sharp FOMA1 phone. SO506i A Sony 506iphone." />
   <page href="00005032.html" title="GetDeviceID fscommand2 Command" text="CommandParametersValue ReturnedGetDeviceIDid A string to receive the unique identifier of the device. It can be either the name of a variable or a string value that contains the name of a variable.-1: Not supported. &lt;br /&gt;0: Supported.GetDeviceID fscommand2 CommandGetDeviceIDSets a parameter that represents the unique identifier of the device (for example, the serial number).ExampleThe following example assigns the unique identifier to the deviceID variable:status = fscommand2(&quot;GetDeviceID&quot;, &quot;deviceID&quot;" />
   <page href="00005033.html" title="GetFreePlayerMemory fscommand2 Command" text="CommandParametersValue ReturnedGetFreePlayerMemoryNone-1: Not supported. &lt;br /&gt;0 or positive value: Available kilobytes of heap memory.GetFreePlayerMemory fscommand2 CommandGetFreePlayerMemoryReturns the amount of heap memory, in kilobytes, currently available to Flash Lite.ExampleThe following example sets status equal to the amount of free memory:status = fscommand2(&quot;GetFreePlayerMemory&quot;" />
   <page href="00005034.html" title="GetMaxBatteryLevel fscommand2 Command" text="CommandParametersValue ReturnedGetMaxBatteryLevelNone-1: Not supported. &lt;br /&gt;Other values: The maximum battery level.GetMaxBatteryLevel fscommand2 CommandGetMaxBatteryLevelReturns the maximum battery level of the device. It is a numeric value greater than 0. Note: This command is not supported for BREW devices.ExampleThe following example sets the the maxBatt variable to the maximum battery level:maxBatt = fscommand2(&quot;GetMaxBatteryLevel&quot;" />
   <page href="00005035.html" title="GetMaxSignalLevel fscommand2 Command" text="CommandParametersValue ReturnedGetMaxSignalLevelNone-1: Not supported. &lt;br /&gt;Other numeric values: The maximum signal level.GetMaxSignalLevel fscommand2 CommandGetMaxSignalLevelReturns the maximum signal strength level as a numeric value.Note: This command is not supported for BREW devices.ExampleThe following example assigns the maximum signal strength to the sigStrengthMax variable:sigStrengthMax = fscommand2(&quot;GetMaxSignalLevel&quot; " />
   <page href="00005036.html" title="GetMaxVolumeLevel fscommand2 Command" text="CommandParametersValue ReturnedGetMaxVolumeLevelNone-1: Not supported. &lt;br /&gt;Other values: The maximum volume level.GetMaxVolumeLevel fscommand2 CommandGetMaxVolumeLevelReturns the maximum volume level of the device as a numeric value.ExampleThe following example sets the maxvolume variable to the maximum volume level of the device:maxvolume = fscommand2(&quot;GetMaxVolumeLevel&quot;trace (maxvolume // output: 80" />
   <page href="00005037.html" title="GetNetworkConnectionName fscommand2 Command" text="CommandParametersValue ReturnedGetNetworkConnectionNameNone-1: Not supported &lt;br /&gt;0: Success: returns the active network connection name &lt;br /&gt;1: Success: returns the default network connection name &lt;br /&gt;2: Unable to retrieve the connection nameGetNetworkConnectionName fscommand2 CommandGetNetworkConnectionNameReturns the name of the active or default network connection. For mobile devices, this connection is also known as an access point.Note: This command is not supported for BREW devices.ExampleThe following example returns the name of the active or default network connection in the argument myConnectionName:status = FSCommand2(&quot;GetNetworkConnectionName&quot;, &quot;myConnectionName&quot;" />
   <page href="00005038.html" title="GetNetworkConnectStatus fscommand2 Command" text="CommandParametersValue ReturnedGetNetworkConnectStatusNone-1: Not supported. &lt;br /&gt;0: There is currently an active network connection. &lt;br /&gt;1: The device is attempting to connect to the network. &lt;br /&gt;2: There is currently no active network connection. &lt;br /&gt;3: The network connection is suspended. &lt;br /&gt;4: The network connection cannot be determined. GetNetworkConnectStatus fscommand2 CommandGetNetworkConnectStatusReturns a value that indicates the current network connection status.Note: This command is not supported for BREW devices.ExampleThe following example assigns the network connection status to the connectstatus variable, and then uses a switch statement to update a text field with the status of the connection:connectstatus = FSCommand2(&quot;GetNetworkConnectStatus&quot;switch (connectstatus) {connectstatus = FSCommand2(&quot;GetNetworkConnectStatus&quot;switch (connectstatus) {connectstatus = FSCommand2(&quot;GetNetworkConnectStatus&quot; switch (connectstatus) {  case -1 :  _root.myText += &quot;connectstatus not supported&quot; + &quot; n&quot;;  break; case 0 :  _root.myText += &quot;connectstatus shows active connection&quot; + &quot; n&quot;;  break; case 1 :  _root.myText += &quot;connectstatus shows attempting connection&quot; + &quot; n&quot;;  break;  case 2 :  _root.myText += &quot;connectstatus shows no connection&quot; + &quot; n&quot;;  break;  case 3 :  _root.myText += &quot;connectstatus shows suspended connection&quot; + &quot; n&quot;;  break;  case 4 :  _root.myText += &quot;connectstatus shows indeterminable state&quot; + &quot; n&quot;;  break; } " />
   <page href="00005039.html" title="GetNetworkGeneration fscommand2 Command" text="CommandParametersValue ReturnedGetNetworkGenerationNone-1: Not supported &lt;br /&gt;0: Unknown generation of mobile wireless network &lt;br /&gt;1: 2G &lt;br /&gt;2: 2.5G &lt;br /&gt;3: 3GGetNetworkGeneration fscommand2 CommandGetNetworkGenerationReturns the generation of the current mobile wireless network, such as 2G (second generation of mobile wireless).ExampleThe following example shows syntax for returning the generation of the network:status = fscommand2(&quot;GetNetworkGeneration&quot;" />
   <page href="00005040.html" title="GetNetworkName fscommand2 Command" text="CommandParametersValue ReturnedGetNetworkNamenetworkName String representing the network name. It can be either the name of a variable or a string value that contains the name of a variable. If the network is registered and its name can be determined, networkname is set to the network name; otherwise, it is set to the empty string. -1: Not supported. &lt;br /&gt;0: No network is registered. &lt;br /&gt;1: Network is registered, but network name is not known. &lt;br /&gt;2: Network is registered, and network name is known. GetNetworkName fscommand2 CommandGetNetworkNameSets a parameter to the name of the current network.Note: This command is not supported for BREW devices.ExampleThe following example assigns the name of the current network to the myNetName parameter and a status value to the netNameStatus variable:netNameStatus = fscommand2(&quot;GetNetworkName&quot;, myNetName " />
   <page href="00005041.html" title="GetNetworkRequestStatus fscommand2 Command" text="CommandParametersValue ReturnedGetNetworkRequestStatusNone-1: The command is not supported. &lt;br /&gt;0: There is a pending request, a network connection has been established, the server&#39;s host name has been resolved, and a connection to the server has been made. &lt;br /&gt;1: There is a pending request, and a network connection is being established. &lt;br /&gt;2: There is a pending request, but a network connection has not yet been established. &lt;br /&gt;3: There is a pending request, a network connection has been established, and the server&#39;s host name is being resolved. &lt;br /&gt;4: The request failed because of a network error. &lt;br /&gt;5: The request failed because of a failure in connecting to the server. &lt;br /&gt;6: The server has returned an HTTP error (for example, 404). &lt;br /&gt;7: The request failed because of a failure in accessing the DNS server or in resolving the server name. &lt;br /&gt;8: The request has been successfully fulfilled. &lt;br /&gt;9: The request failed because of a timeout. 10: The request has not yet been made. GetNetworkRequestStatus fscommand2 CommandGetNetworkRequestStatusReturns a value indicating the status of the most recent HTTP request.Note: This command is not supported for BREW devices.ExampleThe following example assigns the status of the most recent HTTP request to the requesttatus variable, and then uses a switch statement to update a text field with the status:requeststatus = fscommand2(&quot;GetNetworkRequestStatus&quot; switch (requeststatus) {  case -1:  _root.myText += &quot;requeststatus not supported&quot; + &quot; n&quot;;  break;  case 0:  _root.myText += &quot;connection to server has been made&quot; + &quot; n&quot;;  break;  case 1:  _root.myText += &quot;connection is being established&quot; + &quot; n&quot;;  break;  case 2:  _root.myText += &quot;pending request, contacting network&quot; + &quot; n&quot;;  break;  case 3:  _root.myText += &quot;pending request, resolving domain&quot; + &quot; n&quot;;  break;  case 4:  _root.myText += &quot;failed, network error&quot; + &quot; n&quot;;  break;  case 5:  _root.myText += &quot;failed, couldn&#39;t reach server&quot; + &quot; n&quot;;  break;  case 6:  _root.myText += &quot;HTTP error&quot; + &quot; n&quot;;  break;  case 7:  _root.myText += &quot;DNS failure&quot; + &quot; n&quot;;  break;  case 8:  _root.myText += &quot;request has been fulfilled&quot; + &quot; n&quot;;  break;  case 9:  _root.myText += &quot;request timedout&quot; + &quot; n&quot;;  break;  case 10:  _root.myText += &quot;no HTTP request has been made&quot; + &quot; n&quot;;  break; } " />
   <page href="00005042.html" title="GetNetworkStatus fscommand2 Command" text="CommandParametersValue ReturnedGetNetworkStatusNone-1: The command is not supported. &lt;br /&gt;0: No network registered. &lt;br /&gt;1: On home network. &lt;br /&gt;2: On extended home network. &lt;br /&gt;3: Roaming (away from home network).GetNetworkStatus fscommand2 CommandGetNetworkStatusReturns a value indicating the network status of the phone (that is, whether there is a network registered and whether the phone is currently roaming). ExampleThe following example assigns the status of the network connection to the networkstatus variable, and then uses a switch statement to update a text field with the status:networkstatus = fscommand2(&quot;GetNetworkStatus&quot; switch(networkstatus) {  case -1:  _root.myText += &quot;network status not supported&quot; + &quot; n&quot;;  break;  case 0:  _root.myText += &quot;no network registered&quot; + &quot; n&quot;;  break;  case 1:  _root.myText += &quot;on home network&quot; + &quot; n&quot;;  break;  case 2:  _root.myText += &quot;on extended home network&quot; + &quot; n&quot;;  break;  case 3:  _root.myText += &quot;roaming&quot; + &quot; n&quot;;  break; } " />
   <page href="00005043.html" title="GetPlatform fscommand2 Command" text="CommandParametersValue ReturnedGetPlatformplatform String to receive the identifier of the platform.-1: Not supported. &lt;br /&gt;0: Supported. GetPlatform fscommand2 CommandGetPlatformSets a parameter that identifies the current platform, which broadly describes the class of device. For devices with open operating systems, this identifier is typically the name and version of the operating system.ExampleThe following example sets the platform parameter to the identifier for the current platform:status = fscommand2(&quot;GetPlatform&quot;, &quot;platform&quot;The following examples show some sample results for platform:506i A 506i phone. FOMA1 A FOMA1 phone. Symbian6.1_s60.1 A Symbian 6.1, Series 60 version 1 phone. Symbian7.0 A Symbian 7.0 phone" />
   <page href="00005044.html" title="GetPowerSource fscommand2 Command" text="CommandParametersValue ReturnedGetPowerSourceNone-1: Not supported. &lt;br /&gt;0: Device is operating on battery power. &lt;br /&gt;1: Device is operating on an external power source.GetPowerSource fscommand2 CommandGetPowerSourceReturns a value that indicates whether the power source is currently supplied from a battery or from an external power source.Note: This command is not supported for BREW devices.ExampleThe following example sets the myPower variable to indicate the power source, or to -1 if it was unable to do so:myPower = fscommand2(&quot;GetPowerSource&quot;" />
   <page href="00005045.html" title="GetSignalLevel fscommand2 Command" text="CommandParametersValue ReturnedGetSignalLevelNone-1: Not supported. &lt;br /&gt;Other numeric values: The current signal level, ranging from 0 to the maximum value returned by GetMaxSignalLevel.GetSignalLevel fscommand2 CommandGetSignalLevelReturns the current signal strength as a numeric value.Note: This command is not supported for BREW devices.ExampleThe following example assigns the signal level value to the sigLevel variable:sigLevel = fscommand2(&quot;GetSignalLevel&quot;" />
   <page href="00005046.html" title="GetSoftKeyLocation fscommand2 Command" text="CommandParametersValue ReturnedGetSoftKeyLocationNone-1: Not supported. &lt;br /&gt;0: Soft keys on top. &lt;br /&gt;1: Soft keys on left. &lt;br /&gt;2: Soft keys on bottom. &lt;br /&gt;3: Soft keys on right. GetSoftKeyLocation fscommand2 CommandGetSoftKeyLocationReturns a value that indicates the location of soft keys on the device. ExampleThe following example sets the status variable to indicate the soft key location, or to -1 if soft keys are not supported on the device:status = fscommand2(&quot;GetSoftKeyLocation&quot;" />
   <page href="00005047.html" title="GetTotalPlayerMemory fscommand2 Command" text="CommandParametersValue ReturnedGetTotalPlayerMemoryNone-1: Not supported. &lt;br /&gt;0 or positive value: Total kilobytes of heap memory. GetTotalPlayerMemory fscommand2 CommandGetTotalPlayerMemoryReturns the total amount of heap memory, in kilobytes, allocated to Flash Lite.ExampleThe following example sets the status variable to the total amount of heap memory:status = fscommand2(&quot;GetTotalPlayerMemory&quot; " />
   <page href="00005048.html" title="GetVolumeLevel fscommand2 Command" text="CommandParametersValue ReturnedGetVolumeLevelNone-1: Not supported. &lt;br /&gt;Other numeric values: The current volume level, ranging from 0 to the value returned by fscommand2(&quot;GetMaxVolumeLevel&quot;).GetVolumeLevel fscommand2 CommandGetVolumeLevelReturns the current volume level of the device as a numeric value.ExampleThe following example assigns the current volume level to the volume variable:volume = fscommand2(&quot;GetVolumeLevel&quot;trace (volume // output: 50" />
   <page href="00005049.html" title="Quit fscommand2 Command" text="CommandParametersValue ReturnedQuitNone-1: Not supported.Quit fscommand2 CommandQuitCauses the Flash Lite player to stop playback and exit. This command is supported only when Flash Lite is running in stand-alone mode. It is not supported when the player is running in the context of another application (for example, as a plug-in to a browser).ExampleThe following example causes Flash Lite to stop playback and quit when running in stand-alone mode:status = fscommand2(&quot;Quit&quot;" />
   <page href="00005050.html" title="ResetSoftKeys fscommand2 Command" text="CommandParametersValue ReturnedResetSoftKeysNone-1: Not supported.ResetSoftKeys fscommand2 CommandResetSoftKeysResets the soft keys to their original settings.This command is supported only when Flash Lite is running in stand-alone mode. It is not supported when the player is running in the context of another application (for example, as a plug-in to a browser).ExampleThe following statement resets the soft keys to their original settings:status = fscommand2(&quot;ResetSoftKeys&quot;" />
   <page href="00005051.html" title="SetFocusRectColor fscommand2 Command" text="CommandParametersValue ReturnedSetFocusRectColorNone-1: Not supported &lt;br /&gt;0: Indeterminable &lt;br /&gt;1: SuccessSetFocusRectColor fscommand2 CommandSetFocusRectColorSets the color of the focus rectangle to any color. The acceptable range of values for red, green, and blue is 0-255. For Flash, you cannot change the default color of the focus rectangle, which is yellow.ExampleThe following statement resets the color of the focus rectangle:status = fscommand2(&quot;SetFocusRectColor, &lt;red&gt;, &lt;green&gt;, &lt;blue&gt;" />
   <page href="00005052.html" title="SetInputTextType fscommand2 Command" text="CommandParametersValue ReturnedSetInputTextTypevariableName Name of the input text field. It can be either the name of a variable or a string value that contains the name of a variable. Note: A text field&#39;s variable name is not the same as its instance name. You can specify a text field&#39;s variable name in the Var text box in the property inspector or by using ActionScript. For example, the following code restricts input to numeric characters for the text field instance (numTxt) whose associated variable name is &quot;numTxt_var&quot;.var numTxt:TextField;numTxt.variable = &quot;numTxt_var&quot;;fscommand2(&quot;SetInputTextType&quot;, &quot;numTxt_var&quot;, &quot;Numeric&quot;type One of the values Numeric, Alpha, Alphanumeric, Latin, NonLatin, or NoRestriction.0: Failure. &lt;br /&gt;1: Success.InputTextType ModeSets the FEP to one of these mutually exclusive modesIf not supported on current device, opens the FEP in this modeNumericNumbers only (0 to 9)Alphanumeric AlphaAlphabetic characters only (A to Z, a to z)Alphanumeric AlphanumericAlphanumeric characters only (0 to 9, A to Z, a to z)Latin LatinLatin characters only (alphanumeric and punctuation)NoRestriction NonLatinNon-Latin characters only (for example, Kanji and Kana)NoRestriction NoRestrictionDefault mode (sets no restriction on the FEP)N/ANOTE: Not all mobile phones support these input text field types. For this reason, you must validate the input text data.SetInputTextType fscommand2 CommandSetInputTextTypeSpecifies the mode in which the input text field should be opened. Flash Lite supports input text functionality by asking the host application to start the generic device-specific text input interface, often referred to as the front-end processor (FEP). When the SetInputTextType command is not used, the FEP is opened in default mode.The following table shows what effect each mode has, and what modes are substituted:ExampleThe following line of code sets the input text type of the field associated with the input1 variable to receive numeric data:status = fscommand2(&quot;SetInputTextType&quot;, &quot;input1&quot;, &quot;Numeric&quot;" />
   <page href="00005053.html" title="SetSoftKeys fscommand2 Command" text="CommandParametersValue ReturnedSetSoftKeyssoft1 Text to be displayed for the SOFT1 soft key. soft2 Text to be displayed for the SOFT2 soft key.These parameters are either names of variables or constant string values (for example, &quot;Previous&quot;).-1: Not supported. &lt;br /&gt;0: Supported.SetSoftKeys fscommand2 CommandSetSoftKeysRemaps the soft keys of a mobile device. When the user presses a soft key, any ActionScript associated with the soft key event is executed. The Flash Lite player executes this function immediately upon invocation. This command is supported only when Flash Lite is running in stand-alone mode. It is not supported when the player is running in the context of another application (for example, as a plug-in to a browser).For backward compatibility with Flash Lite 1.1, the SOFT1 soft key is always mapped to the left key on the handset, and the SOFT2 soft key is always mapped to the right key on the handset. For the SOFT3 soft key and higher, the locations are dependent on each handset. The arguments for this command specify the text to be displayed for the corresponding soft keys. When the SetSoftKeys command is executed, pressing the left key generates a SOFT1 keypress event, and pressing the right key generates a SOFT2 keypress event. Pressing the SOFT3 through SOFT12 soft keys generates their respective events. Note: The remapping of soft keys depends on the mobile device. Check with the device manufacturer to see if the remapping of soft keys is supported.ExampleThe following example labels the SOFT1 soft key &quot;Previous&quot; and the SOFT2 soft key &quot;Next&quot;:status = fscommand2(&quot;SetSoftKeys&quot;, &quot;Previous&quot;, &quot;Next&quot; You can define variables or use constant string values for each soft key:status = fscommand2(&quot;SetSoftKeys&quot;, soft1, soft2, [soft3], [soft4], ..., [softn])Note: You can set one soft key without setting the others. These examples show the syntax and behavior of setting a specific soft key without affecting other keys:To set the left soft key label to &quot;soft1&quot; and the right soft key to empty:status = fscommand2(&quot;SetSoftKeys&quot;, &quot;soft1&quot;, &quot;&quot;)To leave the label for the left soft key as is and set right soft key to &quot;soft2&quot;: status = fscommand2(&quot;SetSoftKeys&quot;, undefined, &quot;soft2&quot;)To leave the label for the left soft key as is and set the right soft key to &quot;soft2&quot;:status = fscommand2(&quot;SetSoftKeys&quot;, null, &quot;soft2&quot;)To set the left soft key label to &quot;soft1&quot; and leave the right soft key as is:status = fscommand2(&quot;SetSoftKeys&quot;, &quot;soft1&quot;)" />
   <page href="00005054.html" title="StartVibrate fscommand2 Command" text="CommandParametersValue ReturnedStartVibratetime_on Amount of time, in milliseconds (to a maximum of 5 seconds), that the vibration is on. time_off Amount of time, in milliseconds (to a maximum of 5 seconds), that the vibration is off.repeat Number of times (to a maximum of 3) to repeat this vibration. -1: Not supported. &lt;br /&gt;0: Vibration was started. &lt;br /&gt;1: An error occurred and vibration could not be started.StartVibrate fscommand2 CommandStartVibrateStarts the phone&#39;s vibration feature. If a vibration is already occurring, Flash Lite stops that vibration before starting the new one. Vibrations also stop when playback of the Flash application is stopped or paused, and when the Flash Lite player quits.ExampleThe following example attempts to start a vibration sequence of 2.5 seconds on, 1 second off, repeated twice. It assigns a value to the status variable that indicates success or failure:fscommand2(&quot;StartVibrate&quot;, 2500, 1000, 2 " />
   <page href="00005055.html" title="StopVibrate fscommand2 Command" text="CommandParametersValue ReturnedStopVibrateNone-1: Not supported. &lt;br /&gt;0: The vibration stopped. StopVibrate fscommand2 CommandStopVibrateStops the current vibration, if any.ExampleThe following example calls StopVibrate and saves the result (not supported or vibration stopped) in the status variable:status = fscommand2(&quot;StopVibrate&quot;" />
   <page href="00005056.html" title="ActionScript classes" text="ActionScript classesDocumentation for ActionScript classes includes syntax, usage information, and code samples for methods, properties, and event handlers and listeners that belong to a specific class in ActionScript (as opposed to global functions or properties). The classes are listed alphabetically. If you are not sure to which class a certain method or property belongs, you can look it up in the Index." />
   <page href="00005057.html" title="arguments" text="ModifiersPropertyDescriptioncallee:ObjectA reference to the currently executing function.caller:ObjectA reference to the function that called the currently executing function, or null if it wasn&#39;t called from another function.length:NumberThe number of arguments passed to the function.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)argumentsObject | +-argumentspublic class argumentsextends ObjectAn arguments object is used to store and access a function&#39;s arguments. While inside the function&#39;s body it can be accessed with the local arguments variable. The arguments are stored as array elements, the first is accessed as arguments[0], the second as arguments[1], etc. The arguments.length property indicates the number of arguments passed to the function. Note that there may be a different number of arguments passed in than the function declares. See alsoFunctionProperty summaryProperties inherited from class ObjectMethod summaryMethods inherited from class Object" />
   <page href="00005058.html" title="callee (arguments.callee property)" text="callee (arguments.callee property)public callee : ObjectA reference to the currently executing function.See alsocaller (arguments.caller property)" />
   <page href="00005059.html" title="caller (arguments.caller property)" text="caller (arguments.caller property)public caller : ObjectA reference to the function that called the currently executing function, or null if it wasn&#39;t called from another function.See alsocallee (arguments.callee property)" />
   <page href="00005060.html" title="length (arguments.length property)" text="length (arguments.length property)public length : NumberThe number of arguments passed to the function. This may be more or less than the function declares." />
   <page href="00005061.html" title="Array" text="ModifiersPropertyDescriptionstaticCASEINSENSITIVE:NumberRepresents case-insensitive sorting.staticDESCENDING:NumberRepresents a descending sort order.length:NumberA non-negative integer specifying the number of elements in the array.staticNUMERIC:NumberRepresents numeric sorting instead of string-based sorting.staticRETURNINDEXEDARRAY:NumberRepresents the option to return an indexed array as a result of calling the sort() or sortOn() method.staticUNIQUESORT:NumberRepresents the unique sorting requirement.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)SignatureDescriptionArray([value:Object])Lets you create an array.ModifiersSignatureDescriptionconcat([value:Object]) : ArrayConcatenates the elements specified in the parameters with the elements in an array and creates a new array.join([delimiter:String]) : StringConverts the elements in an array to strings, inserts the specified separator between the elements, concatenates them, and returns the resulting string.pop() : ObjectRemoves the last element from an array and returns the value of that element.push(value:Object) : NumberAdds one or more elements to the end of an array and returns the new length of the array.reverse() : VoidReverses the array in place.shift() : ObjectRemoves the first element from an array and returns that element.slice([startIndex:Number], [endIndex:Number]) : ArrayReturns a new array that consists of a range of elements from the original array, without modifying the original array.sort([compareFunction:Object], [options:Number]) : ArraySorts the elements in an array.sortOn(fieldName:Object, [options:Object]) : ArraySorts the elements in an array according to one or more fields in the array.splice(startIndex:Number, [deleteCount:Number], [value:Object]) : ArrayAdds elements to and removes elements from an array.toString() : StringReturns a string value representing the elements in the specified Array object.unshift(value:Object) : NumberAdds one or more elements to the beginning of an array and returns the new length of the array.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)ArrayObject | +-Arraypublic dynamic class Arrayextends ObjectThe Array class lets you access and manipulate indexed arrays. An indexed array is an object whose properties are identified by a number representing their position in the array. This number is referred to as the index. All indexed arrays are zero-based, which means that the first element in the array is [0], the second element is [1], and so on. To create an Array object, you use the constructor new Array(). To access the elements of an array, you use the array access ([]) operator. You can store a wide variety of data types in an array element, including numbers, strings, objects, and even other arrays. You can create a multidimensional array by creating an indexed array and assigning to each of its elements a different indexed array. Such an array is considered multidimensional because it can be used to represent data in a table.Array assignment is by reference rather than by value: when you assign one array variable to another array variable, both refer to the same array:var oneArray:Array = new Array(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;var twoArray:Array = oneArray; // Both array variables refer to the same array.twoArray[0] = &quot;z&quot;; trace(oneArray // Output: z,b,c.The Array class should not be used to create associative arrays, which are different data structures that contain named elements instead of numbered elements. You should use the Object class to create associative arrays (also called hashes). Although ActionScript permits you to create associative arrays using the Array class, you can not use any of the Array class methods or properties. At its core, an associative array is an instance of the Object class, and each key-value pair is represented by a property and its value. Another reason to declare an associative array as a type Object is that you can then use an object literal to populate your associative array (but only at the time you declare it). The following example creates an associative array using an object literal, accesses items using both the dot operator and the array access operator, and then adds a new key-value pair by creating a new property:var myAssocArray:Object = {fname:&quot;John&quot;, lname:&quot;Public&quot;};trace(myAssocArray.fname // Output: Johntrace(myAssocArray[&quot;lname&quot;] // Output: PublicmyAssocArray.initial = &quot;Q&quot;;trace(myAssocArray.initial // Output: QExampleIn the following example, my_array contains four months of the year: var my_array:Array = new Array(my_array[0] = &quot;January&quot;;my_array[1] = &quot;February&quot;;my_array[2] = &quot;March&quot;;my_array[3] = &quot;April&quot;;Property summaryProperties inherited from class ObjectConstructor summaryMethod summaryMethods inherited from class Object" />
   <page href="00005062.html" title="Array constructor" text="Array constructorpublic Array([value:Object])Lets you create an array. You can use the constructor to create different types of arrays: an empty array, an array with a specific length but whose elements have undefined values, or an array whose elements have specific values. Usage 1: If you don&#39;t specify any parameters, an array with a length of 0 is created. Usage 2: If you specify only a length, an array is created with length number of elements. The value of each element is set to undefined.Usage 3: If you use the element parameters to specify values, an array is created with specific values.Parametersvalue:Object [optional] - Either: An integer that specifies the number of elements in the array.A list of two or more arbitrary values. The values can be of type Boolean, Number, String, Object, or Array. The first element in an array always has an index or position of 0.Note: If only a single numeric parameter is passed to the Array constructor, it is assumed to be length and it is converted to an integer by using the Integer() function.ExampleUsage 1: The following example creates a new Array object with an initial length of 0: var my_array:Array = new Array(trace(my_array.length // Traces 0.Usage 2: The following example creates a new Array object with an initial length of 4:var my_array:Array = new Array(4trace(my_array.length // Returns 4.trace(my_array[0] // Returns undefined.if (my_array[0] == undefined) { // No quotation marks around undefined. trace(&quot;undefined is a special value, not a string&quot;} // Traces: undefined is a special value, not a string.Usage 3: The following example creates the new Array object go_gos_array with an initial length of 5:var go_gos_array:Array = new Array(&quot;Belinda&quot;, &quot;Gina&quot;, &quot;Kathy&quot;, &quot;Charlotte&quot;, &quot;Jane&quot;trace(go_gos_array.length // Returns 5.trace(go_gos_array.join(&quot;, &quot;) // Displays elements.The initial elements of the go_gos_array array are identified, as shown in the following example:go_gos_array[0] = &quot;Belinda&quot;;go_gos_array[1] = &quot;Gina&quot;;go_gos_array[2] = &quot;Kathy&quot;;go_gos_array[3] = &quot;Charlotte&quot;;go_gos_array[4] = &quot;Jane&quot;;The following code adds a sixth element to the go_gos_array array and changes the second element:go_gos_array[5] = &quot;Donna&quot;;go_gos_array[1] = &quot;Nina&quot;trace(go_gos_array.join(&quot; + &quot;)// Returns Belinda + Nina + Kathy + Charlotte + Jane + Donna.See also[] array access operator, length (Array.length property)" />
   <page href="00005063.html" title="CASEINSENSITIVE (Array.CASEINSENSITIVE property)" text="CASEINSENSITIVE (Array.CASEINSENSITIVE property)public static CASEINSENSITIVE : NumberRepresents case-insensitive sorting. You can use this constant for the options parameter in the sort() or sortOn() method. The value of this constant is 1.See alsosort (Array.sort method), sortOn (Array.sortOn method)" />
   <page href="00005064.html" title="concat (Array.concat method)" text="concat (Array.concat method)public concat([value:Object]) : ArrayConcatenates the elements specified in the parameters with the elements in an array and creates a new array. If the value parameters specify an array, the elements of that array are concatenated, rather than the array itself. The array my_array is left unchanged.Parametersvalue:Object [optional] - Numbers, elements, or strings to be concatenated in a new array. If you don&#39;t pass any values, a duplicate of my_array is created.ReturnsArray - An array that contains the elements from this array followed by elements from the parameters.ExampleThe following code concatenates two arrays: var alpha_array:Array = new Array(&quot;a&quot;,&quot;b&quot;,&quot;c&quot;var numeric_array:Array = new Array(1,2,3var alphaNumeric_array:Array =alpha_array.concat(numeric_array trace(alphaNumeric_array// Creates array [a,b,c,1,2,3].The following code concatenates three arrays:var num1_array:Array = [1,3,5];var num2_array:Array = [2,4,6];var num3_array:Array = [7,8,9];var nums_array:Array=num1_array.concat(num2_array,num3_array) trace(nums_array// Creates array [1,3,5,2,4,6,7,8,9].Nested arrays are not flattened in the same way as normal arrays. The elements in a nested array are not broken into separate elements in array x_array, as shown in the following example:var a_array:Array = new Array (&quot;a&quot;,&quot;b&quot;,&quot;c&quot;// 2 and 3 are elements in a nested array.var n_array:Array = new Array(1, [2, 3], 4 var x_array:Array = a_array.concat(n_arraytrace(x_array[0] // atrace(x_array[1] // btrace(x_array[2] // ctrace(x_array[3] // 1trace(x_array[4] // 2, 3 trace(x_array[5] // 4" />
   <page href="00005065.html" title="DESCENDING (Array.DESCENDING property)" text="DESCENDING (Array.DESCENDING property)public static DESCENDING : NumberRepresents a descending sort order. You can use this constant for the options parameter in the sort() or sortOn() method. The value of this constant is 2.See alsosort (Array.sort method), sortOn (Array.sortOn method)" />
   <page href="00005066.html" title="join (Array.join method)" text="join (Array.join method)public join([delimiter:String]) : StringConverts the elements in an array to strings, inserts the specified separator between the elements, concatenates them, and returns the resulting string. A nested array is always separated by a comma (,), not by the separator passed to the join() method.Parametersdelimiter:String [optional] - A character or string that separates array elements in the returned string. If you omit this parameter, a comma (,) is used as the default separator.ReturnsString - A string.ExampleThe following example creates an array with three elements: Earth, Moon, and Sun. It then joins the array three times--first by using the default separator (a comma [,] and a space), then by using a dash (-), and then by using a plus sign (+). var a_array:Array = new Array(&quot;Earth&quot;,&quot;Moon&quot;,&quot;Sun&quot;)trace(a_array.join() // Displays Earth,Moon,Sun.trace(a_array.join(&quot; - &quot;) // Displays Earth - Moon - Sun.trace(a_array.join(&quot; + &quot;) // Displays Earth + Moon + Sun.The following example creates a nested array that contains two arrays. The first array has three elements: Europa, Io, and Callisto. The second array has two elements: Titan and Rhea. It joins the array by using a plus sign (+), but the elements within each nested array remain separated by commas (,).var a_nested_array:Array = new Array([&quot;Europa&quot;, &quot;Io&quot;, &quot;Callisto&quot;], [&quot;Titan&quot;, &quot;Rhea&quot;]trace(a_nested_array.join(&quot; + &quot;)// Returns Europa,Io,Callisto + Titan,Rhea.See alsosplit (String.split method)" />
   <page href="00005067.html" title="length (Array.length property)" text="length (Array.length property)public length : NumberA non-negative integer specifying the number of elements in the array. This property is automatically updated when new elements are added to the array. When you assign a value to an array element (for example, my_array[index] = value), if index is a number, and index+1 is greater than the length property, the length property is updated to index+1. Note: If you assign a value to the length property that is shorter than the existing length, the array will be truncated.ExampleThe following code explains how the length property is updated. The initial length is 0, and then updated to 1, 2, and 10. If you assign a value to the length property that is shorter than the existing length, the array will be truncated: var my_array:Array = new Array(trace(my_array.length // initial length is 0my_array[0] = &quot;a&quot;;trace(my_array.length // my_array.length is updated to 1my_array[1] = &quot;b&quot;;trace(my_array.length // my_array.length is updated to 2my_array[9] = &quot;c&quot;;trace(my_array.length // my_array.length is updated to 10trace(my_array // displays: // a,b,undefined,undefined,undefined,undefined,undefined,undefined,undefined,c// if the length property is now set to 5, the array will be truncatedmy_array.length = 5; trace(my_array.length // my_array.length is updated to 5trace(my_array // outputs: a,b,undefined,undefined,undefined" />
   <page href="00005068.html" title="NUMERIC (Array.NUMERIC property)" text="NUMERIC (Array.NUMERIC property)public static NUMERIC : NumberRepresents numeric sorting instead of string-based sorting. String-based sorting, which is the default setting, treats numbers as strings when sorting them. For example, string-based sorting places 10 before 3. A numeric sort treats the elements as numbers so that 3 will be placed before 10. You can use this constant for the options parameter in the sort() or sortOn() method. The value of this constant is 16.See alsosort (Array.sort method), sortOn (Array.sortOn method)" />
   <page href="00005069.html" title="pop (Array.pop method)" text="pop (Array.pop method)public pop() : ObjectRemoves the last element from an array and returns the value of that element.ReturnsObject - The value of the last element in the specified array.ExampleThe following code creates the array myPets_array array containing four elements, and then removes its last element: var myPets_array:Array = new Array(&quot;cat&quot;, &quot;dog&quot;, &quot;bird&quot;, &quot;fish&quot;var popped:Object = myPets_array.pop(trace(popped // Displays fish.trace(myPets_array // Displays cat,dog,bird.See alsopush (Array.push method), shift (Array.shift method), unshift (Array.unshift method)" />
   <page href="00005070.html" title="push (Array.push method)" text="push (Array.push method)public push(value:Object) : NumberAdds one or more elements to the end of an array and returns the new length of the array.Parametersvalue:Object - One or more values to append to the array.ReturnsNumber - An integer representing the length of the new array.ExampleThe following example creates the array myPets_array with two elements, cat and dog. The second line adds two elements to the array. Because the push() method returns the new length of the array, the trace() statement in the last line sends the new length of myPets_array (4) to the Output panel.var myPets_array:Array = new Array(&quot;cat&quot;, &quot;dog&quot;var pushed:Number = myPets_array.push(&quot;bird&quot;, &quot;fish&quot;trace(pushed // Displays 4.See alsopop (Array.pop method), shift (Array.shift method), unshift (Array.unshift method)" />
   <page href="00005071.html" title="RETURNINDEXEDARRAY (Array.RETURNINDEXEDARRAY property)" text="RETURNINDEXEDARRAY (Array.RETURNINDEXEDARRAY property)public static RETURNINDEXEDARRAY : NumberRepresents the option to return an indexed array as a result of calling the sort() or sortOn() method. You can use this constant for the options parameter in the sort() or sortOn() method. This provides preview or copy functionality by returning an array that represents the results of the sort and leaves the original array unmodified. The value of this constant is 8.See alsosort (Array.sort method), sortOn (Array.sortOn method)" />
   <page href="00005072.html" title="reverse (Array.reverse method)" text="reverse (Array.reverse method)public reverse() : VoidReverses the array in place.ExampleThe following example uses this method to reverse the array numbers_array: var numbers_array:Array = new Array(1, 2, 3, 4, 5, 6trace(numbers_array // Displays 1,2,3,4,5,6.numbers_array.reverse(trace(numbers_array // Displays 6,5,4,3,2,1." />
   <page href="00005073.html" title="shift (Array.shift method)" text="shift (Array.shift method)public shift() : ObjectRemoves the first element from an array and returns that element.ReturnsObject - The first element in an array.ExampleThe following code creates the array myPets_array and then removes the first element from the array and assigns it to the variable shifted: var myPets_array:Array = new Array(&quot;cat&quot;, &quot;dog&quot;, &quot;bird&quot;, &quot;fish&quot;var shifted:Object = myPets_array.shift(trace(shifted // Displays &quot;cat&quot;.trace(myPets_array // Displays dog,bird,fish.See alsopop (Array.pop method), push (Array.push method), unshift (Array.unshift method)" />
   <page href="00005074.html" title="slice (Array.slice method)" text="slice (Array.slice method)public slice([startIndex:Number], [endIndex:Number]) : ArrayReturns a new array that consists of a range of elements from the original array, without modifying the original array. The returned array includes the startIndex element and all elements up to, but not including, the endIndex element. If you don&#39;t pass any parameters, a duplicate of the original array is created.ParametersstartIndex:Number [optional] - A number specifying the index of the starting point for the slice. If start is a negative number, the starting point begins at the end of the array, where -1 is the last element.endIndex:Number [optional] - A number specifying the index of the ending point for the slice. If you omit this parameter, the slice includes all elements from the starting point to the end of the array. If end is a negative number, the ending point is specified from the end of the array, where -1 is the last element.ReturnsArray - An array that consists of a range of elements from the original array.ExampleThe following example creates an array of five pets and uses slice() to populate a new array that contains only four-legged pets: var myPets_array:Array = new Array(&quot;cat&quot;, &quot;dog&quot;, &quot;fish&quot;, &quot;canary&quot;, &quot;parrot&quot;var myFourLeggedPets_array:Array = new Array(var myFourLeggedPets_array = myPets_array.slice(0, 2trace(myFourLeggedPets_array // Returns cat,dog.trace(myPets_array // Returns cat,dog,fish,canary,parrot.The following example creates an array of five pets, and then uses slice() with a negative start parameter to copy the last two elements from the array:var myPets_array:Array = new Array(&quot;cat&quot;, &quot;dog&quot;, &quot;fish&quot;, &quot;canary&quot;, &quot;parrot&quot;var myFlyingPets_array:Array = myPets_array.slice(-2trace(myFlyingPets_array // Traces canary,parrot.The following example creates an array of five pets and uses slice() with a negative end parameter to copy the middle element from the array:var myPets_array:Array = new Array(&quot;cat&quot;, &quot;dog&quot;, &quot;fish&quot;, &quot;canary&quot;, &quot;parrot&quot;var myAquaticPets_array:Array = myPets_array.slice(2,-2trace(myAquaticPets_array // Returns fish." />
   <page href="00005075.html" title="sort (Array.sort method)" text="sort (Array.sort method)public sort([compareFunction:Object], [options:Number]) : ArraySorts the elements in an array. Flash sorts according to Unicode values. (ASCII is a subset of Unicode.) By default, Array.sort() works as described in the following list:Sorting is case-sensitive (Z precedes a).Sorting is ascending (a precedes b). The array is modified to reflect the sort order; multiple elements that have identical sort fields are placed consecutively in the sorted array in no particular order.Numeric fields are sorted as if they were strings, so 100 precedes 99, because &quot;1&quot; is a lower string value than &quot;9&quot;.If you want to sort an array by using settings that deviate from the default settings, you can either use one of the sorting options described in the entry for the options parameter or you can create your own custom function to do the sorting. If you create a custom function, you can use it by calling the sort() method, using the name of your custom function as the first parameter (compareFunction). ParameterscompareFunction:Object [optional] - A comparison function used to determine the sorting order of elements in an array. Given the elements A and B, the result of compareFunction can have one of the following three values: -1, if A should appear before B in the sorted sequence0, if A equals B1, if A should appear after B in the sorted sequenceoptions:Number [optional] - One or more numbers or names of defined constants, separated by the | (bitwise OR) operator, that change the behavior of the sort from the default. The following values are acceptable for the options parameter: Array.CASEINSENSITIVE or 1Array.DESCENDING or 2Array.UNIQUESORT or 4Array.RETURNINDEXEDARRAY or 8Array.NUMERIC or 16 For more information about this parameter, see the Array.sortOn() method. Note: Array.sort() is defined in ECMA-262, but the array sorting options introduced in Flash Player 7 are Flash-specific extensions to the ECMA-262 specification.ReturnsArray - The return value depends on whether you pass any parameters, as described in the following list: If you specify a value of 4 or Array.UNIQUESORT for the options parameter and two or more elements being sorted have identical sort fields, Flash returns a value of 0 and does not modify the array. If you specify a value of 8 or Array.RETURNINDEXEDARRAY for the options parameter, Flash returns an array that reflects the results of the sort and does not modify the array. Otherwise, Flash returns nothing and modifies the array to reflect the sort order.ExampleUsage 1: The following example shows the use of Array.sort() with and without a value passed for options: var fruits_array:Array = new Array(&quot;oranges&quot;, &quot;apples&quot;, &quot;strawberries&quot;, &quot;pineapples&quot;, &quot;cherries&quot;trace(fruits_array // Displays oranges,apples,strawberries,pineapples,cherries.fruits_array.sort(trace(fruits_array // Displays apples,cherries,oranges,pineapples,strawberries.trace(fruits_array // Writes apples,cherries,oranges,pineapples,strawberries.fruits_array.sort(Array.DESCENDINGtrace(fruits_array // Displays strawberries,pineapples,oranges,cherries,apples.trace(fruits_array // Writes strawberries,pineapples,oranges,cherries,apples.Usage 2: The following example uses Array.sort() with a compare function. The entries are sorted in the form name:password. Sort using only the name part of the entry as a key:var passwords_array:Array = new Array(&quot;mom:glam&quot;, &quot;ana:ring&quot;, &quot;jay:mag&quot;, &quot;anne:home&quot;, &quot;regina:silly&quot;function order(a, b):Number { var name1:String = a.split(&quot;:&quot;)[0]; var name2:String = b.split(&quot;:&quot;)[0]; if (name1&lt;name2) { return -1; } else if (name1&gt;name2) { return 1; } else { return 0; }}trace(&quot;Unsorted:&quot;//Displays Unsorted:trace(passwords_array//Displays mom:glam,ana:ring,jay:mag,anne:home,regina:silly.//Writes mom:glam,ana:ring,jay:mag,anne:home,regina:sillypasswords_array.sort(ordertrace(&quot;Sorted:&quot;//Displays Sorted:trace(passwords_array//Displays ana:ring,anne:home,jay:mag,mom:glam,regina:silly.//Writes ana:ring,anne:home,jay:mag,mom:glam,regina:silly.See also| bitwise OR operator, sortOn (Array.sortOn method)" />
   <page href="00005076.html" title="sortOn (Array.sortOn method)" text="sortOn (Array.sortOn method)public sortOn(fieldName:Object, [options:Object]) : ArraySorts the elements in an array according to one or more fields in the array. The array should have the following characteristics: The array is an indexed array, not an associative array.Each element of the array holds an object with one or more properties.All of the objects have at least one property in common, the values of which can be used to sort the array. Such a property is called a field.If you pass multiple fieldName parameters, the first field represents the primary sort field, the second represents the next sort field, and so on. Flash sorts according to Unicode values. (ASCII is a subset of Unicode.) If either of the elements being compared does not contain the field specified in the fieldName parameter, the field is assumed to be undefined, and the elements are placed consecutively in the sorted array in no particular order.By default, Array.sortOn() works as described in the following list:Sorting is case-sensitive (Z precedes a).Sorting is ascending (a precedes b). The array is modified to reflect the sort order; multiple elements that have identical sort fields are placed consecutively in the sorted array in no particular order.Numeric fields are sorted as if they were strings, so 100 precedes 99, because &quot;1&quot; is a lower string value than &quot;9&quot;.You can use the options parameter to override the default sort behavior. If you want to sort a simple array (for example, an array with only one field), or if you want to specify a sort order that the options parameter doesn&#39;t support, use Array.sort().To pass multiple flags, separate them with the bitwise OR (|) operator:my_array.sortOn(someFieldName, Array.DESCENDING | Array.NUMERICParametersfieldName:Object - A string that identifies a field to be used as the sort value, or an array in which the first element represents the primary sort field, the second represents the secondary sort field, and so on.options:Object [optional] - One or more numbers or names of defined constants, separated by the | (bitwise OR) operator, that change the sorting behavior. The following values are acceptable for the options parameter: Array.CASEINSENSITIVE or 1Array.DESCENDING or 2Array.UNIQUESORT or 4Array.RETURNINDEXEDARRAY or 8Array.NUMERIC or 16Code hinting is enabled if you use the string form of the flag (for example, DESCENDING) rather than the numeric form (2).ReturnsArray - The return value depends on whether you pass any parameters, as described in the following list: If you specify a value of 4 or Array.UNIQUESORT for the options parameter, and two or more elements being sorted have identical sort fields, Flash returns a value of 0 and does not modify the array. If you specify a value of 8 or Array.RETURNINDEXEDARRAY for the options parameter, Flash returns an array that reflects the results of the sort and does not modify the array. Otherwise, Flash returns nothing and modifies the array to reflect the sort order.ExampleThe following example creates a new array and sorts it according to the name and city fields. The first sort uses name as the first sort value and city as the second. The second sort uses city as the first sort value and name as the second. var rec_array:Array = new Array(rec_array.push({name: &quot;john&quot;, city: &quot;omaha&quot;, zip: 68144}rec_array.push({name: &quot;john&quot;, city: &quot;kansas city&quot;, zip: 72345}rec_array.push({name: &quot;bob&quot;, city: &quot;omaha&quot;, zip: 94010}for(i=0; i&lt;rec_array.length; i++){ trace(rec_array[i].name + &quot;, &quot; + rec_array[i].city}// Results:// john, omaha// john, kansas city// bob, omaharec_array.sortOn([&quot;name&quot;, &quot;city&quot;]for(i=0; i&lt;rec_array.length; i++){ trace(rec_array[i].name + &quot;, &quot; + rec_array[i].city}// Results:// bob, omaha// john, kansas city// john, omaharec_array.sortOn([&quot;city&quot;, &quot;name&quot; ]for(i=0; i&lt;rec_array.length; i++){ trace(rec_array[i].name + &quot;, &quot; + rec_array[i].city}// Results:// john, kansas city// bob, omaha// john, omahaThe following array of objects is used by subsequent examples that show how to use the options parameter:var my_array:Array = new Array(my_array.push({password: &quot;Bob&quot;, age:29}my_array.push({password: &quot;abcd&quot;, age:3}my_array.push({password: &quot;barb&quot;, age:35}my_array.push({password: &quot;catchy&quot;, age:4}Performing a default sort on the password field produces the following results:my_array.sortOn(&quot;password&quot;// Bob// abcd// barb// catchyPerforming a case-insensitive sort on the password field produces the following results:my_array.sortOn(&quot;password&quot;, Array.CASEINSENSITIVE// abcd// barb// Bob// catchyPerforming a case-insensitive, descending sort on the password field produces the following results:my_array.sortOn(&quot;password&quot;, Array.CASEINSENSITIVE | Array.DESCENDING// catchy// Bob// barb// abcdPerforming a default sort on the age field produces the following results:my_array.sortOn(&quot;age&quot;// 29// 3// 35// 4Performing a numeric sort on the age field produces the following results:my_array.sortOn(&quot;age&quot;, Array.NUMERIC// my_array[0].age = 3// my_array[1].age = 4// my_array[2].age = 29// my_array[3].age = 35Performing a descending numeric sort on the age field produces the following results:my_array.sortOn(&quot;age&quot;, Array.DESCENDING | Array.NUMERIC// my_array[0].age = 35// my_array[1].age = 29// my_array[2].age = 4// my_array[3].age = 3When using the Array.RETURNEDINDEXARRAY sorting option, you must assign the return value to a different array. The original array is not modified.var indexArray:Array = my_array.sortOn(&quot;age&quot;, Array.RETURNINDEXEDARRAYSee also| bitwise OR operator, sort (Array.sort method)" />
   <page href="00005077.html" title="splice (Array.splice method)" text="splice (Array.splice method)public splice(startIndex:Number, [deleteCount:Number], [value:Object]) : ArrayAdds elements to and removes elements from an array. This method modifies the array without making a copy.ParametersstartIndex:Number - An integer that specifies the index of the element in the array where the insertion or deletion begins. You can specify a negative integer to specify a position relative to the end of the array (for example, -1 is the last element of the array).deleteCount:Number [optional] - An integer that specifies the number of elements to be deleted. This number includes the element specified in the startIndex parameter. If no value is specified for the deleteCount parameter, the method deletes all of the values from the startIndex element to the last element in the array. If the value is 0, no elements are deleted.value:Object [optional] - Specifies the values to insert into the array at the insertion point specified in the startIndex parameter.ReturnsArray - An array containing the elements that were removed from the original array.ExampleThe following example creates an array and splices it by using element index 1 for the startIndex parameter. This removes all elements from the array starting with the second element, leaving only the element at index 0 in the original array: var myPets_array:Array = new Array(&quot;cat&quot;, &quot;dog&quot;, &quot;bird&quot;, &quot;fish&quot;trace( myPets_array.splice(1) // Displays dog,bird,fish.trace( myPets_array // catThe following example creates an array and splices it by using element index 1 for the startIndex parameter and the number 2 for the deleteCount parameter. This removes two elements from the array, starting with the second element, leaving the first and last elements in the original array:var myFlowers_array:Array = new Array(&quot;roses&quot;, &quot;tulips&quot;, &quot;lilies&quot;, &quot;orchids&quot;trace( myFlowers_array.splice(1,2 ) // Displays tulips,lilies.trace( myFlowers_array // roses,orchidsThe following example creates an array and splices it by using element index 1 for the startIndex parameter, the number 0 for the deleteCount parameter, and the string chair for the value parameter. This does not remove anything from the original array, and adds the string chair at index 1:var myFurniture_array:Array = new Array(&quot;couch&quot;, &quot;bed&quot;, &quot;desk&quot;, &quot;lamp&quot;trace( myFurniture_array.splice(1,0, &quot;chair&quot; ) // Displays empty array. trace( myFurniture_array // displays couch,chair,bed,desk,lamp" />
   <page href="00005078.html" title="toString (Array.toString method)" text="toString (Array.toString method)public toString() : StringReturns a string value representing the elements in the specified Array object. Every element in the array, starting with index 0 and ending with the highest index, is converted to a concatenated string and separated by commas. To specify a custom separator, use the Array.join() method.ReturnsString - A string.ExampleThe following example creates my_array and converts it to a string. var my_array:Array = new Array(my_array[0] = 1;my_array[1] = 2;my_array[2] = 3;my_array[3] = 4;my_array[4] = 5;trace(my_array.toString() // Displays 1,2,3,4,5.This example outputs 1,2,3,4,5 as a result of the trace statement.See alsosplit (String.split method), join (Array.join method)" />
   <page href="00005079.html" title="UNIQUESORT (Array.UNIQUESORT property)" text="UNIQUESORT (Array.UNIQUESORT property)public static UNIQUESORT : NumberRepresents the unique sorting requirement. You can use this constant for the options parameter in the sort() or sortOn() method. The unique sorting option aborts the sort if any two elements or fields being sorted have identical values. The value of this constant is 4.See alsosort (Array.sort method), sortOn (Array.sortOn method)" />
   <page href="00005080.html" title="unshift (Array.unshift method)" text="unshift (Array.unshift method)public unshift(value:Object) : NumberAdds one or more elements to the beginning of an array and returns the new length of the array.Parametersvalue:Object - One or more numbers, elements, or variables to be inserted at the beginning of the array.ReturnsNumber - An integer representing the new length of the array.ExampleThe following example shows the use of the Array.unshift() method: var pets_array:Array = new Array(&quot;dog&quot;, &quot;cat&quot;, &quot;fish&quot;trace( pets_array // Displays dog,cat,fish.pets_array.unshift(&quot;ferrets&quot;, &quot;gophers&quot;, &quot;engineers&quot;trace( pets_array // Displays ferrets,gophers,engineers,dog,cat,fish.See alsopop (Array.pop method), push (Array.push method), shift (Array.shift method)" />
   <page href="00005081.html" title="Boolean" text="constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)SignatureDescriptionBoolean([value:Object])Creates a Boolean object.ModifiersSignatureDescriptiontoString() : StringReturns the string representation (&quot;true&quot; or &quot;false&quot;) of the Boolean object.valueOf() : BooleanReturns true if the primitive value type of the specified Boolean object is true; false otherwise.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)BooleanObject | +-Booleanpublic class Booleanextends ObjectThe Boolean class is a wrapper object with the same functionality as the standard JavaScript Boolean object. Use the Boolean class to retrieve the primitive data type or string representation of a Boolean object. You must use the constructor new Boolean() to create a Boolean object before calling its methods.Property summaryProperties inherited from class ObjectConstructor summaryMethod summaryMethods inherited from class Object" />
   <page href="00005082.html" title="Boolean constructor" text="Boolean constructorpublic Boolean([value:Object])Creates a Boolean object. If you omit the value parameter, the Boolean object is initialized with a value of false. If you specify a value for the value parameter, the method evaluates it and returns the result as a Boolean value according to the rules in the global Boolean() function.Parametersvalue:Object [optional] - Any expression. The default value is false.ExampleThe following code creates a new empty Boolean object called myBoolean: var myBoolean:Boolean = new Boolean(" />
   <page href="00005083.html" title="toString (Boolean.toString method)" text="toString (Boolean.toString method)public toString() : StringReturns the string representation (&quot;true&quot; or &quot;false&quot;) of the Boolean object.ReturnsString - A string; &quot;true&quot; or &quot;false&quot;.ExampleThis example creates a variable of type Boolean and uses toString() to convert the value to a string for use in the trace statement: var myBool:Boolean = true;trace(&quot;The value of the Boolean myBool is: &quot; + myBool.toString()myBool = false;trace(&quot;The value of the Boolean myBool is: &quot; + myBool.toString()" />
   <page href="00005084.html" title="valueOf (Boolean.valueOf method)" text="valueOf (Boolean.valueOf method)public valueOf() : BooleanReturns true if the primitive value type of the specified Boolean object is true; false otherwise.ReturnsBoolean - A Boolean value.ExampleThe following example shows how this method works, and also shows that the primitive value type of a new Boolean object is false: var x:Boolean = new Boolean(trace(x.valueOf() // falsex = (6==3+3trace(x.valueOf() // true " />
   <page href="00005085.html" title="Button" text="ModifiersPropertyDescription_alpha:NumberThe alpha transparency value of the button specified by my_btn.enabled:BooleanA Boolean value that specifies whether a button is enabled._focusrect:BooleanA Boolean value that specifies whether a button has a yellow rectangle around it when it has input focus._height:NumberThe height of the button, in pixels._highquality:NumberDeprecated since Flash Player 7. This property was deprecated in favor of Button._quality.Specifies the level of anti-aliasing applied to the current SWF file._name:StringInstance name of the button specified by my_btn._parent:MovieClipA reference to the movie clip or object that contains the current movie clip or object._quality:StringProperty (global sets or retrieves the rendering quality used for a SWF file._rotation:NumberThe rotation of the button, in degrees, from its original orientation._soundbuftime:NumberSpecifies the number of seconds a sound prebuffers before it starts to stream.tabEnabled:BooleanSpecifies whether my_btn is included in automatic tab ordering.tabIndex:NumberLets you customize the tab ordering of objects in a SWF file._target:String [read-only]Returns the target path of the button instance specified by my_btn.trackAsMenu:BooleanA Boolean value that indicates whether other buttons or movie clips can receive a release event from a mouse or stylus._url:String [read-only]Retrieves the URL of the SWF file that created the button._visible:BooleanA Boolean value that indicates whether the button specified by my_btn is visible._width:NumberThe width of the button, in pixels._x:NumberAn integer that sets the x coordinate of a button relative to the local coordinates of the parent movie clip._xmouse:Number [read-only]Returns the x hasMouse is true relative to the button._xscale:NumberThe horizontal scale of the button as applied from the registration point of the button, expressed as a percentage._y:NumberThe y coordinate of the button relative to the local coordinates of the parent movie clip._ymouse:Number [read-only]Returns the y coordinate of the mouse position relative to the button._yscale:NumberThe vertical scale of the button as applied from the registration point of the button, expressed as a percentage.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)EventDescriptiononDragOut = function() {}Invoked when the user presses the mouse button over the button and then drags the pointer outside of the button.onDragOver = function() {}Invoked when the user presses the mouse button outside of the button and then drags the pointer over the button.onKeyDown = function() {}Invoked when a button has keyboard focus and a key is pressed.onKeyUp = function() {}Invoked when a button has input focus and a key is released.onKillFocus = function(newFocus:Object) {}Invoked when a button loses keyboard focus.onPress = function() {}Invoked when a button is pressed.onRelease = function() {}Invoked when a button is released.onReleaseOutside = function() {}Invoked when the mouse is released with the pointer outside the button after the mouse button is pressed with the pointer inside the button.onRollOut = function() {}Invoked when the button loses focus.onRollOver = function() {}Invoked when the button gains focus.onSetFocus = function(oldFocus:Object) {}Invoked when a button receives keyboard focus.ModifiersSignatureDescriptiongetDepth() : NumberReturns the depth of the button instance.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)ButtonObject | +-Buttonpublic class Buttonextends ObjectAll button symbols in a SWF file are instances of the Button object. You can give a button an instance name in the Property inspector, and use the methods and properties of the Button class to manipulate buttons with ActionScript. Button instance names are displayed in the Movie Explorer and in the Insert Target Path dialog box in the Actions panel. The Button class inherits from the Object class. See alsoObjectProperty summaryProperties inherited from class ObjectEvent summaryMethod summaryMethods inherited from class Object" />
   <page href="00005086.html" title="_alpha (Button._alpha property)" text="_alpha (Button._alpha property)public _alpha : NumberThe alpha transparency value of the button specified by my_btn. Valid values are 0 (fully transparent) to 100 (fully opaque). The default value is 100. Objects in a button with _alpha set to 0 are active, even though they are invisible.ExampleThe following code sets the _alpha property of a button named myBtn_btn to 50% when the user clicks the button. First, add a Button instance on the Stage. Second, give it an instance name of myBtn_btn. Lastly, with frame 1 selected, place the following code into the Actions panel: myBtn_btn.onRelease = function(){ this._alpha = 50;};See also_alpha (MovieClip._alpha property), _alpha (TextField._alpha property)" />
   <page href="00005087.html" title="enabled (Button.enabled property)" text="enabled (Button.enabled property)public enabled : BooleanA Boolean value that specifies whether a button is enabled. When a button is disabled (the enabled property is set to false), the button is visible but cannot be clicked. The default value is true. This property is useful if you want to disable part of your navigation; for example, you may want to disable a button in the currently displayed page so that it can&#39;t be clicked and the page cannot be reloaded.ExampleThe following example demonstrates how you can disable and enable buttons from being clicked. Two buttons, myBtn1_btn and myBtn2_btn, are on the Stage and the following ActionScript is added so that the myBtn2_btn button cannot be clicked. First, add two button instances on the Stage. Second, give them instance names of myBtn1_btn and myBtn2_btn. Lastly, place the following code on frame 1 to enable or disable buttons. myBtn1_btn.enabled = true;myBtn2_btn.enabled = false;//button code// the following function will not get called // because myBtn2_btn.enabled was set to falsemyBtn1_btn.onRelease = function() { trace( &quot;you clicked : &quot; + this._name };myBtn2_btn.onRelease = function() { trace( &quot;you clicked : &quot; + this._name };" />
   <page href="00005088.html" title="_focusrect (Button._focusrect property)" text="_focusrect (Button._focusrect property)public _focusrect : BooleanA Boolean value that specifies whether a button has a yellow rectangle around it when it has input focus. This property can override the global _focusrect property. By default, the _focusrect property of a button instance is null; the button instance does not override the global _focusrect property. If the _focusrect property of a button instance is set to true or false, it overrides the setting of the global _focusrect property for the single button instance. In Flash Player 4 and Flash Player 5 SWF files, the _focusrect property controls the global _focusrect property. It is a Boolean value. This behavior was changed in Flash Player 6 and later to permit customizing the _focusrect property on an individual movie clip. If the _focusrect property is set to false, then keyboard navigation for that button is limited to the Tab key. All other keys, including the Enter and arrow keys, are ignored. To restore full keyboard navigation, you must set _focusrect to true.Note: For the Flash Lite 2.0 player, when the _focusrect property is disabled (in other words, Button.focusRect is false), the button receives all events. This behavior is different from Flash Player behavior because when the _focusrect property is disabled, the button receives the rollOver and rollOut events but does not receive the press and release events.Also for Flash Lite 2.0, you can change the color of the focus rectangle using the fscommand2 SetFocusRectColor command. This behavior is also different from Flash Player, for which the color of the focus rectangle is restricted to yellow.ExampleThis example demonstrates how to hide the yellow rectangle around a specified button instance in a SWF file when it has focus in a browser window. Create three buttons called myBtn1_btn, myBtn2_btn, and myBtn3_btn, and add the following ActionScript to Frame 1 of the Timeline: myBtn2_btn._focusrect = false;Make sure that you disable keyboard shortcuts when you test the SWF file by selecting Control &gt; Disable Keyboard Shortcuts in the test environment.When _focusrect is disabled, you cannot execute code for this button by pressing Enter or the Spacebar." />
   <page href="00005089.html" title="getDepth (Button.getDepth method)" text="getDepth (Button.getDepth method)public getDepth() : NumberReturns the depth of the button instance. Each movie clip, button, and text field has a unique depth associated with it that determines how the object appears in front of or in back of other objects. Objects with higher depths appear in front.ReturnsNumber - The depth of the button instance.ExampleIf you create myBtn1_btn and myBtn2_btn on the Stage, you can trace their depth using the following ActionScript: trace(myBtn1_btn.getDepth()trace(myBtn2_btn.getDepth()If you load a SWF file called buttonMovie.swf into this document, you could trace the depth of a button, myBtn4_btn, inside that SWF file using another button in the main SWF:this.createEmptyMovieClip(&quot;myClip_mc&quot;, 999myClip_mc.loadMovie(&quot;buttonMovie.swf&quot;myBtn3_btn.onRelease = function(){ trace(myClip_mc.myBtn4_btn.getDepth()};You might notice that two of these buttons have the same depth value, one in the main SWF file and one in the loaded SWF file. This is misleading, because buttonMovie.swf was loaded at depth 999, which means that the button it contains will also have a depth of 999 relative to the buttons in the main SWF file. Keep in mind that each movie clip has its own internal z-order, which means that each movie clip has its own set of depth values. The two buttons may have the same depth value, but the values only have meaning in relation to other objects in the same z-order. In this case, the buttons have the same depth value, but the values relate to different movie clips: the depth value of the button in the main SWF file relates to the z-order of the main Timeline, while the depth value of the button in the loaded SWF file relates to the internal z-order of the myClip_mc movie clip.See alsogetDepth (MovieClip.getDepth method), getDepth (TextField.getDepth method), getInstanceAtDepth (MovieClip.getInstanceAtDepth method)" />
   <page href="00005090.html" title="_height (Button._height property)" text="_height (Button._height property)public _height : NumberThe height of the button, in pixels.ExampleThe following example sets the height and width of a button called my_btn to a specified width and height. my_btn._width = 500;my_btn._height = 200;" />
   <page href="00005091.html" title="_highquality (Button._highquality property)" text="_highquality (Button._highquality property)public _highquality : NumberDeprecated since Flash Player 7. This property was deprecated in favor of Button._quality.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.ExampleAdd 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 circle&#39;s stroke will look jagged. You could add the following ActionScript instead to affect the SWF globally: _quality = 0;See also_quality (Button._quality property), _quality property" />
   <page href="00005092.html" title="_name (Button._name property)" text="_name (Button._name property)public _name : StringInstance name of the button specified by my_btn.ExampleThe following example traces all instance names of any Button instances within the current Timeline of a SWF file. for (i in this) { if (this[i] instanceof Button) { trace(this[i]._name }}" />
   <page href="00005093.html" title="onDragOut (Button.onDragOut handler)" text="onDragOut (Button.onDragOut handler)onDragOut = function() {}Invoked when the user presses the mouse button over the button and then drags the pointer outside of the button. You must define a function that is executed when the event handler is invoked. Note: The onDragOut Event Handler is supported for Flash Lite 2.0 only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example demonstrates how you can execute statements when the pointer is dragged off a button. Create a button called my_btn on the Stage and enter the following ActionScript in a frame on the Timeline: my_btn.onDragOut = function() { trace(&quot;onDragOut: &quot;+this._name};my_btn.onDragOver = function() { trace(&quot;onDragOver: &quot;+this._name};" />
   <page href="00005094.html" title="onDragOver (Button.onDragOver handler)" text="onDragOver (Button.onDragOver handler)onDragOver = function() {}Invoked when the user presses the mouse button outside of the button and then drags the pointer over the button. You must define a function that is executed when the event handler is invoked. Note: The onDragOver Event Handler is supported for Flash Lite 2.0 only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example defines a function for the onDragOver handler that sends a trace() statement to the Output panel. Create a button called my_btn on the Stage and enter the following ActionScript on the Timeline: my_btn.onDragOut = function() { trace(&quot;onDragOut: &quot;+this._name};my_btn.onDragOver = function() { trace(&quot;onDragOver: &quot;+this._name};When you test the SWF file, drag the pointer off the button instance. Then, while pressing the mouse button, drag onto the button instance again. Notice that the Output panel tracks your movements.See alsoonDragOut (Button.onDragOut handler)" />
   <page href="00005095.html" title="onKeyDown (Button.onKeyDown handler)" text="onKeyDown (Button.onKeyDown handler)onKeyDown = function() {}Invoked when a button has keyboard focus and a key is pressed. The onKeyDown event handler is invoked with no parameters. You can use the Key.getAscii() and Key.getCode() methods to determine which key was pressed. You must define a function that is executed when the event handler is invoked.ExampleIn the following example, a function that sends text to the Output panel is defined for the onKeyDown handler. Create a button called my_btn on the Stage, and enter the following ActionScript in a frame on the Timeline: my_btn.onKeyDown = function() { trace(&quot;onKeyDown: &quot;+this._name+&quot; (Key: &quot;+getKeyPressed()+&quot;)&quot;};function getKeyPressed():String { var theKey:String; switch (Key.getAscii()) { case Key.BACKSPACE : theKey = &quot;BACKSPACE&quot;; break; case Key.SPACE : theKey = &quot;SPACE&quot;; break; default : theKey = chr(Key.getAscii() } return theKey;}Select Control &gt; Test Movie to test the SWF file. Make sure you select Control &gt; Disable Keyboard Shortcuts in the test environment. Then press the Tab key until the button has focus (a yellow rectangle appears around the my_btn instance) and start pressing keys on your keyboard. When you press keys, they are displayed in the Output panel.See alsoonKeyUp (Button.onKeyUp handler), getAscii (Key.getAscii method), getCode (Key.getCode method)" />
   <page href="00005096.html" title="onKeyUp (Button.onKeyUp handler)" text="onKeyUp (Button.onKeyUp handler)onKeyUp = function() {}Invoked when a button has input focus and a key is released. The onKeyUp event handler is invoked with no parameters. You can use the Key.getAscii() and Key.getCode() methods to determine which key was pressed.ExampleIn the following example, a function that sends text to the Output panel is defined for the onKeyDown handler. Create a button called my_btn on the Stage, and enter the following ActionScript in a frame on the Timeline: my_btn.onKeyDown = function() { trace(&quot;onKeyDown: &quot;+this._name+&quot; (Key: &quot;+getKeyPressed()+&quot;)&quot;};my_btn.onKeyUp = function() { trace(&quot;onKeyUp: &quot;+this._name+&quot; (Key: &quot;+getKeyPressed()+&quot;)&quot;};function getKeyPressed():String { var theKey:String; switch (Key.getAscii()) { case Key.BACKSPACE : theKey = &quot;BACKSPACE&quot;; break; case Key.SPACE : theKey = &quot;SPACE&quot;; break; default : theKey = chr(Key.getAscii() } return theKey;}Press Control+Enter to test the SWF file. Make sure you select Control &gt; Disable Keyboard Shortcuts in the test environment. Then press the Tab key until the button has focus (a yellow rectangle appears around the my_btn instance) and start pressing keys on your keyboard. When you press keys, they are displayed in the Output panel.See alsoonKeyDown (Button.onKeyDown handler), getAscii (Key.getAscii method), getCode (Key.getCode method)" />
   <page href="00005097.html" title="onKillFocus (Button.onKillFocus handler)" text="onKillFocus (Button.onKillFocus handler)onKillFocus = function(newFocus:Object) {}Invoked when a button loses keyboard focus. The onKillFocus handler receives one parameter, newFocus, which is an object representing the new object receiving the focus. If no object receives the focus, newFocus contains the value null.ParametersnewFocus:Object - The object that is receiving the focus.ExampleThe following example demonstrates how statements can be executed when a button loses focus. Create a button instance on the Stage called my_btn and add the following ActionScript to Frame 1 of the Timeline: this.createTextField(&quot;output_txt&quot;, this.getNextHighestDepth(), 0, 0, 300, 200output_txt.wordWrap = true;output_txt.multiline = true;output_txt.border = true;my_btn.onKillFocus = function() { output_txt.text = &quot;onKillFocus: &quot;+this._name+newline+output_txt.text;};Test the SWF file in a browser window, and try using the Tab key to move through the elements in the window. When the button instance loses focus, text is sent to the output_txt text field." />
   <page href="00005098.html" title="onPress (Button.onPress handler)" text="onPress (Button.onPress handler)onPress = function() {}Invoked when a button is pressed. You must define a function that is executed when the event handler is invoked.ExampleIn the following example, a function that sends a trace() statement to the Output panel is defined for the onPress handler: my_btn.onPress = function () { trace (&quot;onPress called&quot;};" />
   <page href="00005099.html" title="onRelease (Button.onRelease handler)" text="onRelease (Button.onRelease handler)onRelease = function() {}Invoked when a button is released. You must define a function that is executed when the event handler is invoked.ExampleIn the following example, a function that sends a trace() statement to the Output panel is defined for the onRelease handler: my_btn.onRelease = function () { trace (&quot;onRelease called&quot;};" />
   <page href="00005100.html" title="onReleaseOutside (Button.onReleaseOutside handler)" text="onReleaseOutside (Button.onReleaseOutside handler)onReleaseOutside = function() {}Invoked when the mouse is released with the pointer outside the button after the mouse button is pressed with the pointer inside the button. You must define a function that is executed when the event handler is invoked. Note: The onReleaseOutside Event Handler is supported for Flash Lite 2.0 only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleIn the following example, a function that sends a trace() statement to the Output panel is defined for the onReleaseOutside handler: my_btn.onReleaseOutside = function () { trace (&quot;onReleaseOutside called&quot;};" />
   <page href="00005101.html" title="onRollOut (Button.onRollOut handler)" text="onRollOut (Button.onRollOut handler)onRollOut = function() {}Invoked when the button loses focus. This can happen when the user clicks another button or area outside of the currently selected button. You must define a function that is executed when the event handler is invoked.ExampleIn the following example, a function that sends a trace() statement to the Output panel is defined for the onRollOut handler: my_btn.onRollOut = function () { trace (&quot;onRollOut called&quot;};" />
   <page href="00005102.html" title="onRollOver (Button.onRollOver handler)" text="onRollOver (Button.onRollOver handler)onRollOver = function() {}Invoked when the button gains focus. This can happen when the user clicks another button outside of the currently selected button. Invoked when the pointer moves over a button area. You must define a function that is executed when the event handler is invoked.ExampleIn the following example, a function that sends a trace() statement to the Output panel is defined for the onRollOver handler: my_btn.onRollOver = function () { trace (&quot;onRollOver called&quot;};" />
   <page href="00005103.html" title="onSetFocus (Button.onSetFocus handler)" text="onSetFocus (Button.onSetFocus handler)onSetFocus = function(oldFocus:Object) {}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.ParametersoldFocus:Object - The object to lose keyboard focus.ExampleThe following example demonstrates how you can execute statements when the user of a SWF file moves focus from one button to another. Create two buttons, btn1_btn and btn2_btn, and enter the following ActionScript in Frame 1 of the Timeline: Selection.setFocus(btn1_btntrace(Selection.getFocus()btn2_btn.onSetFocus = function(oldFocus) { trace(oldFocus._name + &quot;lost focus&quot;};Test the SWF file by pressing Control+Enter. Make sure you select Control &gt; Disable Keyboard Shortcuts if it is not already selected. Focus is set on btn1_btn. When btn1_btn loses focus and btn2_btn gains focus, information is displayed in the Output panel." />
   <page href="00005104.html" title="_parent (Button._parent property)" text="_parent (Button._parent property)public _parent : MovieClipA 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 move up multiple levels in the display list as in the following:this._parent._parent._alpha = 20;ExampleIn the following example, a button named my_btn is placed inside a movie clip called my_mc. The following code shows how to use the _parent property to get a reference to the movie clip my_mc: trace(my_mc.my_btn._parentThe Output panel displays the following:_level0.my_mcSee also_parent (MovieClip._parent property), _target (MovieClip._target property), _root property" />
   <page href="00005105.html" title="_quality (Button._quality property)" text="_quality (Button._quality property)public _quality : StringProperty (global sets or retrieves the rendering quality used for a SWF file. Device fonts are always aliased and therefore are unaffected by the _quality property. The _quality property can be set to the following values:&quot;LOW&quot; Low rendering quality. Graphics are not anti-aliased, and bitmaps are not smoothed.&quot;MEDIUM&quot; Medium rendering quality. Graphics are anti-aliased using a 2 x 2 pixel grid, but bitmaps are not smoothed. This is suitable for movies that do not contain text.&quot;HIGH&quot; High rendering quality. Graphics are anti-aliased using a 4 x 4 pixel grid, and bitmaps are smoothed if the movie is static. This is the default rendering quality setting used by Flash.Note: Although you can specify this property for a Button object, it is actually a global property, and you can specify its value simply as _quality. ExampleThis example sets the rendering quality of a button named my_btn to LOW: my_btn._quality = &quot;LOW&quot;;" />
   <page href="00005106.html" title="_rotation (Button._rotation property)" text="_rotation (Button._rotation property)public _rotation : NumberThe rotation of the button, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement my_btn._rotation = 450 is the same as my_btn._rotation = 90.ExampleThe following example rotates two buttons on the Stage. Create two buttons on the Stage called control_btn and my_btn. Make sure that my_btn is not perfectly round, so you can see it rotating. Then enter the following ActionScript in Frame 1 of the Timeline: var control_btn:Button;var my_btn:Button;control_btn.onRelease = function() { my_btn._rotation += 10;};Now create another button on the Stage called myOther_btn, making sure it isn't perfectly round (so you can see it rotate). Enter the following ActionScript in Frame 1 of the Timeline.var myOther_btn:Button;this.createEmptyMovieClip(&quot;rotater_mc&quot;, this.getNextHighestDepth()rotater_mc.onEnterFrame = function() { myOther_btn._rotation += 2;};See also_rotation (MovieClip._rotation property), _rotation (TextField._rotation property)" />
   <page href="00005107.html" title="_soundbuftime (Button._soundbuftime property)" text="_soundbuftime (Button._soundbuftime property)public _soundbuftime : NumberSpecifies the number of seconds a sound prebuffers before it starts to stream. Note: Although you can specify this property for a Button object, it is actually a global property that applies to all sounds loaded, and you can specify its value simply as _soundbuftime. Setting this property for a Button object actually sets the global property.For more information and an example, see _soundbuftime.See also_soundbuftime property" />
   <page href="00005108.html" title="tabEnabled (Button.tabEnabled property)" text="tabEnabled (Button.tabEnabled property)public tabEnabled : BooleanSpecifies whether my_btn is included in automatic tab ordering. It is undefined by default. If the tabEnabled property is undefined or true, the object is included in automatic tab ordering. If the tabIndex property is also set to a value, the object is included in custom tab ordering as well. If tabEnabled is false, the object is not included in automatic or custom tab ordering, even if the tabIndex property is set.ExampleThe following ActionScript is used to set the tabEnabled property for one of four buttons to false. However, all four buttons (one_btn, two_btn, three_btn, and four_btn) are placed in a custom tab order using tabIndex. Although tabIndex is set for three_btn, three_btn is not included in a custom or automatic tab order because tabEnabled is set to false for that instance. To set the tab ordering for the four buttons, add the following ActionScript to Frame 1 of the Timeline: three_btn.tabEnabled = false;two_btn.tabIndex = 1;four_btn.tabIndex = 2;three_btn.tabIndex = 3;one_btn.tabIndex = 4;Make sure that you disable keyboard shortcuts when you test the SWF file by selecting Control &gt; Disable Keyboard Shortcuts in the test environment.See alsotabIndex (Button.tabIndex property), tabEnabled (MovieClip.tabEnabled property), tabEnabled (TextField.tabEnabled property)" />
   <page href="00005109.html" title="tabIndex (Button.tabIndex property)" text="tabIndex (Button.tabIndex property)public tabIndex : NumberLets you customize the tab ordering of objects in a SWF file. You can set the tabIndex property on a button, movie clip, or text field instance; it is undefined by default. If any currently displayed object in the SWF file contains a tabIndex property, automatic tab ordering is disabled, and the tab ordering is calculated from the tabIndex properties of objects in the SWF file. The custom tab ordering only includes objects that have tabIndex properties.The tabIndex property may be a non-negative integer. The objects are ordered according to their tabIndex properties, in ascending order. An object with a tabIndex value of 1 precedes an object with a tabIndex value of 2. If two objects have the same tabIndex value, the one that precedes the other in the tab ordering is undefined.The custom tab ordering defined by the tabIndex property is flat. This means that no attention is paid to the hierarchical relationships of objects in the SWF file. All objects in the SWF file with tabIndex properties are placed in the tab order, and the tab order is determined by the order of the tabIndex values. If two objects have the same tabIndex value, the one that goes first is undefined. You shouldn't use the same tabIndex value for multiple objects.ExampleThe following ActionScript is used to set the tabEnabled property for one of four buttons to false. However, all four buttons (one_btn, two_btn, three_btn, and four_btn) are placed in a custom tab order using tabIndex. Although tabIndex is set for three_btn, three_btn is not included in a custom or automatic tab order because tabEnabled is set to false for that instance. To set the tab ordering for the four buttons, add the following ActionScript to Frame 1 of the Timeline: three_btn.tabEnabled = false;two_btn.tabIndex = 1;four_btn.tabIndex = 2;three_btn.tabIndex = 3;one_btn.tabIndex = 4;Make sure that you disable keyboard shortcuts when you test the SWF file by selecting Control &gt; Disable Keyboard Shortcuts in the test environment.See alsotabEnabled (Button.tabEnabled property), tabChildren (MovieClip.tabChildren property), tabEnabled (MovieClip.tabEnabled property), tabIndex (MovieClip.tabIndex property), tabIndex (TextField.tabIndex property)" />
   <page href="00005110.html" title="_target (Button._target property)" text="_target (Button._target property)public _target : String [read-only]Returns the target path of the button instance specified by my_btn.ExampleAdd a button instance to the Stage with an instance name my_btn and add the following code to Frame 1 of the Timeline: trace(my_btn._target //displays /my_btnSelect my_btn and convert it to a movie clip. Give the new movie clip an instance name my_mc. Delete the existing ActionScript in Frame 1 of the Timeline and replace it with:my_mc.my_btn.onRelease = function(){ trace(this._target //displays /my_mc/my_btn};To convert the notation from slash notation to dot notation, modify the previous code example to the following:my_mc.my_btn.onRelease = function(){ trace(eval(this._target) //displays _level0.my_mc.my_btn};This lets you access methods and parameters of the target object, such as:my_mc.my_btn.onRelease = function(){ var target_btn:Button = eval(this._targettrace(target_btn._name //displays my_btn};See also_target (MovieClip._target property)" />
   <page href="00005111.html" title="trackAsMenu (Button.trackAsMenu property)" text="trackAsMenu (Button.trackAsMenu property)public trackAsMenu : BooleanA Boolean value that indicates whether other buttons or movie clips can receive a release event from a mouse or stylus. If you drag a stylus or mouse pointer across a button and then release it on a second button, the onRelease event is registered for the second button. This allows you to create menus for the second button. You can set the trackAsMenu property on any button or movie clip object. If you have not defined the trackAsMenu property, the default behavior is false. You can change the trackAsMenu property at any time; the modified button immediately takes on the new behavior. Note: The trackAsMenu property is supported for Flash Lite 2.0 only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example demonstrates how to track two buttons as a menu. Place two button instances called one_btn and two_btn on the stage. Enter the following ActionScript in the Timeline: var one_btn:Button;var two_btn:Button;one_btn.trackAsMenu = true;two_btn.trackAsMenu = trueone_btn.onRelease = function() { trace(&quot;clicked one_btn&quot;};two_btn.onRelease = function() { trace(&quot;clicked two_btn&quot;};To test the SWF file, click the Stage over one_btn, hold the mouse button down, and release it over two_btn. Then try commenting out the two lines of ActionScript that contain trackAsMenu and test the SWF file again to see the difference in button behavior.See alsotrackAsMenu (MovieClip.trackAsMenu property)" />
   <page href="00005112.html" title="_url (Button._url property)" text="_url (Button._url property)public _url : String [read-only]Retrieves the URL of the SWF file that created the button.ExampleCreate two button instances on the Stage called one_btn and two_btn. Enter the following ActionScript in Frame 1 of the Timeline: var one_btn:Button;var two_btn:Button;this.createTextField(&quot;output_txt&quot;, 999, 0, 0, 100, 22output_txt.autoSize = true;one_btn.onRelease = function() { trace(&quot;clicked one_btn&quot; trace(this._url};two_btn.onRelease = function() { trace(&quot;clicked &quot;+this._name var url_array:Array = this._url.split(&quot;/&quot; var my_str:String = String(url_array.pop() output_txt.text = unescape(my_str};When you click each button, the file name of the SWF containing the buttons displays in the Output panel." />
   <page href="00005113.html" title="_visible (Button._visible property)" text="_visible (Button._visible property)public _visible : BooleanA Boolean value that indicates whether the button specified by my_btn is visible. Buttons that are not visible (_visible property set to false) are disabled.ExampleCreate two buttons on the Stage with the instance names myBtn1_btn and myBtn2_btn. Enter the following ActionScript in Frame 1 of the Timeline: myBtn1_btn.onRelease = function() { this._visible = false; trace(&quot;clicked &quot;+this._name};myBtn2_btn.onRelease = function() { this._alpha = 0; trace(&quot;clicked &quot;+this._name};Notice how you can still click myBtn2_btn after the alpha is set to 0.See also_visible (MovieClip._visible property), _visible (TextField._visible property)" />
   <page href="00005114.html" title="_width (Button._width property)" text="_width (Button._width property)public _width : NumberThe width of the button, in pixels.ExampleThe following example increases the width property of a button called my_btn, and displays the width in the Output panel. Enter the following ActionScript in Frame 1 of the Timeline: my_btn.onRelease = function() { trace(this._width this._width ~= 1.1;};See also_width (MovieClip._width property)" />
   <page href="00005115.html" title="_x (Button._x property)" text="_x (Button._x property)public _x : NumberAn integer that sets the x coordinate of a button relative to the local coordinates of the parent movie clip. If a button is on the main Timeline, then its coordinate system refers to the upper left corner of the Stage as (0, 0). If the button is inside a 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 button&#39;s coordinates refer to the registration point position.ExampleThe following example sets the coordinates of my_btn to 0 on the Stage. Create a button called my_btn and enter the following ActionScript in Frame 1 of the Timeline: my_btn._x = 0;my_btn._y = 0;See also_xscale (Button._xscale property), _y (Button._y property), _yscale (Button._yscale property)" />
   <page href="00005116.html" title="_xmouse (Button._xmouse property)" text="_xmouse (Button._xmouse property)public _xmouse : Number [read-only]Returns the x hasMouse is true relative to the button. Note: The _xmouse property is supported for Flash Lite 2.0 only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example displays the x coordinate of the mouse position for the Stage and a button called my_btn that is placed on the Stage. Enter the following ActionScript in Frame 1 of the Timeline: this.createTextField(&quot;mouse_txt&quot;, 999, 5, 5, 150, 40mouse_txt.html = true;mouse_txt.wordWrap = true;mouse_txt.border = true;mouse_txt.autoSize = true;mouse_txt.selectable = false;//var mouseListener:Object = new Object(mouseListener.onMouseMove = function() { var table_str:String = &quot;&lt;textformat tabstops=&#39;[50,100]&#39;&gt;&quot;; table_str += &quot;&lt;b&gt;Stage&lt;/b&gt; t&quot;+&quot;x:&quot;+_xmouse+&quot; t&quot;+&quot;y:&quot;+_ymouse+newline; table_str += &quot;&lt;b&gt;Button&lt;/b&gt; t&quot;+&quot;x:&quot;+my_btn._xmouse+&quot; t&quot;+&quot;y:&quot;+my_btn._ymouse+newline; table_str += &quot;&lt;/textformat&gt;&quot;; mouse_txt.htmlText = table_str;};Mouse.addListener(mouseListenerSee also_ymouse (Button._ymouse property)" />
   <page href="00005117.html" title="_xscale (Button._xscale property)" text="_xscale (Button._xscale property)public _xscale : NumberThe 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 that it would if the SWF file were at 100%.ExampleThe following example scales a button called my_btn. When you click and release the button, it grows 10% on the x and y axis. Enter the following ActionScript in Frame 1 of the Timeline: my_btn.onRelease = function(){ this._xscale ~= 1.1; this._yscale ~= 1.1;};See also_x (Button._x property), _y (Button._y property), _yscale (Button._yscale property)" />
   <page href="00005118.html" title="_y (Button._y property)" text="_y (Button._y property)public _y : NumberThe 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 button&#39;s coordinates refer to the registration point position.ExampleThe following example sets the coordinates of my_btn to 0 on the Stage. Create a button called my_btn and enter the following ActionScript in Frame 1 of the Timeline: my_btn._x = 0;my_btn._y = 0;See also_x (Button._x property), _xscale (Button._xscale property), _yscale (Button._yscale property)" />
   <page href="00005119.html" title="_ymouse (Button._ymouse property)" text="_ymouse (Button._ymouse property)public _ymouse : Number [read-only]Returns the y coordinate of the mouse position relative to the button. Note: The _ymouse property is supported for Flash Lite 2.0 only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example displays the x coordinate of the mouse position for the Stage and a button called my_btn that is placed on the Stage. Enter the following ActionScript in Frame 1 of the Timeline: this.createTextField(&quot;mouse_txt&quot;, 999, 5, 5, 150, 40mouse_txt.html = true;mouse_txt.wordWrap = true;mouse_txt.border = true;mouse_txt.autoSize = true;mouse_txt.selectable = false;//var mouseListener:Object = new Object(mouseListener.onMouseMove = function() { var table_str:String = &quot;&lt;textformat tabstops=&#39;[50,100]&#39;&gt;&quot;; table_str += &quot;&lt;b&gt;Stage&lt;/b&gt; t&quot;+&quot;x:&quot;+_xmouse+&quot; t&quot;+&quot;y:&quot;+_ymouse+newline; table_str += &quot;&lt;b&gt;Button&lt;/b&gt; t&quot;+&quot;x:&quot;+my_btn._xmouse+&quot; t&quot;+&quot;y:&quot;+my_btn._ymouse+newline; table_str += &quot;&lt;/textformat&gt;&quot;; mouse_txt.htmlText = table_str;};Mouse.addListener(mouseListenerSee also_xmouse (Button._xmouse property)" />
   <page href="00005120.html" title="_yscale (Button._yscale property)" text="_yscale (Button._yscale property)public _yscale : NumberThe 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).ExampleThe following example scales a button called my_btn. When you click and release the button, it grows 10% on the x and y axis. Enter the following ActionScript in Frame 1 of the Timeline: my_btn.onRelease = function(){ this._xscale ~= 1.1; this._yscale ~ 1.1;};See also_y (Button._y property), _x (Button._x property), _xscale (Button._xscale property)" />
   <page href="00005121.html" title="capabilities (System.capabilities)" text="ModifiersPropertyDescriptionstaticaudioMIMETypes:Array [read-only]Returns an array of MIME types for audio codecs supported by a mobile device.staticavHardwareDisable:Boolean [read-only]A Boolean value that specifies whether access to the user&#39;s camera and microphone has been administratively prohibited (true) or allowed (false).statichas4WayKeyAS:Boolean [read-only]A Boolean value that is true if the Flash Lite player executes the ActionScript code associated with key event handlers that are associated with the left, right, up, and down keys.statichasAccessibility:Boolean [read-only]A Boolean value that is true if the player is running in an environment that supports communication between Flash Player and accessibility aids; false otherwise.statichasAudio:Boolean [read-only]Specifies if the system has audio capabilities.statichasAudioEncoder:Boolean [read-only]Specifies if the Flash Player can encode an audio stream.statichasCMIDI:Boolean [read-only]Returns true if the mobile device can play sound data in the CMIDI audio format.statichasCompoundSound:Boolean [read-only]Returns true if the Flash Lite player can process compound sound data.statichasDataLoading:Boolean [read-only]Returns true if the Flash Lite player can dynamically load additional data through calls to specific functions.statichasEmail:Boolean [read-only]Returns true if the Flash Lite player can send e-mail messages with the GetURL ActionScript command.statichasEmbeddedVideo:Boolean [read-only]A Boolean value that indicates whether the mobile device supports embedded video.statichasMappableSoftKeys:BooleanReturns true if the mobile device allows you to reset or reassign softkey labels and handle events from those softkeys.statichasMFI:Boolean [read-only]Returns true if the mobile device is capable of playing sound data in the MFI audio format.statichasMIDI:Boolean [read-only]Returns true if the mobile device is capable of playing sound data in the MIDI audio format.statichasMMS:Boolean [read-only]Returns true if the mobile device can send MMS messages with the GetURL ActionScript command.statichasMouse:Boolean [read-only]Indicates whether the mobile device sends mouse-related events to a Flash Lite player.statichasMP3:Boolean [read-only]Specifies if the mobile device has a MP3 decoder.statichasPrinting:Boolean [read-only]A Boolean value that is true if the player is running on a mobile device that supports printing; false otherwise.statichasQWERTYKeyboard:Boolean [read-only]Returns true if the Flash Lite player can process ActionScript code associated with all keys found on a standard QWERTY keyboard, including the BACKSPACE key.statichasScreenBroadcast:Boolean [read-only]A Boolean value that is true if the player supports the development of screen broadcast applications to be run through Flash Media Server; false otherwise.statichasScreenPlayback:Boolean [read-only]A Boolean value that is true if the player supports the playback of screen broadcast applications that are being run through Flash Media Server; false otherwise.statichasSharedObjects:Boolean [read-only]Returns true if the Flash Lite content playing back in an application can access the Flash Lite version of shared objects.statichasSMAF:Boolean [read-only]Returns true if the mobile device is capable of playing sound data in the SMAF audio format.statichasSMS:Number [read-only]Indicates whether the mobile device can send SMS messages with the GetURL ActionScript command.statichasStreamingAudio:Boolean [read-only]A Boolean value that is true if the player can play streaming audio; false otherwise.statichasStreamingVideo:Boolean [read-only]A Boolean value that indicates whether the player can play streaming video.statichasStylus:Boolean [read-only]Indicates if the mobile device supports stylus-related events.statichasVideoEncoder:Boolean [read-only]Specifies if the Flash Player can encode a video stream.statichasXMLSocket:Number [read-only]Indicates whether the host application supports XML sockets.staticimageMIMETypes:Array [read-only]Returns an array that contains all MIME types that the loadMovie function and the codecs for a mobile device support for processing images.staticisDebugger:Boolean [read-only]A Boolean value that indicates whether the player is an officially released version (false) or a special debugging version (true).staticlanguage:String [read-only]Indicates the language of the system on which the player is running.staticlocalFileReadDisable:Boolean [read-only]A Boolean value that indicates whether read access to the user&#39;s hard disk has been administratively prohibited (true) or allowed (false).staticMIMETypes:Array [read-only]Returns an array that contains all MIME types that the loadMovie function, Sound and Video objects support.staticos:String [read-only]A string that indicates the current operating system.staticscreenOrientation:String [read-only]This member variable of the System.capabilities object that indicates the current screen orientation.staticscreenResolutionX:Number [read-only]An integer that indicates the maximum horizontal resolution of the screen.staticscreenResolutionY:Number [read-only]An integer that indicates the maximum vertical resolution of the screen.staticsoftKeyCount:Number [read-only]Indicates the number of remappable soft keys that the mobile device supports.staticversion:String [read-only]A string that contains the Flash Player platform and version information (for example, &quot;WIN 7,1,0,0&quot;).staticvideoMIMETypes:Array [read-only]Indicates all the MIME types for video that the mobile device&#39;s codecs support.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)capabilities (System.capabilities)Object | +-System.capabilitiespublic class capabilitiesextends ObjectThe Capabilities class determines the abilities of the system and player that host a SWF file, which lets you tailor content for different formats. For example, the screen of a mobile device is different from a computer screen. To provide appropriate content to as many users as possible, you can use the System.capabilities object to determine the type of device a user has. You can then either specify to the server to send different SWF files based on the device capabilities or tell the SWF file to alter its presentation based on the capabilities of the device. You can send capabilities information using a GET or POST HTTP method.The following example shows a string for a mobile device: that indicates a normal screen orientationthat is running an undetermined languagethat is running the Symbian7.0sSeries60V2 operating systemthat is configured so the user can&#39;t access hard disk, camera or microphonethat has the Flash Lite player as the official release versionfor which the Flash Lite player does not support the development nor playback of screen broadcast applications to be run through Flash Media Server that does not support printing on the devicethat the Flash Lite player is running on a mobile device that supports embedded video. undefinedScreenOrientation=normal language=xu OS=Symbian7.0sSeries60V2  localFileReadDisable=true avHardwareDisable=true isDebugger=false  hasScreenBroadcast=false hasScreenPlayback=false hasPrinting=false  hasEmbeddedVideo=true Most properties of the System.capabilities object are read-only.Property summaryProperties inherited from class ObjectMethod summaryMethods inherited from class Object" />
   <page href="00005122.html" title="audioMIMETypes (capabilities.audioMIMETypes property)" text="audioMIMETypes (capabilities.audioMIMETypes property)public static audioMIMETypes : Array [read-only]Returns an array of MIME types for audio codecs supported by a mobile device.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.audioMIMETypes" />
   <page href="00005123.html" title="avHardwareDisable (capabilities.avHardwareDisable property)" text="avHardwareDisable (capabilities.avHardwareDisable property)public static avHardwareDisable : Boolean [read-only]A Boolean value that specifies whether access to the user&#39;s camera and microphone has been administratively prohibited (true) or allowed (false). The server string is AVD. Note: For Flash Lite 2.0, the value returned is always true.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.avHardwareDisable" />
   <page href="00005124.html" title="has4WayKeyAS (capabilities.has4WayKeyAS property)" text="has4WayKeyAS (capabilities.has4WayKeyAS property)public static has4WayKeyAS : Boolean [read-only]A Boolean value that is true if the Flash Lite player executes the ActionScript code associated with key event handlers that are associated with the left, right, up, and down keys. Otherwise, this property returns false. If the value of this variable is true, when one of the four-way keys is pressed, the player first looks for a handler for that key. If none is found, Flash performs control navigation. However, if an event handler is found, no navigation action occurs for that key. In other words, the presence of a keypress handler for a down key disables the ability to navigate down.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.has4WayKeyAS" />
   <page href="00005125.html" title="hasAccessibility (capabilities.hasAccessibility property)" text="hasAccessibility (capabilities.hasAccessibility property)public static hasAccessibility : Boolean [read-only]A Boolean value that is true if the player is running in an environment that supports communication between Flash Player and accessibility aids; false otherwise. The server string is ACC. Note: For Flash Lite 2.0, the value returned is always false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasAccessibility" />
   <page href="00005126.html" title="hasAudio (capabilities.hasAudio property)" text="hasAudio (capabilities.hasAudio property)public static hasAudio : Boolean [read-only]Specifies if the system has audio capabilities. A Boolean value that is true if the player is running on a system that has audio capabilities; false otherwise. The server string is A.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasAudio" />
   <page href="00005127.html" title="hasAudioEncoder (capabilities.hasAudioEncoder property)" text="hasAudioEncoder (capabilities.hasAudioEncoder property)public static hasAudioEncoder : Boolean [read-only]Specifies if the Flash Player can encode an audio stream. A Boolean value that is true if the player can encode an audio stream, such as that coming from a microphone; false otherwise. The server string is AE. Note: For Flash Lite 2.0, the value returned is always false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasAudioEncoder" />
   <page href="00005128.html" title="hasCMIDI (capabilities.hasCMIDI property)" text="hasCMIDI (capabilities.hasCMIDI property)public static hasCMIDI : Boolean [read-only]Returns true if the mobile device can play sound data in the CMIDI audio format. Otherwise, this property returns false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasCMIDI" />
   <page href="00005129.html" title="hasCompoundSound (capabilities.hasCompoundSound property)" text="hasCompoundSound (capabilities.hasCompoundSound property)public static hasCompoundSound : Boolean [read-only]Returns true if the Flash Lite player can process compound sound data. Otherwise, it returns false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasCompoundSound" />
   <page href="00005130.html" title="hasDataLoading (capabilities.hasDataLoading property)" text="hasDataLoading (capabilities.hasDataLoading property)public static hasDataLoading : Boolean [read-only]Returns true if the Flash Lite player can dynamically load additional data through calls to specific functions. You can call the following specific functions: loadMovie()loadMovieNum()loadVariables()loadVariablesNum()XML.parseXML()Sound.loadSound()MovieClip.loadVariables()MovieClip.loadMovie()MovieClipLoader.loadClip()LoadVars.load()LoadVars.sendAndLoad() Otherwise, this property returns false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasDataLoading" />
   <page href="00005131.html" title="hasEmail (capabilities.hasEmail property)" text="hasEmail (capabilities.hasEmail property)public static hasEmail : Boolean [read-only]Returns true if the Flash Lite player can send e-mail messages with the GetURL ActionScript command. Otherwise, this property returns false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasEmail" />
   <page href="00005132.html" title="hasEmbeddedVideo (capabilities.hasEmbeddedVideo property)" text="hasEmbeddedVideo (capabilities.hasEmbeddedVideo property)public static hasEmbeddedVideo : Boolean [read-only]A Boolean value that indicates whether the mobile device supports embedded video. Note: The hasEmbeddedVideo property is always true in Flash Lite 2.0 and Flash Lite 2.1, indicating library support for device video.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasEmbeddedVideo" />
   <page href="00005133.html" title="hasMappableSoftKeys (capabilities.hasMappableSoftKeys property)" text="hasMappableSoftKeys (capabilities.hasMappableSoftKeys property)public static hasMappableSoftKeys : BooleanReturns true if the mobile device allows you to reset or reassign softkey labels and handle events from those softkeys. Otherwise, false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasMappableSoftKeys" />
   <page href="00005134.html" title="hasMFI (capabilities.hasMFI property)" text="hasMFI (capabilities.hasMFI property)public static hasMFI : Boolean [read-only]Returns true if the mobile device is capable of playing sound data in the MFI audio format. Otherwise, this property returns false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasMFI" />
   <page href="00005135.html" title="hasMIDI (capabilities.hasMIDI property)" text="hasMIDI (capabilities.hasMIDI property)public static hasMIDI : Boolean [read-only]Returns true if the mobile device is capable of playing sound data in the MIDI audio format. Otherwise, this property returns false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasMIDI" />
   <page href="00005136.html" title="hasMMS (capabilities.hasMMS property)" text="hasMMS (capabilities.hasMMS property)public static hasMMS : Boolean [read-only]Returns true if the mobile device can send MMS messages with the GetURL ActionScript command. Otherwise, this property returns false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasMMS" />
   <page href="00005137.html" title="hasMouse (capabilities.hasMouse property)" text="hasMouse (capabilities.hasMouse property)public static hasMouse : Boolean [read-only]Indicates whether the mobile device sends mouse-related events to a Flash Lite player. This property returns true if the mobile device sends mouse-related events to a Flash Lite player. Otherwise, it returns false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasMouse" />
   <page href="00005138.html" title="hasMP3 (capabilities.hasMP3 property)" text="hasMP3 (capabilities.hasMP3 property)public static hasMP3 : Boolean [read-only]Specifies if the mobile device has a MP3 decoder. A Boolean value that is true if the player is running on a system that has an MP3 decoder; false otherwise. The server string is MP3.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasMP3" />
   <page href="00005139.html" title="hasPrinting (capabilities.hasPrinting property)" text="hasPrinting (capabilities.hasPrinting property)public static hasPrinting : Boolean [read-only]A Boolean value that is true if the player is running on a mobile device that supports printing; false otherwise. The server string is PR. Note: For Flash Lite 2.0, the value returned is always false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasPrinting" />
   <page href="00005140.html" title="hasQWERTYKeyboard (capabilities.hasQWERTYKeyboard property)" text="hasQWERTYKeyboard (capabilities.hasQWERTYKeyboard property)public static hasQWERTYKeyboard : Boolean [read-only]Returns true if the Flash Lite player can process ActionScript code associated with all keys found on a standard QWERTY keyboard, including the BACKSPACE key. Otherwise, this property returns false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasQWERTYKeyboard" />
   <page href="00005141.html" title="hasScreenBroadcast (capabilities.hasScreenBroadcast property)" text="hasScreenBroadcast (capabilities.hasScreenBroadcast property)public static hasScreenBroadcast : Boolean [read-only]A Boolean value that is true if the player supports the development of screen broadcast applications to be run through Flash Media Server; false otherwise. The server string is SB. Note: For Flash Lite 2.0, the value returned is always false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasScreenBroadcast" />
   <page href="00005142.html" title="hasScreenPlayback (capabilities.hasScreenPlayback property)" text="hasScreenPlayback (capabilities.hasScreenPlayback property)public static hasScreenPlayback : Boolean [read-only]A Boolean value that is true if the player supports the playback of screen broadcast applications that are being run through Flash Media Server; false otherwise. The server string is SP. Note: For Flash Lite 2.0, the value returned is always false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasScreenPlayback" />
   <page href="00005143.html" title="hasSharedObjects (capabilities.hasSharedObjects property)" text="hasSharedObjects (capabilities.hasSharedObjects property)public static hasSharedObjects : Boolean [read-only]Returns true if the Flash Lite content playing back in an application can access the Flash Lite version of shared objects. Otherwise, this property returns false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasSharedObjects" />
   <page href="00005144.html" title="hasSMAF (capabilities.hasSMAF property)" text="hasSMAF (capabilities.hasSMAF property)public static hasSMAF : Boolean [read-only]Returns true if the mobile device is capable of playing sound data in the SMAF audio format. Otherwise, this property returns false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasSMAF" />
   <page href="00005145.html" title="hasSMS (capabilities.hasSMS property)" text="hasSMS (capabilities.hasSMS property)public static hasSMS : Number [read-only]Indicates whether the mobile device can send SMS messages with the GetURL ActionScript command. If Flash Lite can send SMS messages, this variable is defined and has a value of 1. Otherwise, this variable is not defined.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasSMS" />
   <page href="00005146.html" title="hasStreamingAudio (capabilities.hasStreamingAudio property)" text="hasStreamingAudio (capabilities.hasStreamingAudio property)public static hasStreamingAudio : Boolean [read-only]A Boolean value that is true if the player can play streaming audio; false otherwise. The server string is SA.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasStreamingAudio" />
   <page href="00005147.html" title="hasStreamingVideo (capabilities.hasStreamingVideo property)" text="hasStreamingVideo (capabilities.hasStreamingVideo property)public static hasStreamingVideo : Boolean [read-only]A Boolean value that indicates whether the player can play streaming video. Note: The hasStreamingVideo property is always false in Flash Lite 2.0 and Flash Lite 2.1, indicating that streaming FLV is not supported.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasStreamingVideo" />
   <page href="00005148.html" title="hasStylus (capabilities.hasStylus property)" text="hasStylus (capabilities.hasStylus property)public static hasStylus : Boolean [read-only]Indicates if the mobile device supports stylus-related events. This property returns true if the platform for the mobile device does not support stylus-related events. Otherwise, this property returns false.The stylus does not support the onMouseMove event. This capabilities flag allows the Flash content to check if the platform for a mobile device supports this event.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasStylus" />
   <page href="00005149.html" title="hasVideoEncoder (capabilities.hasVideoEncoder property)" text="hasVideoEncoder (capabilities.hasVideoEncoder property)public static hasVideoEncoder : Boolean [read-only]Specifies if the Flash Player can encode a video stream. A Boolean value that is true if the player can encode a video stream, such as that coming from a web camera; false otherwise. The server string is VE. Note: For Flash Lite 2.0, the value returned is always false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.hasVideoEncoder" />
   <page href="00005150.html" title="hasXMLSocket (capabilities.hasXMLSocket property)" text="hasXMLSocket (capabilities.hasXMLSocket property)public static hasXMLSocket : Number [read-only]Indicates whether the host application supports XML sockets. If the host application supports XML sockets, this variable is defined and has a value of 1. Otherwise, this variable is not defined." />
   <page href="00005151.html" title="imageMIMETypes (capabilities.imageMIMETypes property)" text="imageMIMETypes (capabilities.imageMIMETypes property)public static imageMIMETypes : Array [read-only]Returns an array that contains all MIME types that the loadMovie function and the codecs for a mobile device support for processing images.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.imageMIMETypes" />
   <page href="00005152.html" title="isDebugger (capabilities.isDebugger property)" text="isDebugger (capabilities.isDebugger property)public static isDebugger : Boolean [read-only]A Boolean value that indicates whether the player is an officially released version (false) or a special debugging version (true). The server string is DEB. Note: For Flash Lite 2.0, the value returned is always false.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.isDebugger" />
   <page href="00005153.html" title="language (capabilities.language property)" text="LanguageTagCzechcsDanishdaDutchnlEnglishenFinnishfiFrenchfrGermandeHungarianhuItalianitJapanesejaKoreankoNorwegiannoOther/unknownxuPolishplPortugueseptRussianruSimplified Chinesezh-CNSpanishesSwedishsvTraditional Chinesezh-TWTurkishtrlanguage (capabilities.language property)public static language : String [read-only]Indicates the language of the system on which the player is running. This property is specified as a lowercase two-letter language code from ISO 639-1. For Chinese, an additional uppercase two-letter country code subtag from ISO 3166 distinguishes between Simplified and Traditional Chinese. The languages themselves are named with the English tags. For example, fr specifies French. This property changed in two ways for Flash Player 7. First, the language code for English systems no longer includes the country code. In Flash Player 6, all English systems return the language code and the two-letter country code subtag (en-US). In Flash Player 7, English systems return only the language code (en). Second, on Microsoft Windows systems this property now returns the User Interface (UI) Language. In Flash Player 6 on the Microsoft Windows platform, System.capabilities.language returns the User Locale, which controls settings for formatting dates, times, currency and large numbers. In Flash Player 7 on the Microsoft Windows platform, this property now returns the UI Language, which refers to the language used for all menus, dialog boxes, error messages and help files.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.language" />
   <page href="00005154.html" title="localFileReadDisable (capabilities.localFileReadDisable property)" text="localFileReadDisable (capabilities.localFileReadDisable property)public static localFileReadDisable : Boolean [read-only]A Boolean value that indicates whether read access to the user&#39;s hard disk has been administratively prohibited (true) or allowed (false). If set to true, Flash Player will be unable to read files (including the first SWF file that Flash Player launches with) from the user&#39;s hard disk. For example, attempts to read a file on the user&#39;s hard disk using XML.load(), LoadMovie(), or LoadVars.load() will fail if this property is set to true. Reading runtime shared libraries will also be blocked if this property is set to true, but reading local shared objects is allowed without regard to the value of this property. The server string is LFD.Note: For Flash Lite 2.0, the value returned is always true.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.localFileReadDisable" />
   <page href="00005155.html" title="MIMETypes (capabilities.MIMETypes property)" text="MIMETypes (capabilities.MIMETypes property)public static MIMETypes : Array [read-only]Returns an array that contains all MIME types that the loadMovie function, Sound and Video objects support.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.MIMETypes" />
   <page href="00005156.html" title="os (capabilities.os property)" text="os (capabilities.os property)public static os : String [read-only]A string that indicates the current operating system. The os property can return the following strings: &quot;Windows XP&quot;, &quot;Windows 2000&quot;, &quot;Windows NT&quot;, &quot;Windows 98/ME&quot;, &quot;Windows 95&quot;, &quot;Windows CE&quot; (available only in Flash Player SDK, not in the desktop version), &quot;Linux&quot;, and &quot;MacOS&quot;. The server string is OS.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.os" />
   <page href="00005157.html" title="screenOrientation (capabilities.screenOrientation property)" text="screenOrientation (capabilities.screenOrientation property)public static screenOrientation : String [read-only]This member variable of the System.capabilities object that indicates the current screen orientation. Possible values for screenOrientation property:normal the screen is in its normal orientationrotated90 the screen is rotated by 90 degreesrotated180 the screen is rotated by 180 degreesrotated270 the screen is rotated by 270 degreesExampleThe following example traces the value of this read-only property: trace(System.capabilities.screenOrientation" />
   <page href="00005158.html" title="screenResolutionX (capabilities.screenResolutionX property)" text="screenResolutionX (capabilities.screenResolutionX property)public static screenResolutionX : Number [read-only]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).ExampleThe following example traces the value of this read-only property: trace(System.capabilities.screenResolutionX" />
   <page href="00005159.html" title="screenResolutionY (capabilities.screenResolutionY property)" text="screenResolutionY (capabilities.screenResolutionY property)public static screenResolutionY : Number [read-only]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).ExampleThe following example traces the value of this read-only property: trace(System.capabilities.screenResolutionY" />
   <page href="00005160.html" title="softKeyCount (capabilities.softKeyCount property)" text="softKeyCount (capabilities.softKeyCount property)public static softKeyCount : Number [read-only]Indicates the number of remappable soft keys that the mobile device supports.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.softKeyCount" />
   <page href="00005161.html" title="version (capabilities.version property)" text="version (capabilities.version property)public static version : String [read-only]A string that contains the Flash Player platform and version information (for example, &quot;WIN 7,1,0,0&quot;). The server string is V.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.version" />
   <page href="00005162.html" title="videoMIMETypes (capabilities.videoMIMETypes property)" text="videoMIMETypes (capabilities.videoMIMETypes property)public static videoMIMETypes : Array [read-only]Indicates all the MIME types for video that the mobile device&#39;s codecs support. This property returns an array of all the MIME types for video that the mobile device&#39;s codecs support.ExampleThe following example traces the value of this read-only property:  trace(System.capabilities.videoMIMETypes" />
   <page href="00005163.html" title="Color" text="constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)SignatureDescriptionColor(target:Object)Creates a Color object for the movie clip specified by the target_mc parameter.ModifiersSignatureDescriptiongetRGB() : NumberReturns the R+G+B combination currently in use by the color object.getTransform() : ObjectReturns the transform value set by the last Color.setTransform() call.setRGB(offset:Number) : VoidSpecifies an RGB color for a Color object.setTransform(transformObject:Object) : VoidSets color transform information for a Color object.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)ColorObject | +-Colorpublic class Colorextends ObjectThe Color class lets you set the RGB color value and color transform of movie clips and retrieve those values once they have been set. You must use the constructor new Color() to create a Color object before calling its methods.Property summaryProperties inherited from class ObjectConstructor summaryMethod summaryMethods inherited from class Object" />
   <page href="00005164.html" title="Color constructor" text="Color constructorpublic Color(target:Object)Creates a Color object for the movie clip specified by the target_mc parameter. You can then use the methods of that Color object to change the color of the entire target movie clip.Parameterstarget:Object - The instance name of a movie clip.ExampleThe following example creates a Color object called my_color for the movie clip my_mc and sets its RGB value to orange: var my_color:Color = new Color(my_mcmy_color.setRGB(0xff9933" />
   <page href="00005165.html" title="getRGB (Color.getRGB method)" text="getRGB (Color.getRGB method)public getRGB() : NumberReturns the R+G+B combination currently in use by the color object.ReturnsNumber - A number that represents the RGB numeric value for the color specified.ExampleThe following code retrieves the RGB value for the Color object my_color, converts the value to a hexadecimal string, and assigns it to the myValue variable. To see this code work, add a movie clip instance to the Stage, and give it the instance name my_mc: var my_color:Color = new Color(my_mc// set the colormy_color.setRGB(0xff9933var myValue:String = my_color.getRGB().toString(16// trace the color valuetrace(myValue // traces ff9933See alsosetRGB (Color.setRGB method)" />
   <page href="00005166.html" title="getTransform (Color.getTransform method)" text="getTransform (Color.getTransform method)public getTransform() : ObjectReturns the transform value set by the last Color.setTransform() call.ReturnsObject - An object whose properties contain the current offset and percentage values for the specified color.ExampleThe following example gets the transform object, and then sets new percentages for colors and alpha of my_mc relative to their current values. To see this code work, place a multicolored movie clip on the Stage with the instance name my_mc. Then place the following code on Frame 1 in the main Timeline and select Control &gt; Test Movie: var my_color:Color = new Color(my_mcvar myTransform:Object = my_color.getTransform(myTransform = { ra: 50, ba: 50, aa: 30};my_color.setTransform(myTransformFor descriptions of the parameters for a color transform object, see Color.setTransform().See alsosetTransform (Color.setTransform method)" />
   <page href="00005167.html" title="setRGB (Color.setRGB method)" text="setRGB (Color.setRGB method)public setRGB(offset:Number) : VoidSpecifies an RGB color for a Color object. Calling this method overrides any previous Color.setTransform() settings.Parametersoffset:Number - 0xRRGGBB The hexadecimal or RGB color to be set. RR, GG, and BB each consist of two hexadecimal digits that specify the offset of each color component. The 0x tells the ActionScript compiler that the number is a hexadecimal value.ExampleThis example sets the RGB color value for the movie clip my_mc. To see this code work, place a movie clip on the Stage with the instance name my_mc. Then place the following code on Frame 1 in the main Timeline and select Control &gt; Test Movie: var my_color:Color = new Color(my_mcmy_color.setRGB(0xFF0000 // my_mc turns redSee alsosetTransform (Color.setTransform method)" />
   <page href="00005168.html" title="setTransform (Color.setTransform method)" text="setTransform (Color.setTransform method)public setTransform(transformObject:Object) : VoidSets color transform information for a Color object. The colorTransformObject parameter is a generic object that you create from the new Object constructor. It has parameters specifying the percentage and offset values for the red, green, blue, and alpha (transparency) components of a color, entered in the format 0xRRGGBBAA. The parameters for a color transform object correspond to the settings in the Advanced Effect dialog box and are defined as follows:ra is the percentage for the red component (-100 to 100).rb is the offset for the red component (-255 to 255).ga is the percentage for the green component (-100 to 100).gb is the offset for the green component (-255 to 255).ba is the percentage for the blue component (-100 to 100).bb is the offset for the blue component (-255 to 255).aa is the percentage for alpha (-100 to 100).ab is the offset for alpha (-255 to 255).You create a colorTransformObject parameter as follows:var myColorTransform:Object = new Object(myColorTransform.ra = 50;myColorTransform.rb = 244;myColorTransform.ga = 40;myColorTransform.gb = 112;myColorTransform.ba = 12;myColorTransform.bb = 90;myColorTransform.aa = 40;myColorTransform.ab = 70;You can also use the following syntax to create a colorTransformObject parameter:var myColorTransform:Object = { ra: 50, rb: 244, ga: 40, gb: 112, ba: 12, bb: 90, aa: 40, ab: 70}ParameterstransformObject:Object - An object created with the new Object constructor. This instance of the Object class must have the following properties that specify color transform values: ra, rb, ga, gb, ba, bb, aa, ab. These properties are explained below.ExampleThis example creates a new Color object for a target SWF file, creates a generic object called myColorTransform with the properties defined above, and uses the setTransform() method to pass the colorTransformObject to a Color object. To use this code in a Flash (FLA) document, place it on Frame 1 on the main Timeline and place a movie clip on the Stage with the instance name my_mc, as in the following code: // Create a color object called my_color for the target my_mcvar my_color:Color = new Color(my_mc// Create a color transform object called myColorTransform using// Set the values for myColorTransformvar myColorTransform:Object = { ra: 50, rb: 244, ga: 40, gb: 112, ba: 12, bb: 90, aa: 40, ab: 70};// Associate the color transform object with the Color object// created for my_mcmy_color.setTransform(myColorTransformSee alsoObject" />
   <page href="00005169.html" title="Date" text="constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)SignatureDescriptionDate([yearOrTimevalue:Number], [month:Number], [date:Number], [hour:Number], [minute:Number], [second:Number], [millisecond:Number])Constructs a new Date object that holds the specified date and time.ModifiersSignatureDescriptiongetDate() : NumberReturns the day of the month (an integer from 1 to 31) of the specified Date object according to local time.getDay() : NumberReturns the day of the week (0 for Sunday, 1 for Monday, and so on) of the specified Date object according to local time.getFullYear() : NumberReturns the full year (a four-digit number, such as 2000) of the specified Date object, according to local time.getHours() : NumberReturns the hour (an integer from 0 to 23) of the specified Date object, according to local time.getLocaleLongDate() : StringReturns a string representing the current date, in long form, formatted according to the currently defined locale.getLocaleShortDate() : StringReturns a string representing the current date, in short form, formatted according to the currently defined locale.getLocaleTime() : StringReturns a string representing the current time, formatted according to the currently defined locale.getMilliseconds() : NumberReturns the milliseconds (an integer from 0 to 999) of the specified Date object, according to local time.getMinutes() : NumberReturns the minutes (an integer from 0 to 59) of the specified Date object, according to local time.getMonth() : NumberReturns the month (0 for January, 1 for February, and so on) of the specified Date object, according to local time.getSeconds() : NumberReturns the seconds (an integer from 0 to 59) of the specified Date object, according to local time.getTime() : NumberReturns the number of milliseconds since midnight January 1, 1970, universal time, for the specified Date object.getTimezoneOffset() : NumberReturns the difference, in minutes, between the computer&#39;s local time and universal time.getUTCDate() : NumberReturns the day of the month (an integer from 1 to 31) in the specified Date object, according to universal time.getUTCDay() : NumberReturns the day of the week (0 for Sunday, 1 for Monday, and so on) of the specified Date object, according to universal time.getUTCFullYear() : NumberReturns the four-digit year of the specified Date object, according to universal time.getUTCHours() : NumberReturns the hour (an integer from 0 to 23) of the specified Date object, according to universal time.getUTCMilliseconds() : NumberReturns the milliseconds (an integer from 0 to 999) of the specified Date object, according to universal time.getUTCMinutes() : NumberReturns the minutes (an integer from 0 to 59) of the specified Date object, according to universal time.getUTCMonth() : NumberReturns the month (0 [January] to 11 [December]) of the specified Date object, according to universal time.getUTCSeconds() : NumberReturns the seconds (an integer from 0 to 59) of the specified Date object, according to universal time.getUTCYear() : NumberReturns the year of this Date according to universal time (UTC).getYear() : NumberReturns the year of the specified Date object, according to local time.setDate(date:Number) : NumberSets the day of the month for the specified Date object, according to local time, and returns the new time in milliseconds.setFullYear(year:Number, [month:Number], [date:Number]) : NumberSets the year of the specified Date object, according to local time and returns the new time in milliseconds.setHours(hour:Number) : NumberSets the hours for the specified Date object according to local time and returns the new time in milliseconds.setMilliseconds(millisecond:Number) : NumberSets the milliseconds for the specified Date object according to local time and returns the new time in milliseconds.setMinutes(minute:Number) : NumberSets the minutes for a specified Date object according to local time and returns the new time in milliseconds.setMonth(month:Number, [date:Number]) : NumberSets the month for the specified Date object in local time and returns the new time in milliseconds.setSeconds(second:Number) : NumberSets the seconds for the specified Date object in local time and returns the new time in milliseconds.setTime(millisecond:Number) : NumberSets the date for the specified Date object in milliseconds since midnight on January 1, 1970, and returns the new time in milliseconds.setUTCDate(date:Number) : NumberSets the date for the specified Date object in universal time and returns the new time in milliseconds.setUTCFullYear(year:Number, [month:Number], [date:Number]) : NumberSets the year for the specified Date object (my_date) in universal time and returns the new time in milliseconds.setUTCHours(hour:Number, [minute:Number], [second:Number], [millisecond:Number]) : NumberSets the hour for the specified Date object in universal time and returns the new time in milliseconds.setUTCMilliseconds(millisecond:Number) : NumberSets the milliseconds for the specified Date object in universal time and returns the new time in milliseconds.setUTCMinutes(minute:Number, [second:Number], [millisecond:Number]) : NumberSets the minute for the specified Date object in universal time and returns the new time in milliseconds.setUTCMonth(month:Number, [date:Number]) : NumberSets the month, and optionally the day, for the specified Date object in universal time and returns the new time in milliseconds.setUTCSeconds(second:Number, [millisecond:Number]) : NumberSets the seconds for the specified Date object in universal time and returns the new time in milliseconds.setYear(year:Number) : NumberSets the year for the specified Date object in local time and returns the new time in milliseconds.toString() : StringReturns a string value for the specified date object in a readable format.staticUTC(year:Number, month:Number, [date:Number], [hour:Number], [minute:Number], [second:Number], [millisecond:Number]) : NumberReturns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters.valueOf() : NumberReturns the number of milliseconds since midnight January 1, 1970, universal time, for this Date.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)DateObject | +-Datepublic class Dateextends ObjectThe Date class lets you retrieve date and time values relative to universal time (Greenwich mean time, now called universal time or UTC) or relative to the operating system on which Flash Player is running. The methods of the Date class are not static but apply only to the individual Date object specified when the method is called. The Date.UTC() method is an exception; it is a static method. The Date class handles daylight saving time differently, depending on the operating system and Flash Player version. Flash Player 6 and later versions handle daylight saving time on the following operating systems in these ways:Windows - the Date object automatically adjusts its output for daylight saving time. The Date object detects whether daylight saving time is employed in the current locale, and if so, it detects the standard-to-daylight saving time transition date and times. However, the transition dates currently in effect are applied to dates in the past and the future, so the daylight saving time bias might calculate incorrectly for dates in the past when the locale had different transition dates.Mac OS X - the Date object automatically adjusts its output for daylight saving time. The time zone information database in Mac OS X is used to determine whether any date or time in the present or past should have a daylight saving time bias applied.Mac OS 9 - the operating system provides only enough information to determine whether the current date and time should have a daylight saving time bias applied. Accordingly, the date object assumes that the current daylight saving time bias applies to all dates and times in the past or future.Flash Player 5 handles daylight saving time on the following operating systems as follows:Windows - the U.S. rules for daylight saving time are always applied, which leads to incorrect transitions in Europe and other areas that employ daylight saving time but have different transition times than the U.S. Flash correctly detects whether daylight saving time is used in the current locale.To call the methods of the Date class, you must first create a Date object using the constructor for the Date class, described later in this section.Property summaryProperties inherited from class ObjectConstructor summaryMethod summaryMethods inherited from class Object" />
   <page href="00005170.html" title="Date constructor" text="Date constructorpublic Date([yearOrTimevalue:Number], [month:Number], [date:Number], [hour:Number], [minute:Number], [second:Number], [millisecond:Number])Constructs a new Date object that holds the specified date and time. The Date() constructor takes up to seven parameters (year, month, ..., millisecond) to specify a date and time to the millisecond. Alternatively, you can pass a single value to the Date() constructor that indicates a time value based on the number of milliseconds since January 1, 1970 0:00:000 GMT. Or you can specify no parameters, and the Date() date object is assigned the current date and time.For example, this code shows several different ways to create a Date object:var d1:Date = new Date( var d3:Date = new Date(2000, 0, 1var d4:Date = new Date(65, 2, 6, 9, 30, 15, 0var d5:Date = new Date(-14159025000In the first line of code, a Date object is set to the time when the assignment statement is run.In the second line, a Date object is created with year, month, and date parameters passed to it, resulting in the time 0:00:00 GMT January 1, 2000.In the third line, a Date object is created with year, month, and date parameters passed to it, resulting in the time 09:30:15 GMT (+ 0 milliseconds) March 6, 1965. Note that since the year parameter is specified as a two-digit integer, it is interpreted as 1965.In the fourth line, only one parameter is passed, which is a time value representing the number of milliseconds before or after 0:00:00 GMT January 1, 1970; since the value is negative, it represents a time before 0:00:00 GMT January 1, 1970, and in this case the time is 02:56:15 GMT July, 21 1969.ParametersyearOrTimevalue:Number [optional] - If other parameters are specified, this number represents a year (such as 1965 otherwise, it represents a time value. If the number represents a year, a value of 0 to 99 indicates 1900 through 1999; otherwise all four digits of the year must be specified. If the number represents a time value (no other parameters are specified), it is the number of milliseconds before or after 0:00:00 GMT January 1, 1970; a negative values represents a time before 0:00:00 GMT January 1, 1970, and a positive value represents a time after.month:Number [optional] - An integer from 0 (January) to 11 (December).date:Number [optional] - An integer from 1 to 31.hour:Number [optional] - An integer from 0 (midnight) to 23 (11 p.m.).minute:Number [optional] - An integer from 0 to 59.second:Number [optional] - An integer from 0 to 59.millisecond:Number [optional] - An integer from 0 to 999 of milliseconds.ExampleThe following example retrieves the current date and time: var now_date:Date = new Date(The following example creates a new Date object for Mary&#39;s birthday, August 12, 1974 (because the month parameter is zero-based, the example uses 7 for the month, not 8): var maryBirthday:Date = new Date (74, 7, 12 The following example creates a new Date object and concatenates the returned values of Date.getMonth(), Date.getDate(), and Date.getFullYear():var today_date:Date = new Date(var date_str:String = ((today_date.getMonth()+1)+&quot;/&quot;+today_date.getDate()+&quot;/&quot;+today_date.getFullYear()trace(date_str // displays current date in United States date formatSee alsogetMonth (Date.getMonth method), getDate (Date.getDate method), getFullYear (Date.getFullYear method)" />
   <page href="00005171.html" title="getDate (Date.getDate method)" text="getDate (Date.getDate method)public getDate() : NumberReturns the day of the month (an integer from 1 to 31) of the specified Date object according to local time. Local time is determined by the operating system on which Flash Player is running.ReturnsNumber - An integer.ExampleThe following example creates a new Date object and concatenates the returned values of Date.getMonth(), Date.getDate(), and Date.getFullYear():var today_date:Date = new Date(var date_str:String = (today_date.getDate()+&quot;/&quot;+(today_date.getMonth()+1)+&quot;/&quot;+today_date.getFullYear()trace(date_str // displays current date in United States date formatSee alsogetMonth (Date.getMonth method), getFullYear (Date.getFullYear method)" />
   <page href="00005172.html" title="getDay (Date.getDay method)" text="getDay (Date.getDay method)public getDay() : NumberReturns the day of the week (0 for Sunday, 1 for Monday, and so on) of the specified Date object according to local time. Local time is determined by the operating system on which Flash Player is running.ReturnsNumber - An integer representing the day of the week.ExampleThe following example creates a new Date object and uses getDay() to determine the current day of the week:var dayOfWeek_array:Array = new Array(&quot;Sunday&quot;, &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;var today_date:Date = new Date(var day_str:String = dayOfWeek_array[today_date.getDay()];trace(&quot;Today is &quot;+day_str" />
   <page href="00005173.html" title="getFullYear (Date.getFullYear method)" text="getFullYear (Date.getFullYear method)public getFullYear() : NumberReturns the full year (a four-digit number, such as 2000) of the specified Date object, according to local time. Local time is determined by the operating system on which Flash Player is running.ReturnsNumber - An integer representing the year.ExampleThe following example uses the constructor to create a Date object. The trace statement shows the value returned by the getFullYear() method. var my_date:Date = new Date(trace(my_date.getYear() // displays 104trace(my_date.getFullYear() // displays current year" />
   <page href="00005174.html" title="getHours (Date.getHours method)" text="getHours (Date.getHours method)public getHours() : NumberReturns the hour (an integer from 0 to 23) of the specified Date object, according to local time. Local time is determined by the operating system on which Flash Player is running.ReturnsNumber - An integer.ExampleThe following example uses the constructor to create a Date object based on the current time and uses the getHours() method to display hour values from that object: var my_date:Date = new Date(trace(my_date.getHours()var my_date:Date = new Date(var hourObj:Object = getHoursAmPm(my_date.getHours()trace(hourObj.hourstrace(hourObj.ampmfunction getHoursAmPm(hour24:Number):Object { var returnObj:Object = new Object( returnObj.ampm = (hour24&lt;12) ? &quot;AM&quot; : &quot;PM&quot;; var hour12:Number = hour24%12; if (hour12 == 0) { hour12 = 12; } returnObj.hours = hour12; return returnObj;}" />
   <page href="00005175.html" title="getLocaleLongDate (Date.getLocaleLongDate method)" text="getLocaleLongDate (Date.getLocaleLongDate method)public getLocaleLongDate() : StringReturns a string representing the current date, in long form, formatted according to the currently defined locale.  Note: The format of the date depends on the mobile device and the locale.ReturnsString - A string representing the current date, in long form, formatted according to the currently defined locale.ExampleThe following example uses the constructor to create a Date object based on the current time. It also uses the getLocaleLongDate() method to return the current date, in long form, formatted according to the currently defined locale, as follows: var my_date:Date = new Date(trace(my_date.getLocaleLongDate() The following are sample return values that getLocaleLongDate() returns: October 16, 200516 October 2005" />
   <page href="00005176.html" title="getLocaleShortDate (Date.getLocaleShortDate method)" text="getLocaleShortDate (Date.getLocaleShortDate method)public getLocaleShortDate() : StringReturns a string representing the current date, in short form, formatted according to the currently defined locale.  Note: The format of the date depends on the mobile device and the locale.ReturnsString - A string representing the current date, in short form, formatted according to the currently defined locale.ExampleThe following example uses the constructor to create a Date object based on the current time. It also uses the getLocaleShortDate() method to return the current date, in short form, formatted according to the currently defined locale, as follows: var my_date:Date = new Date(trace(my_date.getLocaleShortDate() The following are sample return values that getLocaleLongDate() returns: 10/16/200516-10-2005" />
   <page href="00005177.html" title="getLocaleTime (Date.getLocaleTime method)" text="getLocaleTime (Date.getLocaleTime method)public getLocaleTime() : StringReturns a string representing the current time, formatted according to the currently defined locale.  Note: The format of the date depends on the mobile device and the locale.ReturnsString - A string representing the current time, formatted according to the currently defined locale.ExampleThe following example uses the constructor to create a Date object based on the current time. It also uses the getLocaleTime() method to return the time of the current locale, as follows: var my_date:Date = new Date(trace(my_date.getLocaleTime() The following are sample return values that getLocaleTime() returns: 6:10:44 PM18:10:44" />
   <page href="00005178.html" title="getMilliseconds (Date.getMilliseconds method)" text="getMilliseconds (Date.getMilliseconds method)public getMilliseconds() : NumberReturns the milliseconds (an integer from 0 to 999) of the specified Date object, according to local time. Local time is determined by the operating system on which Flash Player is running.ReturnsNumber - An integer.ExampleThe following example uses the constructor to create a Date object based on the current time and uses the getMilliseconds() method to return the milliseconds value from that object: var my_date:Date = new Date(trace(my_date.getMilliseconds()" />
   <page href="00005179.html" title="getMinutes (Date.getMinutes method)" text="getMinutes (Date.getMinutes method)public getMinutes() : NumberReturns the minutes (an integer from 0 to 59) of the specified Date object, according to local time. Local time is determined by the operating system on which Flash Player is running.ReturnsNumber - An integer.ExampleThe following example uses the constructor to create a Date object based on the current time, and uses the getMinutes() method to return the minutes value from that object: var my_date:Date = new Date(trace(my_date.getMinutes()" />
   <page href="00005180.html" title="getMonth (Date.getMonth method)" text="getMonth (Date.getMonth method)public getMonth() : NumberReturns the month (0 for January, 1 for February, and so on) of the specified Date object, according to local time. Local time is determined by the operating system on which Flash Player is running.ReturnsNumber - An integer.ExampleThe following example uses the constructor to create a Date object based on the current time and uses the getMonth() method to return the month value from that object: var my_date:Date = new Date(trace(my_date.getMonth()The following example uses the constructor to create a Date object based on the current time and uses the getMonth() method to display the current month as a numeric value, and display the name of the month.var my_date:Date = new Date(trace(my_date.getMonth()trace(getMonthAsString(my_date.getMonth())function getMonthAsString(month:Number):String { var monthNames_array:Array = new Array(&quot;January&quot;, &quot;February&quot;, &quot;March&quot;, &quot;April&quot;, &quot;May&quot;, &quot;June&quot;, &quot;July&quot;, &quot;August&quot;, &quot;September&quot;, &quot;October&quot;, &quot;November&quot;, &quot;December&quot; return monthNames_array[month];}" />
   <page href="00005181.html" title="getSeconds (Date.getSeconds method)" text="getSeconds (Date.getSeconds method)public getSeconds() : NumberReturns the seconds (an integer from 0 to 59) of the specified Date object, according to local time. Local time is determined by the operating system on which Flash Player is running.ReturnsNumber - An integer.ExampleThe following example uses the constructor to create a Date object based on the current time and uses the getSeconds() method to return the seconds value from that object: var my_date:Date = new Date(trace(my_date.getSeconds()" />
   <page href="00005182.html" title="getTime (Date.getTime method)" text="getTime (Date.getTime method)public getTime() : NumberReturns the number of milliseconds since midnight January 1, 1970, universal time, for the specified Date object. Use this method to represent a specific instant in time when comparing two or more Date objects.ReturnsNumber - An integer.ExampleThe following example uses the constructor to create a Date object based on the current time, and uses the getTime() method to return the number of milliseconds since midnight January 1, 1970: var my_date:Date = new Date(trace(my_date.getTime()" />
   <page href="00005183.html" title="getTimezoneOffset (Date.getTimezoneOffset method)" text="getTimezoneOffset (Date.getTimezoneOffset method)public getTimezoneOffset() : NumberReturns the difference, in minutes, between the computer&#39;s local time and universal time.ReturnsNumber - An integer.ExampleThe following example returns the difference between the local daylight saving time for San Francisco and universal time. Daylight saving time is factored into the returned result only if the date defined in the Date object occurs during daylight saving time. The output in this example is 420 minutes and displays in the Output panel (7 hours * 60 minutes/hour = 420 minutes). This example is Pacific Daylight Time (PDT, GMT-0700). The result varies depending on location and time of year. var my_date:Date = new Date(trace(my_date.getTimezoneOffset()" />
   <page href="00005184.html" title="getUTCDate (Date.getUTCDate method)" text="getUTCDate (Date.getUTCDate method)public getUTCDate() : NumberReturns the day of the month (an integer from 1 to 31) in the specified Date object, according to universal time.ReturnsNumber - An integer.ExampleThe following example creates a new Date object and uses Date.getUTCDate() and Date.getDate(). The value returned by Date.getUTCDate() can differ from the value returned by Date.getDate(), depending on the relationship between your local time zone and universal time. var my_date:Date = new Date(2004,8,25trace(my_date.getUTCDate() // output: 25See alsogetDate (Date.getDate method)" />
   <page href="00005185.html" title="getUTCDay (Date.getUTCDay method)" text="getUTCDay (Date.getUTCDay method)public getUTCDay() : NumberReturns the day of the week (0 for Sunday, 1 for Monday, and so on) of the specified Date object, according to universal time.ReturnsNumber - An integer.ExampleThe following example creates a new Date object and uses Date.getUTCDay() and Date.getDay(). The value returned by Date.getUTCDay() can differ from the value returned by Date.getDay(), depending on the relationship between your local time zone and universal time. var today_date:Date = new Date(trace(today_date.getDay() // output will be based on local timezonetrace(today_date.getUTCDay() // output will equal getDay() plus or minus oneSee alsogetDay (Date.getDay method)" />
   <page href="00005186.html" title="getUTCFullYear (Date.getUTCFullYear method)" text="getUTCFullYear (Date.getUTCFullYear method)public getUTCFullYear() : NumberReturns the four-digit year of the specified Date object, according to universal time.ReturnsNumber - An integer.ExampleThe following example creates a new Date object and uses Date.getUTCFullYear() and Date.getFullYear(). The value returned by Date.getUTCFullYear() may differ from the value returned by Date.getFullYear() if today&#39;s date is December 31 or January 1, depending on the relationship between your local time zone and universal time. var today_date:Date = new Date(trace(today_date.getFullYear() // display based on local timezonetrace(today_date.getUTCFullYear() // displays getYear() plus or minus 1See alsogetFullYear (Date.getFullYear method)" />
   <page href="00005187.html" title="getUTCHours (Date.getUTCHours method)" text="getUTCHours (Date.getUTCHours method)public getUTCHours() : NumberReturns the hour (an integer from 0 to 23) of the specified Date object, according to universal time.ReturnsNumber - An integer.ExampleThe following example creates a new Date object and uses Date.getUTCHours() and Date.getHours(). The value returned by Date.getUTCHours() may differ from the value returned by Date.getHours(), depending on the relationship between your local time zone and universal time. var today_date:Date = new Date(trace(today_date.getHours() // display based on local timezonetrace(today_date.getUTCHours() // display equals getHours() plus or minus 12See alsogetHours (Date.getHours method)" />
   <page href="00005188.html" title="getUTCMilliseconds (Date.getUTCMilliseconds method)" text="getUTCMilliseconds (Date.getUTCMilliseconds method)public getUTCMilliseconds() : NumberReturns the milliseconds (an integer from 0 to 999) of the specified Date object, according to universal time.ReturnsNumber - An integer.ExampleThe following example creates a new Date object and uses getUTCMilliseconds() to return the milliseconds value from the Date object. var today_date:Date = new Date(trace(today_date.getUTCMilliseconds()" />
   <page href="00005189.html" title="getUTCMinutes (Date.getUTCMinutes method)" text="getUTCMinutes (Date.getUTCMinutes method)public getUTCMinutes() : NumberReturns the minutes (an integer from 0 to 59) of the specified Date object, according to universal time.ReturnsNumber - An integer.ExampleThe following example creates a new Date object and uses getUTCMinutes() to return the minutes value from the Date object: var today_date:Date = new Date(trace(today_date.getUTCMinutes() " />
   <page href="00005190.html" title="getUTCMonth (Date.getUTCMonth method)" text="getUTCMonth (Date.getUTCMonth method)public getUTCMonth() : NumberReturns the month (0 [January] to 11 [December]) of the specified Date object, according to universal time.ReturnsNumber - An integer.ExampleThe following example creates a new Date object and uses Date.getUTCMonth() and Date.getMonth(). The value returned by Date.getUTCMonth() can differ from the value returned by Date.getMonth() if today&#39;s date is the first or last day of a month, depending on the relationship between your local time zone and universal time. var today_date:Date = new Date(trace(today_date.getMonth() // output based on local timezonetrace(today_date.getUTCMonth() // output equals getMonth() plus or minus 1See alsogetMonth (Date.getMonth method)" />
   <page href="00005191.html" title="getUTCSeconds (Date.getUTCSeconds method)" text="getUTCSeconds (Date.getUTCSeconds method)public getUTCSeconds() : NumberReturns the seconds (an integer from 0 to 59) of the specified Date object, according to universal time.ReturnsNumber - An integer.ExampleThe following example creates a new Date object and uses getUTCSeconds() to return the seconds value from the Date object: var today_date:Date = new Date(trace(today_date.getUTCSeconds() " />
   <page href="00005192.html" title="getUTCYear (Date.getUTCYear method)" text="getUTCYear (Date.getUTCYear method)public getUTCYear() : NumberReturns the year of this Date according to universal time (UTC). The year is the full year minus 1900. For example, the year 2000 is represented as 100.ReturnsNumber - ExampleThe following example creates a new Date object and uses Date.getUTCFullYear() and Date.getFullYear(). The value returned by Date.getUTCFullYear() may differ from the value returned by Date.getFullYear() if today&#39;s date is December 31 or January 1, depending on the relationship between your local time zone and universal time. var today_date:Date = new Date(trace(today_date.getFullYear() // display based on local timezonetrace(today_date.getUTCFullYear() // displays getYear() plus or minus 1" />
   <page href="00005193.html" title="getYear (Date.getYear method)" text="getYear (Date.getYear method)public getYear() : NumberReturns the year of the specified Date object, according to local time. Local time is determined by the operating system on which Flash Player is running. The year is the full year minus 1900. For example, the year 2000 is represented as 100.ReturnsNumber - An integer.ExampleThe following example creates a Date object with the month and year set to May 2004. The Date.getYear() method returns 104, and Date.getFullYear() returns 2004: var today_date:Date = new Date(2004,4trace(today_date.getYear() // output: 104trace(today_date.getFullYear() // output: 2004See alsogetFullYear (Date.getFullYear method)" />
   <page href="00005194.html" title="setDate (Date.setDate method)" text="setDate (Date.setDate method)public setDate(date:Number) : NumberSets the day of the month for the specified Date object, according to local time, and returns the new time in milliseconds. Local time is determined by the operating system on which Flash Player is running.Parametersdate:Number - An integer from 1 to 31.ReturnsNumber - An integer.ExampleThe following example initially creates a new Date object, setting the date to May 15, 2004, and uses Date.setDate() to change the date to May 25, 2004: var today_date:Date = new Date(2004,4,15trace(today_date.getDate() //displays 15today_date.setDate(25trace(today_date.getDate() //displays 25" />
   <page href="00005195.html" title="setFullYear (Date.setFullYear method)" text="setFullYear (Date.setFullYear method)public setFullYear(year:Number, [month:Number], [date:Number]) : NumberSets the year of the specified Date object, according to local time and returns the new time in milliseconds. If the month and date parameters are specified, they are set to local time. Local time is determined by the operating system on which Flash Player is running. Calling this method does not modify the other fields of the specified Date object but Date.getUTCDay() and Date.getDay() can report a new value if the day of the week changes as a result of calling this method.Parametersyear:Number - A four-digit number specifying a year. Two-digit numbers do not represent four-digit years; for example, 99 is not the year 1999, but the year 99.month:Number [optional] - An integer from 0 (January) to 11 (December). If you omit this parameter, the month field of the specified Date object will not be modified.date:Number [optional] - A number from 1 to 31. If you omit this parameter, the date field of the specified Date object will not be modified.ReturnsNumber - An integer.ExampleThe following example initially creates a new Date object, setting the date to May 15, 2004, and uses Date.setFullYear() to change the date to May 15, 2002: var my_date:Date = new Date(2004,4,15trace(my_date.getFullYear() //output: 2004my_date.setFullYear(2002trace(my_date.getFullYear() //output: 2002See alsogetUTCDay (Date.getUTCDay method), getDay (Date.getDay method)" />
   <page href="00005196.html" title="setHours (Date.setHours method)" text="setHours (Date.setHours method)public setHours(hour:Number) : NumberSets the hours for the specified Date object according to local time and returns the new time in milliseconds. Local time is determined by the operating system on which Flash Player is running.Parametershour:Number - An integer from 0 (midnight) to 23 (11 p.m.).ReturnsNumber - An integer.ExampleThe following example initially creates a new Date object, setting the time and date to 8:00 a.m. on May 15, 2004, and uses Date.setHours() to change the time to 4:00 p.m.: var my_date:Date = new Date(2004,4,15,8trace(my_date.getHours() // output: 8my_date.setHours(16trace(my_date.getHours() // output: 16" />
   <page href="00005197.html" title="setMilliseconds (Date.setMilliseconds method)" text="setMilliseconds (Date.setMilliseconds method)public setMilliseconds(millisecond:Number) : NumberSets the milliseconds for the specified Date object according to local time and returns the new time in milliseconds. Local time is determined by the operating system on which Flash Player is running.Parametersmillisecond:Number - An integer from 0 to 999.ReturnsNumber - An integer.ExampleThe following example initially creates a new Date object, setting the date to 8:30 a.m. on May 15, 2004 with the milliseconds value set to 250, and then uses Date.setMilliseconds() to change the milliseconds value to 575: var my_date:Date = new Date(2004,4,15,8,30,0,250trace(my_date.getMilliseconds() // output: 250my_date.setMilliseconds(575trace(my_date.getMilliseconds() // output: 575" />
   <page href="00005198.html" title="setMinutes (Date.setMinutes method)" text="setMinutes (Date.setMinutes method)public setMinutes(minute:Number) : NumberSets the minutes for a specified Date object according to local time and returns the new time in milliseconds. Local time is determined by the operating system on which Flash Player is running.Parametersminute:Number - An integer from 0 to 59.ReturnsNumber - An integer.ExampleThe following example initially creates a new Date object, setting the time and date to 8:00 a.m. on May 15, 2004, and then uses Date.setMinutes() to change the time to 8:30 a.m.: var my_date:Date = new Date(2004,4,15,8,0trace(my_date.getMinutes() // output: 0my_date.setMinutes(30trace(my_date.getMinutes() // output: 30" />
   <page href="00005199.html" title="setMonth (Date.setMonth method)" text="setMonth (Date.setMonth method)public setMonth(month:Number, [date:Number]) : NumberSets the month for the specified Date object in local time and returns the new time in milliseconds. Local time is determined by the operating system on which Flash Player is running.Parametersmonth:Number - An integer from 0 (January) to 11 (December).date:Number [optional] - An integer from 1 to 31. If you omit this parameter, the date field of the specified Date object will not be modified.ReturnsNumber - An integer.ExampleThe following example initially creates a new Date object, setting the date to May 15, 2004, and uses Date.setMonth() to change the date to June 15, 2004: var my_date:Date = new Date(2004,4,15trace(my_date.getMonth() //output: 4my_date.setMonth(5trace(my_date.getMonth() //output: 5" />
   <page href="00005200.html" title="setSeconds (Date.setSeconds method)" text="setSeconds (Date.setSeconds method)public setSeconds(second:Number) : NumberSets the seconds for the specified Date object in local time and returns the new time in milliseconds. Local time is determined by the operating system on which Flash Player is running.Parameterssecond:Number - An integer from 0 to 59.ReturnsNumber - An integer.ExampleThe following example initially creates a new Date object, setting the time and date to 8:00:00 a.m. on May 15, 2004, and uses Date.setSeconds() to change the time to 8:00:45 a.m.: var my_date:Date = new Date(2004,4,15,8,0,0trace(my_date.getSeconds() // output: 0my_date.setSeconds(45trace(my_date.getSeconds() // output: 45" />
   <page href="00005201.html" title="setTime (Date.setTime method)" text="setTime (Date.setTime method)public setTime(millisecond:Number) : NumberSets the date for the specified Date object in milliseconds since midnight on January 1, 1970, and returns the new time in milliseconds.Parametersmillisecond:Number - A number; an integer value where 0 is midnight on January 1, universal time.ReturnsNumber - An integer.ExampleThe following example initially creates a new Date object, setting the time and date to 8:00 a.m. on May 15, 2004, and uses Date.setTime() to change the time to 8:30 a.m.: var my_date:Date = new Date(2004,4,15,8,0,0var myDate_num:Number = my_date.getTime( // convert my_date to millisecondsmyDate_num += 30 * 60 * 1000; // add 30 minutes in millisecondsmy_date.setTime(myDate_num // set my_date Date object 30 minutes forwardtrace(my_date.getFullYear() // output: 2004trace(my_date.getMonth() // output: 4trace(my_date.getDate() // output: 15trace(my_date.getHours() // output: 8trace(my_date.getMinutes() // output: 30" />
   <page href="00005202.html" title="setUTCDate (Date.setUTCDate method)" text="setUTCDate (Date.setUTCDate method)public setUTCDate(date:Number) : NumberSets the date for the specified Date object in universal time and returns the new time in milliseconds. Calling this method does not modify the other fields of the specified Date object, but Date.getUTCDay() and Date.getDay() can report a new value if the day of the week changes as a result of calling this method.Parametersdate:Number - A number; an integer from 1 to 31.ReturnsNumber - An integer.ExampleThe following example initially creates a new Date object with today&#39;s date, uses Date.setUTCDate() to change the date value to 10, and changes it again to 25: var my_date:Date = new Date(my_date.setUTCDate(10trace(my_date.getUTCDate() // output: 10my_date.setUTCDate(25trace(my_date.getUTCDate() // output: 25See alsogetUTCDay (Date.getUTCDay method), getDay (Date.getDay method)" />
   <page href="00005203.html" title="setUTCFullYear (Date.setUTCFullYear method)" text="setUTCFullYear (Date.setUTCFullYear method)public setUTCFullYear(year:Number, [month:Number], [date:Number]) : NumberSets the year for the specified Date object (my_date) in universal time and returns the new time in milliseconds. Optionally, this method can also set the month and date represented by the specified Date object. Calling this method does not modify the other fields of the specified Date object, but Date.getUTCDay() and Date.getDay() can report a new value if the day of the week changes as a result of calling this method. Parametersyear:Number - An integer that represents the year specified as a full four-digit year, such as 2000.month:Number [optional] - An integer from 0 (January) to 11 (December). If you omit this parameter, the month field of the specified Date object will not be modified.date:Number [optional] - An integer from 1 to 31. If you omit this parameter, the date field of the specified Date object will not be modified.ReturnsNumber - An integer.ExampleThe following example initially creates a new Date object with today&#39;s date, uses Date.setUTCFullYear() to change the year value to 2001, and changes the date to May 25, 1995: var my_date:Date = new Date(my_date.setUTCFullYear(2001trace(my_date.getUTCFullYear() // output: 2001my_date.setUTCFullYear(1995, 4, 25trace(my_date.getUTCFullYear() // output: 1995trace(my_date.getUTCMonth() // output: 4trace(my_date.getUTCDate() // output: 25See alsogetUTCDay (Date.getUTCDay method), getDay (Date.getDay method)" />
   <page href="00005204.html" title="setUTCHours (Date.setUTCHours method)" text="setUTCHours (Date.setUTCHours method)public setUTCHours(hour:Number, [minute:Number], [second:Number], [millisecond:Number]) : NumberSets the hour for the specified Date object in universal time and returns the new time in milliseconds.Parametershour:Number - A number; an integer from 0 (midnight) to 23 (11 p.m.).minute:Number [optional] - A number; an integer from 0 to 59. If you omit this parameter, the minutes field of the specified Date object will not be modified.second:Number [optional] - A number; an integer from 0 to 59. If you omit this parameter, the seconds field of the specified Date object will not be modified.millisecond:Number [optional] - A number; an integer from 0 to 999. If you omit this parameter, the milliseconds field of the specified Date object will not be modified.ReturnsNumber - An integer.ExampleThe following example initially creates a new Date object with today&#39;s date, uses Date.setUTCHours() to change the time to 8:30 a.m., and changes the time again to 5:30:47 p.m.: var my_date:Date = new Date(my_date.setUTCHours(8,30trace(my_date.getUTCHours() // output: 8trace(my_date.getUTCMinutes() // output: 30my_date.setUTCHours(17,30,47trace(my_date.getUTCHours() // output: 17trace(my_date.getUTCMinutes() // output: 30trace(my_date.getUTCSeconds() // output: 47" />
   <page href="00005205.html" title="setUTCMilliseconds (Date.setUTCMilliseconds method)" text="setUTCMilliseconds (Date.setUTCMilliseconds method)public setUTCMilliseconds(millisecond:Number) : NumberSets the milliseconds for the specified Date object in universal time and returns the new time in milliseconds.Parametersmillisecond:Number - An integer from 0 to 999.ReturnsNumber - An integer.ExampleThe following example initially creates a new Date object, setting the date to 8:30 a.m. on May 15, 2004 with the milliseconds value set to 250, and uses Date.setUTCMilliseconds() to change the milliseconds value to 575: var my_date:Date = new Date(2004,4,15,8,30,0,250trace(my_date.getUTCMilliseconds() // output: 250my_date.setUTCMilliseconds(575trace(my_date.getUTCMilliseconds() // output: 575" />
   <page href="00005206.html" title="setUTCMinutes (Date.setUTCMinutes method)" text="setUTCMinutes (Date.setUTCMinutes method)public setUTCMinutes(minute:Number, [second:Number], [millisecond:Number]) : NumberSets the minute for the specified Date object in universal time and returns the new time in milliseconds.Parametersminute:Number - An integer from 0 to 59.second:Number [optional] - An integer from 0 to 59. If you omit this parameter, the seconds field of the specified Date object will not be modified.millisecond:Number [optional] - An integer from 0 to 999. If you omit this parameter, the milliseconds field of the specified Date object will not be modified.ReturnsNumber - An integer.ExampleThe following example initially creates a new Date object, setting the time and date to 8:00 a.m. on May 15, 2004, and uses Date.setUTCMinutes() to change the time to 8:30 a.m.: var my_date:Date = new Date(2004,4,15,8,0trace(my_date.getUTCMinutes() // output: 0my_date.setUTCMinutes(30trace(my_date.getUTCMinutes() // output: 30" />
   <page href="00005207.html" title="setUTCMonth (Date.setUTCMonth method)" text="setUTCMonth (Date.setUTCMonth method)public setUTCMonth(month:Number, [date:Number]) : NumberSets the month, and optionally the day, for the specified Date object in universal time and returns the new time in milliseconds. Calling this method does not modify the other fields of the specified Date object, but Date.getUTCDay() and Date.getDay() might report a new value if the day of the week changes as a result of specifying a value for the date parameter.Parametersmonth:Number - An integer from 0 (January) to 11 (December).date:Number [optional] - An integer from 1 to 31. If you omit this parameter, the date field of the specified Date object will not be modified.ReturnsNumber - An integer.ExampleThe following example initially creates a new Date object, setting the date to May 15, 2004, and uses Date.setMonth() to change the date to June 15, 2004: var today_date:Date = new Date(2004,4,15trace(today_date.getUTCMonth() // output: 4today_date.setUTCMonth(5trace(today_date.getUTCMonth() // output: 5See alsogetUTCDay (Date.getUTCDay method), getDay (Date.getDay method)" />
   <page href="00005208.html" title="setUTCSeconds (Date.setUTCSeconds method)" text="setUTCSeconds (Date.setUTCSeconds method)public setUTCSeconds(second:Number, [millisecond:Number]) : NumberSets the seconds for the specified Date object in universal time and returns the new time in milliseconds.Parameterssecond:Number - An integer from 0 to 59.millisecond:Number [optional] - An integer from 0 to 999. If you omit this parameter, the milliseconds field of the specified Date object will not be modified.ReturnsNumber - An integer.ExampleThe following example initially creates a new Date object, setting the time and date to 8:00:00 a.m. on May 15, 2004, and uses Date.setSeconds() to change the time to 8:30:45 a.m.: var my_date:Date = new Date(2004,4,15,8,0,0trace(my_date.getUTCSeconds() // output: 0my_date.setUTCSeconds(45trace(my_date.getUTCSeconds() // output: 45" />
   <page href="00005209.html" title="setYear (Date.setYear method)" text="setYear (Date.setYear method)public setYear(year:Number) : NumberSets the year for the specified Date object in local time and returns the new time in milliseconds. Local time is determined by the operating system on which Flash Player is running.Parametersyear:Number - A number that represents the year. If year is an integer between 0 and 99, setYear sets the year at 1900 + year; otherwise, the year is the value of the year parameter.ReturnsNumber - An integer.ExampleThe following example creates a new Date object with the date set to May 25, 2004, uses setYear() to change the year to 1999, and changes the year to 2003: var my_date:Date = new Date(2004,4,25trace(my_date.getYear() // output: 104trace(my_date.getFullYear() // output: 2004my_date.setYear(99trace(my_date.getYear() // output: 99trace(my_date.getFullYear() // output: 1999my_date.setYear(2003trace(my_date.getYear() // output: 103trace(my_date.getFullYear() // output: 2003" />
   <page href="00005210.html" title="toString (Date.toString method)" text="toString (Date.toString method)public toString() : StringReturns a string value for the specified date object in a readable format.ReturnsString - A string.ExampleThe following example returns the information in the dateOfBirth_date Date object as a string. The output from the trace statements are in local time and vary accordingly. For Pacific Daylight Time the output is seven hours earlier than universal time: Mon Aug 12 18:15:00 GMT-0700 1974. var dateOfBirth_date:Date = new Date(74, 7, 12, 18, 15trace (dateOfBirth_datetrace (dateOfBirth_date.toString()" />
   <page href="00005211.html" title="UTC (Date.UTC method)" text="UTC (Date.UTC method)public static UTC(year:Number, month:Number, [date:Number], [hour:Number], [minute:Number], [second:Number], [millisecond:Number]) : NumberReturns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters. This is a static method that is invoked through the Date object constructor, not through a specific Date object. This method lets you create a Date object that assumes universal time, whereas the Date constructor assumes local time.Parametersyear:Number - A four-digit integer that represents the year (for example, 2000).month:Number - An integer from 0 (January) to 11 (December).date:Number [optional] - An integer from 1 to 31.hour:Number [optional] - An integer from 0 (midnight) to 23 (11 p.m.).minute:Number [optional] - An integer from 0 to 59.second:Number [optional] - An integer from 0 to 59.millisecond:Number [optional] - An integer from 0 to 999.ReturnsNumber - An integer.ExampleThe following example creates a new maryBirthday_date Date object defined in universal time. This is the universal time variation of the example used for the new Date constructor method. The output is in local time and varies accordingly. For Pacific Daylight Time the output is seven hours earlier than UTC: Sun Aug 11 17:00:00 GMT-0700 1974. var maryBirthday_date:Date = new Date(Date.UTC(1974, 7, 12)trace(maryBirthday_date " />
   <page href="00005212.html" title="valueOf (Date.valueOf method)" text="valueOf (Date.valueOf method)public valueOf() : NumberReturns the number of milliseconds since midnight January 1, 1970, universal time, for this Date.ReturnsNumber - The number of milliseconds." />
   <page href="00005213.html" title="Error" text="ModifiersPropertyDescriptionmessage:StringContains the message associated with the Error object.name:StringContains the name of the Error object.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)SignatureDescriptionError([message:String])Creates a new Error object.ModifiersSignatureDescriptiontoString() : StringReturns the string &quot;Error&quot; by default or the value contained in Error.message, if defined.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)ErrorObject | +-Errorpublic class Errorextends ObjectContains information about an error that occurred in a script. You create an Error object using the Error constructor function. Typically, you throw a new Error object from within a try code block that is then caught by a catch or finally code block. You can also create a subclass of the Error class and throw instances of that subclass.Property summaryProperties inherited from class ObjectConstructor summaryMethod summaryMethods inherited from class Object" />
   <page href="00005214.html" title="Error constructor" text="Error constructorpublic Error([message:String])Creates a new Error object. If message is specified, its value is assigned to the objects Error.message property.Parametersmessage:String [optional] - A string associated with the Error object.ExampleIn the following example, a function throws an error (with a specified message) if the two strings that are passed to it are not identical: function compareStrings(str1_str:String, str2_str:String):Void { if (str1_str != str2_str) { throw new Error(&quot;Strings do not match.&quot; }}try { compareStrings(&quot;Dog&quot;, &quot;dog&quot; // output: Strings do not match.} catch (e_err:Error) { trace(e_err.toString()}See alsothrow statement, try..catch..finally statement" />
   <page href="00005215.html" title="message (Error.message property)" text="message (Error.message property)public message : StringContains the message associated with the Error object. By default, the value of this property is &quot;Error&quot;. You can specify a message property when you create an Error object by passing the error string to the Error constructor function.ExampleIn the following example, a function throws a specified message depending on the parameters entered into theNum. If two numbers can be divided, SUCCESS and the number are shown. Specific errors are shown if you try to divide by 0 or enter only 1 parameter: function divideNum(num1:Number, num2:Number):Number { if (isNaN(num1) || isNaN(num2)) { throw new Error(&quot;divideNum function requires two numeric parameters.&quot; } else if (num2 == 0) { throw new Error(&quot;cannot divide by zero.&quot; } return num1/num2;}try { var theNum:Number = divideNum(1, 0 trace(&quot;SUCCESS! &quot;+theNum} catch (e_err:Error) { trace(&quot;ERROR! &quot;+e_err.message trace(&quot; t&quot;+e_err.name} If you test this ActionScript without any modifications to the numbers you divide, you see an error displayed in the Output panel because you are trying to divide by 0.See alsothrow statement, try..catch..finally statement" />
   <page href="00005216.html" title="name (Error.name property)" text="name (Error.name property)public name : StringContains the name of the Error object. By default, the value of this property is &quot;Error&quot;.ExampleIn the following example, a function throws a specified error depending on the two numbers that you try to divide. Add the following ActionScript to Frame 1 of the Timeline: function divideNumber(numerator:Number, denominator:Number):Number { if (isNaN(numerator) || isNaN(denominator)) { throw new Error(&quot;divideNum function requires two numeric parameters.&quot; } else if (denominator == 0) { throw new DivideByZeroError( } return numerator/denominator;}try { var theNum:Number = divideNumber(1, 0 trace(&quot;SUCCESS! &quot;+theNum // output: DivideByZeroError -&gt; Unable to divide by zero.} catch (e_err:DivideByZeroError) { // divide by zero error occurred trace(e_err.name+&quot; -&gt; &quot;+e_err.toString()} catch (e_err:Error) { // generic error occurred trace(e_err.name+&quot; -&gt; &quot;+e_err.toString()}To add a custom error, add the following code to a .AS file called DivideByZeroError.as and save the class file in the same directory as your FLA document.class DivideByZeroError extends Error { var name:String = &quot;DivideByZeroError&quot;; var message:String = &quot;Unable to divide by zero.&quot;;}See alsothrow statement, try..catch..finally statement" />
   <page href="00005217.html" title="toString (Error.toString method)" text="toString (Error.toString method)public toString() : StringReturns the string &quot;Error&quot; by default or the value contained in Error.message, if defined.ReturnsString - A StringExampleIn the following example, a function throws an error (with a specified message) if the two strings that are passed to it are not identical: function compareStrings(str1_str:String, str2_str:String):Void {if (str1_str != str2_str) { throw new Error(&quot;Strings do not match.&quot; }}try { compareStrings(&quot;Dog&quot;, &quot;dog&quot; // output: Strings do not match.} catch (e_err:Error) { trace(e_err.toString()}See alsomessage (Error.message property), throw statement, try..catch..finally statement" />
   <page href="00005218.html" title="ExtendedKey" text="ModifiersPropertyDescriptionstaticSOFT1:StringThe key code value for the SOFT1 soft key.staticSOFT10:StringThe key code value for the SOFT10 soft key.staticSOFT11:StringThe key code value for the SOFT11 soft key.staticSOFT12:StringThe key code value for the SOFT12 soft key.staticSOFT2:StringThe key code value for the SOFT2 soft key.staticSOFT3:StringThe key code value for the SOFT3 soft key.staticSOFT4:StringThe key code value for the SOFT4 soft key.staticSOFT5:StringThe key code value for the SOFT5 soft key.staticSOFT6:StringThe key code value for the SOFT6 soft key.staticSOFT7:StringThe key code value for the SOFT7 soft key.staticSOFT8:StringThe key code value for the SOFT8 soft key.staticSOFT9:StringThe key code value for the SOFT9 soft key.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)ExtendedKeyObject | +-ExtendedKeypublic class ExtendedKeyextends ObjectProvides extended key codes that can be returned from the Key.getCode() method.ExampleThe following example creates a listener that is called when a key is pressed. It uses the Key.getCode() method to get the key code for the key that was pressed: var myListener = new Object(myListener.onKeyDown = function() { var code = Key.getCode( switch(code) { case 50: trace(&quot;number 2 down&quot; break; case Key.ENTER: trace(&quot;enter down&quot; break; case ExtendedKey.SOFT1: trace(&quot;soft1 down&quot; break; default: trace(code + &quot; down&quot; break; }}myListener.onKeyUp = function() { text2 = &quot;onKeyUp called&quot;;}Key.addListener(myListenerSee alsogetCode (Key.getCode method)Property summaryProperties inherited from class ObjectMethod summaryMethods inherited from class Object" />
   <page href="00005219.html" title="SOFT1 (ExtendedKey.SOFT1 property)" text="SOFT1 (ExtendedKey.SOFT1 property)public static SOFT1 : StringThe key code value for the SOFT1 soft key. The SOFT1 key code always corresponds to the left soft key; the SOFT2 always corresponds to the right soft key.ExampleThe following example creates a listener that handles the left and right soft keys: var myListener:Object = new Object(myListener.onKeyDown = function () {var keyCode = Key.getCode(switch (keyCode) { case ExtendedKey.SOFT1: // Handle left soft key. break; case ExtendedKey.SOFT2: // Handle right soft key break; }}Key.addListener(myListener " />
   <page href="00005220.html" title="SOFT10 (ExtendedKey.SOFT10 property)" text="SOFT10 (ExtendedKey.SOFT10 property)public static SOFT10 : StringThe key code value for the SOFT10 soft key." />
   <page href="00005221.html" title="SOFT11 (ExtendedKey.SOFT11 property)" text="SOFT11 (ExtendedKey.SOFT11 property)public static SOFT11 : StringThe key code value for the SOFT11 soft key." />
   <page href="00005222.html" title="SOFT12 (ExtendedKey.SOFT12 property)" text="SOFT12 (ExtendedKey.SOFT12 property)public static SOFT12 : StringThe key code value for the SOFT12 soft key." />
   <page href="00005223.html" title="SOFT2 (ExtendedKey.SOFT2 property)" text="SOFT2 (ExtendedKey.SOFT2 property)public static SOFT2 : StringThe key code value for the SOFT2 soft key. The SOFT2 key code always corresponds to the right soft key; the SOFT1 key code always corresponds to the left soft key.See alsoSOFT1 (ExtendedKey.SOFT1 property)" />
   <page href="00005224.html" title="SOFT3 (ExtendedKey.SOFT3 property)" text="SOFT3 (ExtendedKey.SOFT3 property)public static SOFT3 : StringThe key code value for the SOFT3 soft key." />
   <page href="00005225.html" title="SOFT4 (ExtendedKey.SOFT4 property)" text="SOFT4 (ExtendedKey.SOFT4 property)public static SOFT4 : StringThe key code value for the SOFT4 soft key." />
   <page href="00005226.html" title="SOFT5 (ExtendedKey.SOFT5 property)" text="SOFT5 (ExtendedKey.SOFT5 property)public static SOFT5 : StringThe key code value for the SOFT5 soft key." />
   <page href="00005227.html" title="SOFT6 (ExtendedKey.SOFT6 property)" text="SOFT6 (ExtendedKey.SOFT6 property)public static SOFT6 : StringThe key code value for the SOFT6 soft key." />
   <page href="00005228.html" title="SOFT7 (ExtendedKey.SOFT7 property)" text="SOFT7 (ExtendedKey.SOFT7 property)public static SOFT7 : StringThe key code value for the SOFT7 soft key." />
   <page href="00005229.html" title="SOFT8 (ExtendedKey.SOFT8 property)" text="SOFT8 (ExtendedKey.SOFT8 property)public static SOFT8 : StringThe key code value for the SOFT8 soft key." />
   <page href="00005230.html" title="SOFT9 (ExtendedKey.SOFT9 property)" text="SOFT9 (ExtendedKey.SOFT9 property)public static SOFT9 : StringThe key code value for the SOFT9 soft key." />
   <page href="00005231.html" title="Function" text="constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)ModifiersSignatureDescriptionapply(thisObject:Object, [argArray:Array])Specifies the value of thisObject to be used within any function that ActionScript calls.call(thisObject:Object, [parameter1:Object])Invokes the function represented by a Function object.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)FunctionObject | +-Functionpublic dynamic class Functionextends ObjectBoth user-defined and built-in functions in ActionScript are represented by Function objects, which are instances of the Function class.Property summaryProperties inherited from class ObjectMethod summaryMethods inherited from class Object" />
   <page href="00005232.html" title="apply (Function.apply method)" text="apply (Function.apply method)public apply(thisObject:Object, [argArray:Array])Specifies the value of thisObject to be used within any function that ActionScript calls. This method also specifies the parameters to be passed to any called function. Because apply() is a method of the Function class, it is also a method of every Function object in ActionScript. The parameters are specified as an Array object, unlike Function.call(), which specifies parameters as a comma-delimited list. This is often useful when the number of parameters to be passed is not known until the script actually executes.Returns the value that the called function specifies as the return value.ParametersthisObject:Object - The object to which myFunction is applied.argArray:Array [optional] - An array whose elements are passed to myFunction as parameters.ReturnsAny value that the called function specifies.ExampleThe following function invocations are equivalent: Math.atan2(1, 0)Math.atan2.apply(null, [1, 0])The following simple example shows how apply() passes an array of parameters:function theFunction() { trace(arguments}// create a new array to pass as a parameter to apply()var firstArray:Array = new Array(1,2,3theFunction.apply(null,firstArray// outputs: 1,2,3// create a second array to pass as a parameter to apply()var secondArray:Array = new Array(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;theFunction.apply(null,secondArray// outputs a,b,cThe following example shows how apply() passes an array of parameters and specifies the value of this:// define a function function theFunction() { trace(&quot;this == myObj? &quot; + (this == myObj) trace(&quot;arguments: &quot; + arguments}// instantiate an objectvar myObj:Object = new Object(// create arrays to pass as a parameter to apply()var firstArray:Array = new Array(1,2,3var secondArray:Array = new Array(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;// use apply() to set the value of this to be myObj and send firstArraytheFunction.apply(myObj,firstArray// output: // this == myObj? true// arguments: 1,2,3// use apply() to set the value of this to be myObj and send secondArraytheFunction.apply(myObj,secondArray// output: // this == myObj? true// arguments: a,b,cSee alsocall (Function.call method)" />
   <page href="00005233.html" title="call (Function.call method)" text="call (Function.call method)public call(thisObject:Object, [parameter1:Object])Invokes the function represented by a Function object. Every function in ActionScript is represented by a Function object, so all functions support this method. In almost all cases, the function call (()) operator can be used instead of this method. The function call operator produces code that is concise and readable. This method is primarily useful when the thisObject parameter of the function invocation needs to be explicitly controlled. Normally, if a function is invoked as a method of an object, within the body of the function, thisObject is set to myObject, as shown in the following example:myObject.myMethod(1, 2, 3In some situations, you might want thisObject to point somewhere else; for example, if a function must be invoked as a method of an object, but is not actually stored as a method of that object:myObject.myMethod.call(myOtherObject, 1, 2, 3 You can pass the value null for the thisObject parameter to invoke a function as a regular function and not as a method of an object. For example, the following function invocations are equivalent:Math.sin(Math.PI / 4)Math.sin.call(null, Math.PI / 4)Returns the value that the called function specifies as the return value.ParametersthisObject:Object - An object that specifies the value of thisObject within the function body.parameter1:Object [optional] - A parameter to be passed to the myFunction. You can specify zero or more parameters.ReturnsExampleThe following example uses Function.call() to make a function behave as a method of another object, without storing the function in the object: function myObject() {}function myMethod(obj) { trace(&quot;this == obj? &quot; + (this == obj)}var obj:Object = new myObject(myMethod.call(obj, objThe trace() statement displays:this == obj? trueSee alsoapply (Function.apply method)" />
   <page href="00005234.html" title="Key" text="ModifiersPropertyDescriptionstaticBACKSPACE:NumberThe key code value for the Backspace key (8).staticCAPSLOCK:NumberThe key code value for the Caps Lock key (20).staticCONTROL:NumberThe key code value for the Control key (17).staticDELETEKEY:NumberThe key code value for the Delete key (46).staticDOWN:NumberThe key code value for the Down Arrow key (40).staticEND:NumberThe key code value for the End key (35).staticENTER:NumberThe key code value for the Enter key (13)..staticESCAPE:NumberThe key code value for the Escape key (27).staticHOME:NumberThe key code value for the Home key (36).staticINSERT:NumberThe key code value for the Insert key (45).staticLEFT:NumberThe key code value for the Left Arrow key (37).static_listeners:Array [read-only]A list of references to all listener objects registered with the Key object.staticPGDN:NumberThe key code value for the Page Down key (34).staticPGUP:NumberThe key code value for the Page Up key (33).staticRIGHT:NumberThe key code value for the Right Arrow key (39).staticSHIFT:NumberThe key code value for the Shift key (16).staticSPACE:NumberThe key code value for the Spacebar (32).staticTAB:NumberThe key code value for the Tab key (9).staticUP:NumberThe key code value for the Up Arrow key (38).constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)EventDescriptiononKeyDown = function() {}Notified when a key is pressed.onKeyUp = function() {}Notified when a key is released.ModifiersSignatureDescriptionstaticaddListener(listener:Object) : VoidRegisters an object to receive onKeyDown and onKeyUp notification.staticgetAscii() : NumberReturns the ASCII code of the last key pressed or released.staticgetCode() : NumberReturns the key code value of the last key pressed.staticisDown(code:Number) : BooleanReturns true if the key specified in code is pressed; false otherwise.staticremoveListener(listener:Object) : BooleanRemoves an object previously registered with Key.addListener().addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)KeyObject | +-Keypublic class Keyextends ObjectThe Key class is a top-level class whose methods and properties you can use without a constructor. Use the methods of the Key class to build an interface that can be controlled by a user with a standard keyboard. The properties of the Key class are constants representing the keys most commonly used to control applications, such as Arrow keys, Page Up, and Page Down.See alsoExtendedKeyProperty summaryProperties inherited from class ObjectEvent summaryMethod summaryMethods inherited from class Object" />
   <page href="00005235.html" title="addListener (Key.addListener method)" text="addListener (Key.addListener method)public static addListener(listener:Object) : VoidRegisters an object to receive onKeyDown and onKeyUp notification. When a key is pressed or released, regardless of the input focus, all listening objects registered with addListener() have either their onKeyDown method or their onKeyUp method invoked. Multiple objects can listen for keyboard notifications. If the listener is already registered, no change occurs.Parameterslistener:Object - An object with onKeyDown and onKeyUp methods.ExampleThe following example creates a new listener object and defines a function for onKeyDown and onKeyUp. The last line uses addListener() to register the listener with the Key object so that it can receive notification from the key down and key up events. var myListener:Object = new Object(myListener.onKeyDown = function () { trace (&quot;You pressed a key.&quot;}myListener.onKeyUp = function () { trace (&quot;You released a key.&quot;}Key.addListener(myListenerSee alsogetCode (Key.getCode method), isDown (Key.isDown method), onKeyDown (Key.onKeyDown event listener), onKeyUp (Key.onKeyUp event listener), removeListener (Key.removeListener method)" />
   <page href="00005236.html" title="BACKSPACE (Key.BACKSPACE property)" text="BACKSPACE (Key.BACKSPACE property)public static BACKSPACE : NumberThe key code value for the Backspace key (8).ExampleThe following example creates a new listener object and defines a function for onKeyDown. The last line uses addListener() to register the listener with the Key object so that it can receive notification from the key down event. var keyListener:Object = new Object(keyListener.onKeyDown = function() { if (Key.isDown(Key.BACKSPACE)) { trace(&quot;you pressed the Backspace key.&quot; } else { trace(&quot;you DIDN&#39;T press the Backspace key.&quot; }};Key.addListener(keyListenerWhen using this example, make sure that you select Control &gt; Disable Keyboard Shortcuts in the test environment." />
   <page href="00005237.html" title="CAPSLOCK (Key.CAPSLOCK property)" text="CAPSLOCK (Key.CAPSLOCK property)public static CAPSLOCK : NumberThe key code value for the Caps Lock key (20)." />
   <page href="00005238.html" title="CONTROL (Key.CONTROL property)" text="CONTROL (Key.CONTROL property)public static CONTROL : NumberThe key code value for the Control key (17)." />
   <page href="00005239.html" title="DELETEKEY (Key.DELETEKEY property)" text="DELETEKEY (Key.DELETEKEY property)public static DELETEKEY : NumberThe key code value for the Delete key (46).ExampleThe 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(&quot;canvas_mc&quot;, 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(keyListenerWhen using this example, make sure that you select Control &gt; Disable Keyboard Shortcuts in the test environment." />
   <page href="00005240.html" title="DOWN (Key.DOWN property)" text="DOWN (Key.DOWN property)public static DOWN : NumberThe key code value for the Down Arrow key (40).ExampleThe 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(&quot;horn_id&quot;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" />
   <page href="00005241.html" title="END (Key.END property)" text="END (Key.END property)public static END : NumberThe key code value for the End key (35)." />
   <page href="00005242.html" title="ENTER (Key.ENTER property)" text="ENTER (Key.ENTER property)public static ENTER : NumberThe key code value for the Enter key (13)..ExampleThe following example moves a movie clip called car_mc a constant distance (10) when you press the arrow keys. The car_mc instance stops when you press Enter and delete the onEnterFrame event. var DISTANCE:Number = 5;var keyListener:Object = new Object(keyListener.onKeyDown = function() { switch (Key.getCode()) { case Key.LEFT : car_mc.onEnterFrame = function() { this._x -= DISTANCE; }; break; case Key.UP : car_mc.onEnterFrame = function() { this._y -= DISTANCE; }; break; case Key.RIGHT : car_mc.onEnterFrame = function() { this._x += DISTANCE; }; break; case Key.DOWN : car_mc.onEnterFrame = function() { this._y += DISTANCE; }; break; case Key.ENTER : delete car_mc.onEnterFrame; break; }};Key.addListener(keyListenerWhen using this example, make sure that you select Control &gt; Disable Keyboard Shortcuts in the test environment." />
   <page href="00005243.html" title="ESCAPE (Key.ESCAPE property)" text="ESCAPE (Key.ESCAPE property)public static ESCAPE : NumberThe key code value for the Escape key (27).ExampleThe following example sets a timer. When you press Escape, the Output panel displays information that includes how long it took you to press the key. var keyListener:Object = new Object(keyListener.onKeyDown = function() { if (Key.isDown(Key.ESCAPE)) { // get the current timer, convert the value to seconds and round it to two decimal places. var timer:Number = Math.round(getTimer()/10)/100; trace(&quot;you pressed the Esc key: &quot;+getTimer()+&quot; ms (&quot;+timer+&quot; s)&quot; }};Key.addListener(keyListenerWhen using this example, make sure that you select Control &gt; Disable Keyboard Shortcuts in the test environment." />
   <page href="00005244.html" title="getAscii (Key.getAscii method)" text="getAscii (Key.getAscii method)public static getAscii() : NumberReturns the ASCII code of the last key pressed or released. The ASCII values returned are English keyboard values. For example, if you press Shift+2, Key.getAscii() returns @ on a Japanese keyboard, which is the same as it does on an English keyboard.ReturnsNumber - The ASCII value of the last key pressed. This method returns 0 if no key was pressed or released, or if the ASCII value is not accessible for security reasons.ExampleThe following example calls the getAscii() 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.getAscii(). 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. var keyListener:Object = new Object(keyListener.onKeyDown = function() { trace(&quot;The ASCII code for the last key typed is: &quot;+Key.getAscii()};Key.addListener(keyListenerWhen using this example, make sure that you select Control &gt; Disable Keyboard Shortcuts in the test environment.The following example adds a call to Key.getAscii() to show how getAscii() and getCode() 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(&quot;For the last key typed:&quot; trace(&quot; tThe Key code is: &quot;+Key.getCode() trace(&quot; tThe ASCII value is: &quot;+Key.getAscii() trace(&quot;&quot;};Key.addListener(keyListenerWhen using this example, make sure that you select Control &gt; Disable Keyboard Shortcuts in the test environment." />
   <page href="00005245.html" title="getCode (Key.getCode method)" text="getCode (Key.getCode method)public static getCode() : NumberReturns the key code value of the last key pressed. Note: The Flash Lite implementation of this method returns a string or a number, depending on the key code passed in by the platform. The only valid key codes are the standard key codes accepted by this class and the special key codes listed as properties of the ExtendedKey class.ReturnsNumber - The key code of the last key pressed. This method returns 0 if no key was pressed or released, or if the key code is not accessible for security reasons.ExampleThe 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(). 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. var keyListener:Object = new Object(keyListener.onKeyDown = function() { // Compare return value of getCode() to constant if (Key.getCode() == Key.ENTER) { trace (&quot;Virtual key code: &quot;+Key.getCode()+&quot; (ENTER key)&quot; }  else { trace(&quot;Virtual key code: &quot;+Key.getCode() }};Key.addListener(keyListenerWhen using this example, make sure that you select Control &gt; 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(&quot;For the last key typed:&quot; trace(&quot; tThe Key code is: &quot;+Key.getCode() trace(&quot; tThe ASCII value is: &quot;+Key.getAscii() trace(&quot;&quot;};Key.addListener(keyListenerWhen using this example, make sure that you select Control &gt; Disable Keyboard Shortcuts in the test environment.See alsogetAscii (Key.getAscii method)" />
   <page href="00005246.html" title="HOME (Key.HOME property)" text="HOME (Key.HOME property)public static HOME : NumberThe key code value for the Home key (36).ExampleThe 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(&quot;car_id&quot;, &quot;car_mc&quot;, 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" />
   <page href="00005247.html" title="INSERT (Key.INSERT property)" text="INSERT (Key.INSERT property)public static INSERT : NumberThe key code value for the Insert key (45).ExampleThe following example creates a new listener object and defines a function for onKeyDown. The last line uses addListener() to register the listener with the Key object so that it can receive notification from the key down event and display information in the Output panel. var keyListener:Object = new Object(keyListener.onKeyDown = function() { if (Key.isDown(Key.INSERT)) { trace(&quot;You pressed the Insert key.&quot; }};Key.addListener(keyListener" />
   <page href="00005248.html" title="isDown (Key.isDown method)" text="isDown (Key.isDown method)public static isDown(code:Number) : BooleanReturns true if the key specified in code is pressed; false otherwise.Parameterscode:Number - The key code value assigned to a specific key or a Key class property associated with a specific key.ReturnsBoolean - The value true if the key specified in code is pressed; false otherwise.ExampleThe following script lets the user control the location of a movie clip (car_mc): car_mc.onEnterFrame = function() { if (Key.isDown(Key.RIGHT)) { this._x += 10; } else if (Key.isDown(Key.LEFT)) { this._x -= 10; }};" />
   <page href="00005249.html" title="LEFT (Key.LEFT property)" text="LEFT (Key.LEFT property)public static LEFT : NumberThe key code value for the Left Arrow key (37).ExampleThe 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(&quot;horn_id&quot;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" />
   <page href="00005250.html" title="_listeners (Key._listeners property)" text="_listeners (Key._listeners property)public static _listeners : Array [read-only]A list of references to all listener objects registered with the Key object. This property is intended for internal use, but may be useful if you want to ascertain the number of listeners currently registered with the Key object. Objects are added and removed from this array by calls to the addListener() and removelistener() methods.ExampleThe following example shows how to use the length property to ascertain the number of listener objects currently registered to the Key object.  var myListener:Object = new Object( myListener.onKeyDown = function () { trace (&quot;You pressed a key.&quot; } Key.addListener(myListener  trace(Key._listeners.length // Output: 1 " />
   <page href="00005251.html" title="onKeyDown (Key.onKeyDown event listener)" text="onKeyDown (Key.onKeyDown event listener)onKeyDown = function() {}Notified when a key is pressed. To use onKeyDown, you must create a listener object. You can then define a function for onKeyDown and use addListener() to register the listener with the Key object, as shown in the following example: var keyListener:Object = new Object(keyListener.onKeyDown = function() { trace(&quot;DOWN -&gt; Code: &quot;+Key.getCode()+&quot; tACSII: &quot;+Key.getAscii()+&quot; tKey: &quot;+chr(Key.getAscii())};keyListener.onKeyUp = function() { trace(&quot;UP -&gt; Code: &quot;+Key.getCode()+&quot; tACSII: &quot;+Key.getAscii()+&quot; tKey: &quot;+chr(Key.getAscii())};Key.addListener(keyListenerListeners enable different pieces of code to cooperate because multiple listeners can receive notification about a single event.See alsoaddListener (Key.addListener method)" />
   <page href="00005252.html" title="onKeyUp (Key.onKeyUp event listener)" text="onKeyUp (Key.onKeyUp event listener)onKeyUp = function() {}Notified when a key is released. To use onKeyUp, you must create a listener object. You can then define a function for onKeyUp and use addListener() to register the listener with the Key object, as shown in the following example: var keyListener:Object = new Object(keyListener.onKeyDown = function() { trace(&quot;DOWN -&gt; Code: &quot;+Key.getCode()+&quot; tACSII: &quot;+Key.getAscii()+&quot; tKey: &quot;+chr(Key.getAscii())};keyListener.onKeyUp = function() { trace(&quot;UP -&gt; Code: &quot;+Key.getCode()+&quot; tACSII: &quot;+Key.getAscii()+&quot; tKey: &quot;+chr(Key.getAscii())};Key.addListener(keyListenerListeners enable different pieces of code to cooperate because multiple listeners can receive notification about a single event.See alsoaddListener (Key.addListener method)" />
   <page href="00005253.html" title="PGDN (Key.PGDN property)" text="PGDN (Key.PGDN property)public static PGDN : NumberThe key code value for the Page Down key (34).ExampleThe following example rotates a movie clip called car_mc when you press the Page Down and Page Up keys. var keyListener:Object = new Object(keyListener.onKeyDown = function() { if (Key.isDown(Key.PGDN)) { car_mc._rotation += 5; } else if (Key.isDown(Key.PGUP)) { car_mc._rotation -= 5; }};Key.addListener(keyListener" />
   <page href="00005254.html" title="PGUP (Key.PGUP property)" text="PGUP (Key.PGUP property)public static PGUP : NumberThe key code value for the Page Up key (33).ExampleThe following example rotates a movie clip called car_mc when you press the Page Down and Page Up keys. var keyListener:Object = new Object(keyListener.onKeyDown = function() { if (Key.isDown(Key.PGDN)) { car_mc._rotation += 5; } else if (Key.isDown(Key.PGUP)) { car_mc._rotation -= 5; }};Key.addListener(keyListener" />
   <page href="00005255.html" title="removeListener (Key.removeListener method)" text="removeListener (Key.removeListener method)public static removeListener(listener:Object) : BooleanRemoves an object previously registered with Key.addListener().Parameterslistener:Object - An object.ReturnsBoolean - If the listener was successfully removed, the method returns true. If the listener was not successfully removed (for example, because the listener was not on the Key objects listener list), the method returns false.ExampleThe following example moves a movie clip called car_mc using the Left and Right arrow keys. The listener is removed when you press Escape, and car_mc no longer moves. var keyListener:Object = new Object(keyListener.onKeyDown = function() { switch (Key.getCode()) { case Key.LEFT : car_mc._x -= 10; break; case Key.RIGHT : car_mc._x += 10; break; case Key.ESCAPE : Key.removeListener(keyListener }};Key.addListener(keyListener" />
   <page href="00005256.html" title="RIGHT (Key.RIGHT property)" text="RIGHT (Key.RIGHT property)public static RIGHT : NumberThe key code value for the Right Arrow key (39).ExampleThe 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(&quot;horn_id&quot;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" />
   <page href="00005257.html" title="SHIFT (Key.SHIFT property)" text="SHIFT (Key.SHIFT property)public static SHIFT : NumberThe key code value for the Shift key (16).ExampleThe following example scales car_mc when you press Shift. var keyListener:Object = new Object(keyListener.onKeyDown = function() { if (Key.isDown(Key.SHIFT)) { car_mc._xscale = 2; car_mc._yscale = 2; } else if (Key.isDown(Key.CONTROL)) { car_mc._xscale /= 2; car_mc._yscale /= 2; }};Key.addListener(keyListener" />
   <page href="00005258.html" title="SPACE (Key.SPACE property)" text="SPACE (Key.SPACE property)public static SPACE : NumberThe key code value for the Spacebar (32).ExampleThe 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(&quot;horn_id&quot;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" />
   <page href="00005259.html" title="TAB (Key.TAB property)" text="TAB (Key.TAB property)public static TAB : NumberThe key code value for the Tab key (9).ExampleThe following example creates a text field, and displays the date in the text field when you press Tab. this.createTextField(&quot;date_txt&quot;, this.getNextHighestDepth(), 0, 0, 100, 22date_txt.autoSize = true;var keyListener:Object = new Object(keyListener.onKeyDown = function() { if (Key.isDown(Key.TAB)) { var today_date:Date = new Date( date_txt.text = today_date.toString( }};Key.addListener(keyListenerWhen using this example, make sure that you select Control &gt; Disable Keyboard Shortcuts in the test environment." />
   <page href="00005260.html" title="UP (Key.UP property)" text="UP (Key.UP property)public static UP : NumberThe key code value for the Up Arrow key (38).ExampleThe 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(&quot;horn_id&quot;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" />
   <page href="00005261.html" title="LoadVars" text="ModifiersPropertyDescriptioncontentType:StringThe MIME type that is sent to the server when you call LoadVars.send() or LoadVars.sendAndLoad().loaded:BooleanA Boolean value that indicates whether a load or sendAndLoad operation has completed, undefined by default.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)EventDescriptiononData = function(src:String) {}Invoked when data has completely downloaded from the server or when an error occurs while data is downloading from a server.onLoad = function(success:Boolean) {}Invoked when a LoadVars.load() or LoadVars.sendAndLoad() operation has ended.SignatureDescriptionLoadVars()Creates a LoadVars object.ModifiersSignatureDescriptionaddRequestHeader(header:Object, headerValue:String) : VoidAdds or changes HTTP request headers (such as Content-Type or SOAPAction) sent with POST actions.decode(queryString:String) : VoidConverts the variable string to properties of the specified LoadVars object.getBytesLoaded() : NumberReturns the number of bytes downloaded by LoadVars.load() or LoadVars.sendAndLoad().getBytesTotal() : NumberReturns the total number of bytes downloaded by LoadVars.load() or LoadVars.sendAndLoad().load(url:String) : BooleanDownloads variables from the specified URL, parses the variable data, and places the resulting variables into my_lv.send(url:String, target:String, [method:String]) : BooleanSends the variables in the my_lv object to the specified URL.sendAndLoad(url:String, target:Object, [method:String]) : BooleanPosts variables in the my_lv object to the specified URL.toString() : StringReturns a string containing all enumerable variables in my_lv, in the MIME content encoding application/x-www-form-urlencoded.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)LoadVarsObject | +-LoadVarspublic dynamic class LoadVarsextends ObjectYou can use the LoadVars class to obtain verification of successful data loading and to monitor download progress. The LoadVars class is an alternative to the loadVariables() function for transferring variables between a Flash application and a server. The LoadVars class lets you send all the variables in an object to a specified URL and load all the variables at a specified URL into an object. It also lets you send specific variables, rather than all the variables, which can make your application more efficient. You can use the LoadVars.onLoad handler to ensure that your application runs when data is loaded, and not before.The LoadVars class works much like the XML class; it uses the methods load(), send(), and sendAndLoad() to communicate with a server. The main difference between the LoadVars class and the XML class is that LoadVars transfers ActionScript name and value pairs, rather than an XML DOM tree stored in the XML object. The LoadVars class follows the same security restrictions as the XML class.See alsoloadVariables function, onLoad (LoadVars.onLoad handler), hasXMLSocket (capabilities.hasXMLSocket property)Property summaryProperties inherited from class ObjectEvent summaryConstructor summaryMethod summaryMethods inherited from class Object" />
   <page href="00005262.html" title="addRequestHeader (LoadVars.addRequestHeader method)" text="addRequestHeader (LoadVars.addRequestHeader method)public addRequestHeader(header:Object, headerValue:String) : VoidAdds or changes HTTP request headers (such as Content-Type or SOAPAction) sent with POST actions. In the first usage, you pass two strings to the method: header and headerValue. In the second usage, you pass an array of strings, alternating header names and header values. If multiple calls are made to set the same header name, each successive value will replace the value set in the previous call.The following standard HTTP headers cannot be added or changed with this method: Accept-Ranges, Age, Allow, Allowed, Connection, Content-Length, Content-Location, Content-Range, ETag, Host, Last-Modified, Locations, Max-Forwards, Proxy-Authenticate, Proxy-Authorization, Public, Range, Retry-After, Server, TE, Trailer, Transfer-Encoding, Upgrade, URI, Vary, Via, Warning, and WWW-Authenticate.Parametersheader:Object - A string or array of strings that represents an HTTP request header name.headerValue:String - A string that represents the value associated with header.ExampleThe following example adds a custom HTTP header named SOAPAction with a value of Foo to the my_lv object: my_lv.addRequestHeader(&quot;SOAPAction&quot;, &quot;&#39;Foo&#39;&quot;The following example creates an array named headers that contains two alternating HTTP headers and their associated values. The array is passed as an argument to addRequestHeader().var headers = [&quot;Content-Type&quot;, &quot;text/plain&quot;, &quot;X-ClientAppVersion&quot;, &quot;2.0&quot;];my_lv.addRequestHeader(headersThe following example creates a new LoadVars object that adds a request header called FLASH-UUID. The header contains a variable that can be checked by the server.var my_lv:LoadVars = new LoadVars(my_lv.addRequestHeader(&quot;FLASH-UUID&quot;, &quot;41472&quot;my_lv.name = &quot;Mort&quot;;my_lv.age = 26;my_lv.send(&quot;http://flash-mx.com/mm/cgivars.cfm&quot;, &quot;_blank&quot;, &quot;POST&quot;See alsoaddRequestHeader (XML.addRequestHeader method)" />
   <page href="00005263.html" title="contentType (LoadVars.contentType property)" text="contentType (LoadVars.contentType property)public contentType : StringThe MIME type that is sent to the server when you call LoadVars.send() or LoadVars.sendAndLoad(). The default is application/x-www-form-urlencoded.ExampleThe following example creates a LoadVars object and displays the default content type of the data that is sent to the server. var my_lv:LoadVars = new LoadVars(trace(my_lv.contentType // output: application/x-www-form-urlencodedSee alsosend (LoadVars.send method), sendAndLoad (LoadVars.sendAndLoad method)" />
   <page href="00005264.html" title="decode (LoadVars.decode method)" text="decode (LoadVars.decode method)public decode(queryString:String) : VoidConverts the variable string to properties of the specified LoadVars object. This method is used internally by the LoadVars.onData event handler. Most users do not need to call this method directly. If you override the LoadVars.onData event handler, you can explicitly call LoadVars.decode() to parse a string of variables.ParametersqueryString:String - A URL-encoded query string containing name/value pairs.ExampleThe following example traces the three variables: // Create a new LoadVars objectvar my_lv:LoadVars = new LoadVars(//Convert the variable string to propertiesmy_lv.decode(&quot;name=Mort&amp;score=250000&quot;trace(my_lv.toString()// Iterate over properties in my_lvfor (var prop in my_lv) { trace(prop+&quot; -&gt; &quot;+my_lv[prop]}See alsoonData (LoadVars.onData handler), parseXML (XML.parseXML method)" />
   <page href="00005265.html" title="getBytesLoaded (LoadVars.getBytesLoaded method)" text="getBytesLoaded (LoadVars.getBytesLoaded method)public getBytesLoaded() : NumberReturns the number of bytes downloaded by LoadVars.load() or LoadVars.sendAndLoad(). This method returns undefined if no load operation is in progress or if a load operation has not yet begun.ReturnsNumber - An integer.ExampleThe following example uses a ProgressBar instance and a LoadVars object to download a text file. When you test the file, two things are displayed in the Output panel: whether the file loads successfully and how much data loads into the SWF file. You must replace the URL parameter of the LoadVars.load() command so that the parameter refers to a valid text file using HTTP. If you attempt to use this example to load a local file that resides on your hard disk, this example will not work properly because in Test Movie mode Flash Player loads local files in their entirety. To see this code work, add a ProgressBar instance called loadvars_pb to the Stage. Then add the following ActionScript to Frame 1 of the Timeline: var loadvars_pb:mx.controls.ProgressBar;var my_lv:LoadVars = new LoadVars(loadvars_pb.mode = &quot;manual&quot;;this.createEmptyMovieClip(&quot;timer_mc&quot;, 999timer_mc.onEnterFrame = function() { var lvBytesLoaded:Number = my_lv.getBytesLoaded( var lvBytesTotal:Number = my_lv.getBytesTotal( if (lvBytesTotal != undefined) { trace(&quot;Loaded &quot;+lvBytesLoaded+&quot; of &quot;+lvBytesTotal+&quot; bytes.&quot; loadvars_pb.setProgress(lvBytesLoaded, lvBytesTotal }};my_lv.onLoad = function(success:Boolean) { loadvars_pb.setProgress(my_lv.getBytesLoaded(), my_lv.getBytesTotal() delete timer_mc.onEnterFrame; if (success) { trace(&quot;LoadVars loaded successfully.&quot; } else { trace(&quot;An error occurred while loading variables.&quot; }};my_lv.load(&quot;[place a valid URL pointing to a text file here]&quot;See alsoload (LoadVars.load method), sendAndLoad (LoadVars.sendAndLoad method)" />
   <page href="00005266.html" title="getBytesTotal (LoadVars.getBytesTotal method)" text="getBytesTotal (LoadVars.getBytesTotal method)public getBytesTotal() : NumberReturns the total number of bytes downloaded by LoadVars.load() or LoadVars.sendAndLoad(). This method returns undefined if no load operation is in progress or if a load operation has not started. This method also returns undefined if the number of total bytes can&#39;t be determined (for example, if the download was initiated but the server did not transmit an HTTP content-length).ReturnsNumber - An integer.ExampleThe following example uses a ProgressBar instance and a LoadVars object to download a text file. When you test the file, two things are displayed in the Output panel: whether the file loads successfully and how much data loads into the SWF file. You must replace the URL parameter of the LoadVars.load() command so that the parameter refers to a valid text file using HTTP. If you attempt to use this example to load a local file that resides on your hard disk, this example will not work properly because in test movie mode Flash Player loads local files in their entirety. To see this code work, add a ProgressBar instance called loadvars_pb to the Stage. Then add the following ActionScript to Frame 1 of the Timeline: var loadvars_pb:mx.controls.ProgressBar;var my_lv:LoadVars = new LoadVars(loadvars_pb.mode = &quot;manual&quot;;this.createEmptyMovieClip(&quot;timer_mc&quot;, 999timer_mc.onEnterFrame = function() { var lvBytesLoaded:Number = my_lv.getBytesLoaded( var lvBytesTotal:Number = my_lv.getBytesTotal( if (lvBytesTotal != undefined) { trace(&quot;Loaded &quot;+lvBytesLoaded+&quot; of &quot;+lvBytesTotal+&quot; bytes.&quot; loadvars_pb.setProgress(lvBytesLoaded, lvBytesTotal }};my_lv.onLoad = function(success:Boolean) { loadvars_pb.setProgress(my_lv.getBytesLoaded(), my_lv.getBytesTotal() delete timer_mc.onEnterFrame; if (success) { trace(&quot;LoadVars loaded successfully.&quot; } else { trace(&quot;An error occurred while loading variables.&quot; }};my_lv.load(&quot;[place a valid URL pointing to a text file here]&quot;See alsoload (LoadVars.load method), sendAndLoad (LoadVars.sendAndLoad method)" />
   <page href="00005267.html" title="load (LoadVars.load method)" text="load (LoadVars.load method)public load(url:String) : BooleanDownloads variables from the specified URL, parses the variable data, and places the resulting variables into my_lv. Any properties in my_lv with the same names as downloaded variables are overwritten. Any properties in my_lv with different names than downloaded variables are not deleted. This is an asynchronous action. The downloaded data must be in the MIME content type application/x-www-form-urlencoded. This is the same format used by loadVariables().In SWF files running in a version of the player earlier than Flash Player 7, url must be in the same superdomain as the SWF file that is issuing this call. A superdomain is derived by removing the left-most component of a file&#39;s URL. For example, a SWF file at www.someDomain.com can load data from sources at store.someDomain.com because both files are in the same superdomain named someDomain.com.In SWF files of any version running in Flash Player 7 or later, url must be in exactly the same domain. For example, a SWF file at www.someDomain.com can load data only from sources that are also at www.someDomain.com. If you want to load data from a different domain, you can place a cross-domain policy file on the server hosting the SWF file.Also, in files published for Flash Player 7, case-sensitivity is supported for external variables loaded with LoadVars.load().This method is similar to XML.load().Parametersurl:String - A string; the URL from which to download the variables. If the SWF file issuing this call is running in a web browser, url must be in the same domain as the SWF file; for details, see the Description section.ReturnsBoolean - false if no parameter (null) is passed; true otherwise. Use the onLoad() event handler to check the success of loaded data.ExampleThe following code defines an onLoad handler function that signals when data is returned to the Flash application from a server-side PHP script, and then loads the data in passvars.php. var my_lv:LoadVars = new LoadVars(my_lv.onLoad = function(success:Boolean) { if (success) { trace(this.toString() } else { trace(&quot;Error loading/parsing LoadVars.&quot; }};my_lv.load(&quot;http://www.helpexamples.com/flash/params.txt&quot;An example is also in the guestbook.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample.See alsoload (XML.load method), loaded (LoadVars.loaded property), onLoad (LoadVars.onLoad handler)" />
   <page href="00005268.html" title="loaded (LoadVars.loaded property)" text="loaded (LoadVars.loaded property)public loaded : BooleanA Boolean value that indicates whether a load or sendAndLoad operation has completed, undefined by default. When a LoadVars.load() or LoadVars.sendAndLoad() operation is started, the loaded property is set to false; when the operation completes, the loaded property is set to true. If the operation has not completed or has failed with an error, the loaded property remains set to false. This property is similar to the XML.loadedproperty.ExampleThe following example loads a text file and displays information in the Output panel when the operation completes. var my_lv:LoadVars = new LoadVars(my_lv.onLoad = function(success:Boolean) { trace(&quot;LoadVars loaded successfully: &quot;+this.loaded};my_lv.load(&quot;http://www.helpexamples.com/flash/params.txt&quot;See alsoload (LoadVars.load method), sendAndLoad (LoadVars.sendAndLoad method), load (XML.load method)" />
   <page href="00005269.html" title="LoadVars constructor" text="LoadVars constructorpublic LoadVars()Creates a LoadVars object. You can then use the methods of that LoadVars object to send and load data.ExampleThe following example creates a LoadVars object called my_lv: var my_lv:LoadVars = new LoadVars(" />
   <page href="00005270.html" title="onData (LoadVars.onData handler)" text="onData (LoadVars.onData handler)onData = function(src:String) {}Invoked when data has completely downloaded from the server or when an error occurs while data is downloading from a server. This handler is invoked before the data is parsed and can be used to call a custom parsing routine instead of the one built in to Flash Player. The value of the src parameter passed to the function assigned to LoadVars.onData can be either undefined or a string that contains the URL-encoded name-value pairs downloaded from the server. If the src parameter is undefined, an error occurred while downloading the data from the server. The default implementation of LoadVars.onData invokes LoadVars.onLoad. You can override this default implementation by assigning a custom function to LoadVars.onData, but LoadVars.onLoad is not called unless you call it in your implementation of LoadVars.onData.Parameterssrc:String - A string or undefined; the raw (unparsed) data from a LoadVars.load() or LoadVars.sendAndLoad() method call.ExampleThe following example loads a text file and displays content in a TextArea instance called content_ta when the operation completes. If an error occurs, then information displays in the Output panel. var my_lv:LoadVars = new LoadVars(my_lv.onData = function(src:String) { if (src == undefined) { trace(&quot;Error loading content.&quot; return; } content_ta.text = src;};my_lv.load(&quot;content.txt&quot;, my_lv, &quot;GET&quot;See alsoonLoad (LoadVars.onLoad handler), onLoad (LoadVars.onLoad handler), load (LoadVars.load method), sendAndLoad (LoadVars.sendAndLoad method)" />
   <page href="00005271.html" title="onLoad (LoadVars.onLoad handler)" text="onLoad (LoadVars.onLoad handler)onLoad = function(success:Boolean) {}Invoked when a LoadVars.load() or LoadVars.sendAndLoad() operation has ended. If the operation was successful, my_lv is populated with variables downloaded by the operation, and these variables are available when this handler is invoked. This handler is undefined by default.This event handler is similar to XML.onLoad.Parameterssuccess:Boolean - A Boolean value that indicates whether the load operation ended in success (true) or failure (false).ExampleFor the following example, add a TextInput instance called name_ti, a TextArea instance called result_ta, and a Button instance called submit_button to the Stage. When the user clicks the Login button instance in the following example, two LoadVars objects are created: send_lv and result_lv. The send_lv object copies the name from the name_ti instance and sends the data to greeting.cfm. The result from this script loads into the result_lv object, and the server response displays in the TextArea instance (result_ta). Add the following ActionScript on Frame 1 of the Timeline: var submitListener:Object = new Object(submitListener.click = function(evt:Object) { var result_lv:LoadVars = new LoadVars( result_lv.onLoad = function(success:Boolean) { if (success) { result_ta.text = result_lv.welcomeMessage; } else { result_ta.text = &quot;Error connecting to server.&quot;; } }; var send_lv:LoadVars = new LoadVars( send_lv.name = name_ti.text; send_lv.sendAndLoad(&quot;http://www.flash-mx.com/mm/greeting.cfm&quot;, result_lv, &quot;POST&quot;};submit_button.addEventListener(&quot;click&quot;, submitListenerTo view a more robust example, see the login.fla file at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample.See alsoonLoad (XML.onLoad handler), loaded (LoadVars.loaded property), load (LoadVars.load method), sendAndLoad (LoadVars.sendAndLoad method)" />
   <page href="00005272.html" title="send (LoadVars.send method)" text="send (LoadVars.send method)public send(url:String, target:String, [method:String]) : BooleanSends the variables in the my_lv object to the specified URL. All enumerable variables in my_lv are concatenated into a string in the application/x-www-form-urlencoded format by default, and the string is posted to the URL using the HTTP POST method. This is the same format used by loadVariables().The MIME content type sent in the HTTP request headers is the value of my_lv.contentType or the default application/x-www-form-urlencoded. The POST method is used unless GET is specified. You must specify the target parameter to ensure that the script or application at the specified URL will be executed. If you omit the target parameter, the function will return true, but the script or application will not be executed.The send() method is useful if you want the server response to:Replace the SWF content (use &quot;_self&quot; as the target parameterAppear in a new window (use &quot;_blank&quot; as the target parameterAppear in the parent or top-level frame (use &quot;_parent&quot; or &quot;_top&quot; as the target parameter Appear in a named frame (use the frame&#39;s name as a string for the target parameter).A successful send() method call will always open a new browser window or replace content in an existing window or frame. If you would rather send information to a server and continue playing your SWF file without opening a new window or replacing content in a window or frame, then you should use LoadVars.sendAndLoad().This method is similar to XML.send().The Flash test environment always uses the GET method. To test using the POST method, be sure you are attempting to use it from within a browser.Parametersurl:String - A string; the URL to which to upload variables.target:String - A string; the browser window or frame in which any response will appear. You can enter the name of a specific window or select from the following reserved target names: &quot;_self&quot; specifies the current frame in the current window.&quot;_blank&quot; specifies a new window.&quot;_parent&quot; specifies the parent of the current frame.&quot;_top&quot; specifies the top-level frame in the current window.method:String [optional] - A string; the GET or POST method of the HTTP protocol. The default value is POST.ReturnsBoolean - A Boolean value; false if no parameters are specified, true otherwise.ExampleThe following example copies two values from text fields and sends the data to a CFM script, which is used to handle the information. For example, the script might check if the user got a high score and then insert that data into a database table. var my_lv:LoadVars = new LoadVars(my_lv.playerName = playerName_txt.text;my_lv.playerScore = playerScore_txt.text;my_lv.send(&quot;setscore.cfm&quot;, &quot;_blank&quot;, &quot;POST&quot;See alsosendAndLoad (LoadVars.sendAndLoad method), send (XML.send method)" />
   <page href="00005273.html" title="sendAndLoad (LoadVars.sendAndLoad method)" text="sendAndLoad (LoadVars.sendAndLoad method)public sendAndLoad(url:String, target:Object, [method:String]) : BooleanPosts variables in the my_lv object to the specified URL. The server response is downloaded, parsed as variable data, and the resulting variables are placed in the target object. Variables are posted in the same manner as LoadVars.send(). Variables are downloaded into target in the same manner as LoadVars.load().In SWF files running in a version of the player earlier than Flash Player 7, url must be in the same superdomain as the SWF file that is issuing this call. A superdomain is derived by removing the left-most component of a file&#39;s URL. For example, a SWF file at www.someDomain.com can load data from sources at store.someDomain.com, because both files are in the same superdomain of someDomain.com.In SWF files of any version running in Flash Player 7 or later, url must be in exactly the same domain. For example, a SWF file at www.someDomain.com can load data only from sources that are also at www.someDomain.com. If you want to load data from a different domain, you can place a cross-domain policy file on the server hosting the SWF file. This method is similar to XML.sendAndLoad().Parametersurl:String - A string; the URL to which to upload variables. If the SWF file issuing this call is running in a web browser, url must be in the same domain as the SWF file.target:Object - The LoadVars or XML object that receives the downloaded variables.method:String [optional] - A string; the GET or POST method of the HTTP protocol. The default value is POST.ReturnsBoolean - A Boolean value.ExampleFor the following example, add a TextInput instance called name_ti, a TextArea instance called result_ta, and a Button instance called submit_button to the Stage. When the user clicks the Login button instance in the following example, two LoadVars objects are created: send_lv and result_lv. The send_lv object copies the name from the name_ti instance and sends the data to greeting.cfm. The result from this script loads into the result_lv object, and the server response displays in the TextArea instance (result_ta). Add the following ActionScript to Frame 1 of the Timeline: var submitListener:Object = new Object(submitListener.click = function(evt:Object) { var result_lv:LoadVars = new LoadVars( result_lv.onLoad = function(success:Boolean) { if (success) { result_ta.text = result_lv.welcomeMessage; } else { result_ta.text = &quot;Error connecting to server.&quot;; } }; var send_lv:LoadVars = new LoadVars( send_lv.name = name_ti.text; send_lv.sendAndLoad(&quot;http://www.flash-mx.com/mm/greeting.cfm&quot;, result_lv, &quot;POST&quot;};submit_button.addEventListener(&quot;click&quot;, submitListenerTo view a more robust example, see the login.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample.See alsosend (LoadVars.send method), load (LoadVars.load method), sendAndLoad (XML.sendAndLoad method)" />
   <page href="00005274.html" title="toString (LoadVars.toString method)" text="toString (LoadVars.toString method)public toString() : StringReturns a string containing all enumerable variables in my_lv, in the MIME content encoding application/x-www-form-urlencoded.ReturnsString - A string.ExampleThe following example instantiates a new LoadVars() object, creates two properties, and uses toString() to return a string containing both properties in URL encoded format: var my_lv:LoadVars = new LoadVars(my_lv.name = &quot;Gary&quot;;my_lv.age = 26;trace (my_lv.toString() //output: age=26&amp;name=Gary" />
   <page href="00005275.html" title="Math" text="ModifiersPropertyDescriptionstaticE:NumberA mathematical constant for the base of natural logarithms, expressed as e.staticLN10:NumberA mathematical constant for the natural logarithm of 10, expressed as loge10, with an approximate value of 2.302585092994046.staticLN2:NumberA mathematical constant for the natural logarithm of 2, expressed as loge2, with an approximate value of 0.6931471805599453.staticLOG10E:NumberA mathematical constant for the base-10 logarithm of the constant e (Math.E), expressed as log10e, with an approximate value of 0.4342944819032518.staticLOG2E:NumberA mathematical constant for the base-2 logarithm of the constant e (Math.E), expressed as log2e, with an approximate value of 1.442695040888963387.staticPI:NumberA mathematical constant for the ratio of the circumference of a circle to its diameter, expressed as pi, with a value of 3.141592653589793.staticSQRT1_2:NumberA mathematical constant for the square root of one-half, with an approximate value of 0.7071067811865476.staticSQRT2:NumberA mathematical constant for the square root of 2, with an approximate value of 1.4142135623730951.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)ModifiersSignatureDescriptionstaticabs(x:Number) : NumberComputes and returns an absolute value for the number specified by the parameter x.staticacos(x:Number) : NumberComputes and returns the arc cosine of the number specified in the parameter x, in radians.staticasin(x:Number) : NumberComputes and returns the arc sine for the number specified in the parameter x, in radians.staticatan(tangent:Number) : NumberComputes and returns the value, in radians, of the angle whose tangent is specified in the parameter tangent.staticatan2(y:Number, x:Number) : NumberComputes and returns the angle of the point y/x in radians, when measured counterclockwise from a circle&#39;s x axis (where 0,0 represents the center of the circle).staticceil(x:Number) : NumberReturns the ceiling of the specified number or expression.staticcos(x:Number) : NumberComputes and returns the cosine of the specified angle in radians.staticexp(x:Number) : NumberReturns the value of the base of the natural logarithm (e), to the power of the exponent specified in the parameter x.staticfloor(x:Number) : NumberReturns the floor of the number or expression specified in the parameter x.staticlog(x:Number) : NumberReturns the natural logarithm of parameter x.staticmax(x:Number, y:Number) : NumberEvaluates x and y and returns the larger value.staticmin(x:Number, y:Number) : NumberEvaluates x and y and returns the smaller value.staticpow(x:Number, y:Number) : NumberComputes and returns x to the power of y.staticrandom() : NumberReturns a pseudo-random number n, where 0 &lt;= n &lt; 1.staticround(x:Number) : NumberRounds the value of the parameter x up or down to the nearest integer and returns the value.staticsin(x:Number) : NumberComputes and returns the sine of the specified angle in radians.staticsqrt(x:Number) : NumberComputes and returns the square root of the specified number.statictan(x:Number) : NumberComputes and returns the tangent of the specified angle.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)MathObject | +-Mathpublic class Mathextends ObjectThe Math class is a top-level class whose methods and properties you can use without using a constructor. Use the methods and properties of this class to access and manipulate mathematical constants and functions. All the properties and methods of the Math class are static and must be called using the syntax Math.method(parameter) or Math.constant. In ActionScript, constants are defined with the maximum precision of double-precision IEEE-754 floating-point numbers.Several Math class methods use the measure of an angle in radians as a parameter.You can use the following equation to calculate radian values before calling the method and then provide the calculated value as the parameter, or you can provide the entire right side of the equation (with the angle&#39;s measure in degrees in place of degrees) as the radian parameter.To calculate a radian value, use the following formula:radians = degrees * Math.PI/180The following is an example of passing the equation as a parameter to calculate the sine of a 45˚ angle:Math.sin(45 * Math.PI/180) is the same as Math.sin(.7854)Property summaryProperties inherited from class ObjectMethod summaryMethods inherited from class Object" />
   <page href="00005276.html" title="abs (Math.abs method)" text="abs (Math.abs method)public static abs(x:Number) : NumberComputes and returns an absolute value for the number specified by the parameter x.Parametersx:Number - A number.ReturnsNumber - A number.ExampleThe following example shows how Math.abs() returns the absolute value of a number and does not affect the value of the x parameter (called num in this example): var num:Number = -12;var numAbsolute:Number = Math.abs(numtrace(num // output: -12trace(numAbsolute // output: 12" />
   <page href="00005277.html" title="acos (Math.acos method)" text="acos (Math.acos method)public static acos(x:Number) : NumberComputes and returns the arc cosine of the number specified in the parameter x, in radians.Parametersx:Number - A number from -1.0 to 1.0.ReturnsNumber - A number; the arc cosine of the parameter x.ExampleThe following example displays the arc cosine for several values. trace(Math.acos(-1) // output: 3.14159265358979trace(Math.acos(0) // output: 1.5707963267949trace(Math.acos(1) // output: 0See alsoasin (Math.asin method), atan (Math.atan method), atan2 (Math.atan2 method), cos (Math.cos method), sin (Math.sin method), tan (Math.tan method)" />
   <page href="00005278.html" title="asin (Math.asin method)" text="asin (Math.asin method)public static asin(x:Number) : NumberComputes and returns the arc sine for the number specified in the parameter x, in radians.Parametersx:Number - A number from -1.0 to 1.0.ReturnsNumber - A number between negative pi divided by 2 and positive pi divided by 2.ExampleThe following example displays the arc sine for several values. trace(Math.asin(-1) // output: -1.5707963267949trace(Math.asin(0) // output: 0trace(Math.asin(1) // output: 1.5707963267949See alsoacos (Math.acos method), atan (Math.atan method), atan2 (Math.atan2 method), cos (Math.cos method), sin (Math.sin method), tan (Math.tan method)" />
   <page href="00005279.html" title="atan (Math.atan method)" text="atan (Math.atan method)public static atan(tangent:Number) : NumberComputes and returns the value, in radians, of the angle whose tangent is specified in the parameter tangent. The return value is between negative pi divided by 2 and positive pi divided by 2.Parameterstangent:Number - A number that represents the tangent of an angle.ReturnsNumber - A number between negative pi divided by 2 and positive pi divided by 2.ExampleThe following example displays the angle value for several tangents. trace(Math.atan(-1) // output: -0.785398163397448trace(Math.atan(0) // output: 0trace(Math.atan(1) // output: 0.785398163397448See alsoacos (Math.acos method), asin (Math.asin method), atan2 (Math.atan2 method), cos (Math.cos method), sin (Math.sin method), tan (Math.tan method)" />
   <page href="00005280.html" title="atan2 (Math.atan2 method)" text="atan2 (Math.atan2 method)public static atan2(y:Number, x:Number) : NumberComputes and returns the angle of the point y/x in radians, when measured counterclockwise from a circle&#39;s x axis (where 0,0 represents the center of the circle). The return value is between positive pi and negative pi.Parametersy:Number - A number specifying the y coordinate of the point.x:Number - A number specifying the x coordinate of the point.ReturnsNumber - A number.ExampleThe following example returns the angle, in radians, of the point specified by the coordinates (0, 10), such that x = 0 and y = 10. Note that the first parameter to atan2 is always the y coordinate. trace(Math.atan2(10, 0) // output: 1.5707963267949See alsoacos (Math.acos method), asin (Math.asin method), atan (Math.atan method), cos (Math.cos method), sin (Math.sin method), tan (Math.tan method)" />
   <page href="00005281.html" title="ceil (Math.ceil method)" text="ceil (Math.ceil method)public static ceil(x:Number) : NumberReturns the ceiling of the specified number or expression. The ceiling of a number is the closest integer that is greater than or equal to the number.Parametersx:Number - A number or expression.ReturnsNumber - An integer that is both closest to, and greater than or equal to, parameter x.ExampleThe following code returns a value of 13: Math.ceil(12.5See alsofloor (Math.floor method), round (Math.round method)" />
   <page href="00005282.html" title="cos (Math.cos method)" text="cos (Math.cos method)public static cos(x:Number) : NumberComputes and returns the cosine of the specified angle in radians. To calculate a radian, see the description of the Math class entry.Parametersx:Number - A number that represents an angle measured in radians.ReturnsNumber - A number from -1.0 to 1.0.ExampleThe following example displays the cosine for several different angles. trace (Math.cos(0) // 0 degree angle. Output: 1trace (Math.cos(Math.PI/2) // 90 degree angle. Output: 6.12303176911189e-17trace (Math.cos(Math.PI) // 180 degree angle. Output: -1trace (Math.cos(Math.PI*2) // 360 degree angle. Output: 1Note: The cosine of a 90 degree angle is zero, but because of the inherent inaccuracy of decimal calculations using binary numbers, Flash Player will report a number extremely close to, but not exactly equal to, zero.See alsoacos (Math.acos method), asin (Math.asin method), atan (Math.atan method), atan2 (Math.atan2 method), sin (Math.sin method), tan (Math.tan method)" />
   <page href="00005283.html" title="E (Math.E property)" text="E (Math.E property)public static E : NumberA mathematical constant for the base of natural logarithms, expressed as e. The approximate value of eis 2.71828182845905.ExampleThis example shows how Math.E is used to compute continuously compounded interest for a simple case of 100 percent interest over a one-year period. var principal:Number = 100;var simpleInterest:Number = 100;var continuouslyCompoundedInterest:Number = (100 * Math.E) - principal;trace (&quot;Beginning principal: $&quot; + principaltrace (&quot;Simple interest after one year: $&quot; + simpleInteresttrace (&quot;Continuously compounded interest after one year: $&quot; + continuouslyCompoundedInterest//Output:Beginning principal: $100Simple interest after one year: $100Continuously compounded interest after one year: $171.828182845905" />
   <page href="00005284.html" title="exp (Math.exp method)" text="exp (Math.exp method)public static exp(x:Number) : NumberReturns the value of the base of the natural logarithm (e), to the power of the exponent specified in the parameter x. The constant Math.E can provide the value of e.Parametersx:Number - The exponent; a number or expression.ReturnsNumber - A number.ExampleThe following example displays the logarithm for two number values. trace(Math.exp(1) // output: 2.71828182845905trace(Math.exp(2) // output: 7.38905609893065See alsoE (Math.E property)" />
   <page href="00005285.html" title="floor (Math.floor method)" text="floor (Math.floor method)public static floor(x:Number) : NumberReturns the floor of the number or expression specified in the parameter x. The floor is the closest integer that is less than or equal to the specified number or expression.Parametersx:Number - A number or expression.ReturnsNumber - The integer that is both closest to, and less than or equal to, parameter x.ExampleThe following code returns a value of 12: Math.floor(12.5The following code returns a value of -7:Math.floor(-6.5" />
   <page href="00005286.html" title="LN10 (Math.LN10 property)" text="LN10 (Math.LN10 property)public static LN10 : NumberA mathematical constant for the natural logarithm of 10, expressed as loge10, with an approximate value of 2.302585092994046.ExampleThis example traces the value of Math.LN10. trace(Math.LN10// output: 2.30258509299405" />
   <page href="00005287.html" title="LN2 (Math.LN2 property)" text="LN2 (Math.LN2 property)public static LN2 : NumberA mathematical constant for the natural logarithm of 2, expressed as loge2, with an approximate value of 0.6931471805599453." />
   <page href="00005288.html" title="log (Math.log method)" text="log (Math.log method)public static log(x:Number) : NumberReturns the natural logarithm of parameter x.Parametersx:Number - A number or expression with a value greater than 0.ReturnsNumber - The natural logarithm of parameter x.ExampleThe following example displays the logarithm for three numerical values. trace(Math.log(0) // output: -Infinitytrace(Math.log(1) // output: 0trace(Math.log(2) // output: 0.693147180559945trace(Math.log(Math.E) // output: 1" />
   <page href="00005289.html" title="LOG10E (Math.LOG10E property)" text="LOG10E (Math.LOG10E property)public static LOG10E : NumberA mathematical constant for the base-10 logarithm of the constant e (Math.E), expressed as log10e, with an approximate value of 0.4342944819032518. The Math.log() method computes the natural logarithm of a number. Multiply the result of Math.log() by Math.LOG10E obtain the base-10 logarithm. ExampleThis example shows how to obtain the base-10 logarithm of a number: trace(Math.log(1000) * Math.LOG10E// Output: 3" />
   <page href="00005290.html" title="LOG2E (Math.LOG2E property)" text="LOG2E (Math.LOG2E property)public static LOG2E : NumberA mathematical constant for the base-2 logarithm of the constant e (Math.E), expressed as log2e, with an approximate value of 1.442695040888963387. The Math.log method computes the natural logarithm of a number. Multiply the result of Math.log() by Math.LOG2E obtain the base-2 logarithm. ExampleThis example shows how to obtain the base-2 logarithm of a number: trace(Math.log(16) * Math.LOG2E// Output: 4" />
   <page href="00005291.html" title="max (Math.max method)" text="max (Math.max method)public static max(x:Number, y:Number) : NumberEvaluates x and y and returns the larger value.Parametersx:Number - A number or expression.y:Number - A number or expression.ReturnsNumber - A number.ExampleThe following example displays Thu Dec 30 00:00:00 GMT-0700 2004, which is the larger of the evaluated expressions. var date1:Date = new Date(2004, 11, 25var date2:Date = new Date(2004, 11, 30var maxDate:Number = Math.max(date1.getTime(), date2.getTime()trace(new Date(maxDate).toString()See alsomin (Math.min method)" />
   <page href="00005292.html" title="min (Math.min method)" text="min (Math.min method)public static min(x:Number, y:Number) : NumberEvaluates x and y and returns the smaller value.Parametersx:Number - A number or expression.y:Number - A number or expression.ReturnsNumber - A number.ExampleThe following example displays Sat Dec 25 00:00:00 GMT-0700 2004, which is the smaller of the evaluated expressions. var date1:Date = new Date(2004, 11, 25var date2:Date = new Date(2004, 11, 30var minDate:Number = Math.min(date1.getTime(), date2.getTime()trace(new Date(minDate).toString()See alsomax (Math.max method)" />
   <page href="00005293.html" title="PI (Math.PI property)" text="PI (Math.PI property)public static PI : NumberA mathematical constant for the ratio of the circumference of a circle to its diameter, expressed as pi, with a value of 3.141592653589793.ExampleThe 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}" />
   <page href="00005294.html" title="pow (Math.pow method)" text="pow (Math.pow method)public static pow(x:Number, y:Number) : NumberComputes and returns x to the power of y.Parametersx:Number - A number to be raised to a power.y:Number - A number specifying a power the parameter x is raised to.ReturnsNumber - A number.ExampleThe following example uses Math.pow and Math.sqrt to calculate the length of a line. this.createEmptyMovieClip(&quot;canvas_mc&quot;, 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(&quot;line&quot;+nextDepth+&quot;_mc&quot;, 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(&quot;length&quot;+nextDepth+&quot;_txt&quot;, canvas_mc.getNextHighestDepth(), this.origX, this.origY-22, 100, 22 line_mc[&#39;length&#39;+nextDepth+&#39;_txt&#39;].text = Math.round(hypLen) +&quot; pixels&quot;;};Mouse.addListener(mouseListener" />
   <page href="00005295.html" title="random (Math.random method)" text="random (Math.random method)public static random() : NumberReturns a pseudo-random number n, where 0 &lt;= n &lt; 1. The number returned is a pseudo-random number because it is not generated by a truly random natural phenomenon such as radioactive decay.ReturnsNumber - A number.ExampleThe following example outputs 100 random integers between 4 and 11 (inclusively): function randRange(min:Number, max:Number):Number { var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min; return randomNum;}for (var i = 0; i &lt; 100; i++) { var n:Number = randRange(4, 11) trace(n}" />
   <page href="00005296.html" title="round (Math.round method)" text="round (Math.round method)public static round(x:Number) : NumberRounds 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.Parametersx:Number - A number.ReturnsNumber - A number; an integer.ExampleThe 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+1) + (min-.5) return randomNum;}for (var i = 0; i&lt;25; i++) { trace(randRange(4, 11)}See alsoceil (Math.ceil method), floor (Math.floor method)" />
   <page href="00005297.html" title="sin (Math.sin method)" text="sin (Math.sin method)public static sin(x:Number) : NumberComputes and returns the sine of the specified angle in radians. To calculate a radian, see the description of the Math class entry.Parametersx:Number - A number that represents an angle measured in radians.ReturnsNumber - A number; the sine of the specified angle (between -1.0 and 1.0).ExampleThe following example draws a circle using the mathematical constant pi, the sine of an angle, 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}See alsoacos (Math.acos method), asin (Math.asin method), atan (Math.atan method), atan2 (Math.atan2 method), cos (Math.cos method), tan (Math.tan method)" />
   <page href="00005298.html" title="sqrt (Math.sqrt method)" text="sqrt (Math.sqrt method)public static sqrt(x:Number) : NumberComputes and returns the square root of the specified number.Parametersx:Number - A number or expression greater than or equal to 0.ReturnsNumber - A number if parameter x is greater than or equal to zero; NaN (not a number) otherwise.ExampleThe following example uses Math.pow and Math.sqrt to calculate the length of a line. this.createEmptyMovieClip(&quot;canvas_mc&quot;, 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(&quot;line&quot;+nextDepth+&quot;_mc&quot;, 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(&quot;length&quot;+nextDepth+&quot;_txt&quot;, canvas_mc.getNextHighestDepth(), this.origX, this.origY-22, 100, 22 line_mc[&#39;length&#39;+nextDepth+&#39;_txt&#39;].text = Math.round(hypLen) +&quot; pixels&quot;;};Mouse.addListener(mouseListener" />
   <page href="00005299.html" title="SQRT1_2 (Math.SQRT1_2 property)" text="SQRT1_2 (Math.SQRT1_2 property)public static SQRT1_2 : NumberA mathematical constant for the square root of one-half, with an approximate value of 0.7071067811865476.ExampleThis example traces the value of Math.SQRT1_2.trace(Math.SQRT1_2// Output: 0.707106781186548" />
   <page href="00005300.html" title="SQRT2 (Math.SQRT2 property)" text="SQRT2 (Math.SQRT2 property)public static SQRT2 : NumberA mathematical constant for the square root of 2, with an approximate value of 1.4142135623730951.ExampleThis example traces the value of Math.SQRT2.trace(Math.SQRT2// Output: 1.4142135623731" />
   <page href="00005301.html" title="tan (Math.tan method)" text="tan (Math.tan method)public static tan(x:Number) : NumberComputes and returns the tangent of the specified angle. To calculate a radian, use the information outlined in the introduction to the Math class.Parametersx:Number - A number that represents an angle measured in radians.ReturnsNumber - A number; tangent of parameter x.ExampleThe following example draws a circle using the mathematical constant pi, the tangent of an angle, 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}See alsoacos (Math.acos method), asin (Math.asin method), atan (Math.atan method), atan2 (Math.atan2 method), cos (Math.cos method), sin (Math.sin method)" />
   <page href="00005302.html" title="Mouse" text="constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)EventDescriptiononMouseDown = function() {}Notified when the mouse button is pressed.onMouseMove = function() {}Notified when the mouse moves.onMouseUp = function() {}Notified when the mouse button is released.ModifiersSignatureDescriptionstaticaddListener(listener:Object) : VoidRegisters an object to receive notifications of the onMouseDown, onMouseMove, and onMouseUp listeners.staticremoveListener(listener:Object) : BooleanRemoves an object that was previously registered with addListener().addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)MouseObject | +-Mousepublic class Mouseextends ObjectThe Mouse class is a top-level class whose properties and methods you can access without using a constructor. You can use the methods of the Mouse class to add and remove listeners and to handle mouse events. Note: The members of this class are supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.Property summaryProperties inherited from class ObjectEvent summaryMethod summaryMethods inherited from class Object" />
   <page href="00005303.html" title="addListener (Mouse.addListener method)" text="addListener (Mouse.addListener method)public static addListener(listener:Object) : VoidRegisters an object to receive notifications of the onMouseDown, onMouseMove, and onMouseUp listeners. The listener parameter should contain an object that has a defined method for at least one of the listeners.When the mouse button is pressed, moved, released, or used to scroll, regardless of the input focus, all listening objects that are registered with this method have their onMouseDown, onMouseMove, or onMouseUp method invoked. Multiple objects can listen for mouse notifications. If the listener is already registered, no change occurs.Note: This method is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.Parameterslistener:Object - An object.ExampleThis example is excerpted from the animation.fla file in the ActionScript Samples folder. // Create a mouse listener object.var mouseListener:Object = new Object(// Every time the mouse cursor moves within the SWF file,  update the position of the crosshair movie clip  instance on the Stage.mouseListener.onMouseMove = function() { crosshair_mc._x = _xmouse; crosshair_mc._y = _ymouse;};// When you press the mouse button, check to see if the cursor is within the boundaries of the Stage. If so, increment the number of shots. mouseListener.onMouseDown = function() { if (bg_mc.hitTest(_xmouse, _ymouse, false)) { _global.shots++; }};Mouse.addListener(mouseListenerTo view the entire script, see the animation.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample.See alsoonMouseDown (Mouse.onMouseDown event listener), onMouseMove (Mouse.onMouseMove event listener), onMouseUp (Mouse.onMouseUp event listener)" />
   <page href="00005304.html" title="onMouseDown (Mouse.onMouseDown event listener)" text="onMouseDown (Mouse.onMouseDown event listener)onMouseDown = function() {}Notified when the mouse button is pressed. To use the onMouseDown listener, you must create a listener object. You can then define a function for onMouseDown and use addListener() to register the listener with the Mouse object, as shown in the following code: var someListener:Object = new Object(someListener.onMouseDown = function () { ... };Mouse.addListener(someListenerListeners enable different pieces of code to cooperate because multiple listeners can receive notification about a single event.Note: This event listener is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example uses the Drawing API to draw a rectangle when the user presses the mouse button, moves the mouse, and then releases the mouse button at runtime. this.createEmptyMovieClip(&quot;canvas_mc&quot;, this.getNextHighestDepth()var mouseListener:Object = new Object(mouseListener.onMouseDown = function() { this.isDrawing = true; this.orig_x = _xmouse; this.orig_y = _ymouse; this.target_mc = canvas_mc.createEmptyMovieClip(&quot;&quot;, canvas_mc.getNextHighestDepth()};mouseListener.onMouseMove = function() { if (this.isDrawing) { this.target_mc.clear( this.target_mc.lineStyle(1, 0xFF0000, 100 this.target_mc.moveTo(this.orig_x, this.orig_y this.target_mc.lineTo(_xmouse, this.orig_y this.target_mc.lineTo(_xmouse, _ymouse this.target_mc.lineTo(this.orig_x, _ymouse this.target_mc.lineTo(this.orig_x, this.orig_y } updateAfterEvent(};mouseListener.onMouseUp = function() { this.isDrawing = false;};Mouse.addListener(mouseListenerSee alsoaddListener (Mouse.addListener method)" />
   <page href="00005305.html" title="onMouseMove (Mouse.onMouseMove event listener)" text="onMouseMove (Mouse.onMouseMove event listener)onMouseMove = function() {}Notified when the mouse moves. To use the onMouseMove listener, you must create a listener object. You can then define a function for onMouseMove and use addListener() to register the listener with the Mouse object, as shown in the following code: var someListener:Object = new Object(someListener.onMouseMove = function () { ... };Mouse.addListener(someListenerListeners enable different pieces of code to cooperate because multiple listeners can receive notification about a single event.Note: This event listener is supported in Flash Lite only if System.capabilities.hasMouse is true.ExampleThe following example uses the mouse pointer as a tool to draw lines using onMouseMove and the Drawing API. The user draws a line by moving the pointer. this.createEmptyMovieClip(&quot;canvas_mc&quot;, this.getNextHighestDepth()var mouseListener:Object = new Object(mouseListener.onMouseDown = function() { this.isDrawing = true; canvas_mc.lineStyle(2, 0xFF0000, 100 canvas_mc.moveTo(_xmouse, _ymouse};mouseListener.onMouseMove = function() { if (this.isDrawing) { canvas_mc.lineTo(_xmouse, _ymouse } updateAfterEvent(};mouseListener.onMouseUp = function() { this.isDrawing = false;};Mouse.addListener(mouseListenerThe following example sets the x and y positions of the pointer_mc movie clip instance to the x and y pointer positions. The device must support a stylus or mouse for this example to work. To use the example, you create a movie clip and set its Linkage identifier to pointer_id. Then add the following ActionScript code to Frame 1 of the Timeline:this.attachMovie(&quot;pointer_id&quot;, &quot;pointer_mc&quot;, this.getNextHighestDepth()var mouseListener:Object = new Object(mouseListener.onMouseMove = function() { pointer_mc._x = _xmouse; pointer_mc._y = _ymouse;};Mouse.addListener(mouseListenerSee alsoaddListener (Mouse.addListener method)" />
   <page href="00005306.html" title="onMouseUp (Mouse.onMouseUp event listener)" text="onMouseUp (Mouse.onMouseUp event listener)onMouseUp = function() {}Notified when the mouse button is released. To use the onMouseUp listener, you must create a listener object. You can then define a function for onMouseUp and use addListener() to register the listener with the Mouse object, as shown in the following code: var someListener:Object = new Object(someListener.onMouseUp = function () { ... };Mouse.addListener(someListenerListeners enable different pieces of code to cooperate because multiple listeners can receive notification about a single event.Note: This event listener is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example uses the mouse pointer as a tool to draw lines using onMouseMove and the Drawing API. The user draws a line by moving the pointer and stops drawing the line by releasing the mouse button. this.createEmptyMovieClip(&quot;canvas_mc&quot;, this.getNextHighestDepth()var mouseListener:Object = new Object(mouseListener.onMouseDown = function() { this.isDrawing = true; canvas_mc.lineStyle(2, 0xFF0000, 100 canvas_mc.moveTo(_xmouse, _ymouse};mouseListener.onMouseMove = function() { if (this.isDrawing) { canvas_mc.lineTo(_xmouse, _ymouse } updateAfterEvent(};mouseListener.onMouseUp = function() { this.isDrawing = false;};Mouse.addListener(mouseListenerSee alsoaddListener (Mouse.addListener method)" />
   <page href="00005307.html" title="removeListener (Mouse.removeListener method)" text="removeListener (Mouse.removeListener method)public static removeListener(listener:Object) : BooleanRemoves an object that was previously registered with addListener(). Note: This method is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.Parameterslistener:Object - An object.ReturnsBoolean - If the listener object is successfully removed, the method returns true; if the listener object is not successfully removed (for example, if it was not on the Mouse object&#39;s listener list), the method returns false.ExampleThe following example attaches three buttons to the Stage, and lets the user draw lines in the SWF file at runtime, using the mouse pointer. One button clears all of the lines from the SWF file. The second button removes the mouse listener so the user cannot draw lines. The third button adds the mouse listener after it is removed, so the user can draw lines again. Add the following ActionScript to Frame 1 of the Timeline: this.createClassObject(mx.controls.Button, &quot;clear_button&quot;, this.getNextHighestDepth(), {_x:10, _y:10, label:&#39;clear&#39;}this.createClassObject(mx.controls.Button, &quot;stopDrawing_button&quot;, this.getNextHighestDepth(), {_x:120, _y:10, label:&#39;stop drawing&#39;}this.createClassObject(mx.controls.Button, &quot;startDrawing_button&quot;, this.getNextHighestDepth(), {_x:230, _y:10, label:&#39;start drawing&#39;}startDrawing_button.enabled = false;//this.createEmptyMovieClip(&quot;canvas_mc&quot;, this.getNextHighestDepth()var mouseListener:Object = new Object(mouseListener.onMouseDown = function() { this.isDrawing = true; canvas_mc.lineStyle(2, 0xFF0000, 100 canvas_mc.moveTo(_xmouse, _ymouse};mouseListener.onMouseMove = function() { if (this.isDrawing) { canvas_mc.lineTo(_xmouse, _ymouse } updateAfterEvent(};mouseListener.onMouseUp = function() { this.isDrawing = false;};Mouse.addListener(mouseListenervar clearListener:Object = new Object(clearListener.click = function() { canvas_mc.clear(};clear_button.addEventListener(&quot;click&quot;, clearListener//var stopDrawingListener:Object = new Object(stopDrawingListener.click = function(evt:Object) { Mouse.removeListener(mouseListener evt.target.enabled = false; startDrawing_button.enabled = true;};stopDrawing_button.addEventListener(&quot;click&quot;, stopDrawingListenervar startDrawingListener:Object = new Object(startDrawingListener.click = function(evt:Object) { Mouse.addListener(mouseListener evt.target.enabled = false; stopDrawing_button.enabled = true;};startDrawing_button.addEventListener(&quot;click&quot;, startDrawingListener" />
   <page href="00005308.html" title="MovieClip" text="ModifiersPropertyDescription_alpha:NumberThe alpha transparency value of the movie clip._currentframe:Number [read-only]Returns the number of the frame in which the playhead is located in the movie clip&#39;s Timeline._droptarget:String [read-only]Returns the absolute path in slash-syntax notation of the movie clip instance on which this movie clip was dropped.enabled:BooleanA Boolean value that indicates whether a movie clip is enabled.focusEnabled:BooleanIf the value is undefined or false, a movie clip cannot receive input focus unless it is a button._focusrect:BooleanA Boolean value that specifies whether a movie clip has a yellow rectangle around it when it has input focus._framesloaded:Number [read-only]The number of frames that are loaded from a streaming SWF file._height:NumberThe height of the movie clip, in pixels._highquality:NumberDeprecated since Flash Player 7. This property was deprecated in favor of MovieClip._quality.Specifies the level of anti-aliasing applied to the current SWF file.hitArea:ObjectDesignates another movie clip to serve as the hit area for a movie clip._lockroot:BooleanA Boolean value that specifies what _root refers to when a SWF file is loaded into a movie clip._name:StringThe instance name of the movie clip._parent:MovieClipA reference to the movie clip or object that contains the current movie clip or object._quality:StringSets or retrieves the rendering quality used for a SWF file._rotation:NumberSpecifies the rotation of the movie clip, in degrees, from its original orientation._soundbuftime:NumberSpecifies the number of seconds a sound prebuffers before it starts to stream.tabChildren:BooleanDetermines whether the children of a movie clip are included in the automatic tab ordering.tabEnabled:BooleanSpecifies whether the movie clip is included in automatic tab ordering.tabIndex:NumberLets you customize the tab ordering of objects in a movie._target:String [read-only]Returns the target path of the movie clip instance, in slash notation._totalframes:Number [read-only]Returns the total number of frames in the movie clip instance specified in the MovieClip parameter.trackAsMenu:BooleanA Boolean value that indicates whether other buttons or movie clips can receive a release event from a mouse or stylus._url:String [read-only]Retrieves the URL of the SWF, JPEG, GIF, or PNG file from which the movie clip was downloaded._visible:BooleanA Boolean value that indicates whether the movie clip is visible._width:NumberThe width of the movie clip, in pixels._x:NumberAn integer that sets the x coordinate of a movie clip relative to the local coordinates of the parent movie clip._xmouse:Number [read-only]Returns the x coordinate of the mouse position._xscale:NumberSets the horizontal scale (percentage) of the movie clip as applied from the registration point of the movie clip._y:NumberSets the y coordinate of a movie clip relative to the local coordinates of the parent movie clip._ymouse:Number [read-only]Indicates the y coordinate of the mouse position._yscale:NumberSets the vertical scale (percentage) of the movie clip as applied from the registration point of the movie clip.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)EventDescriptiononData = function() {}Invoked when a movie clip receives data from a MovieClip.loadVariables() or MovieClip.loadMovie() call.onDragOut = function() {}Invoked when the mouse button is pressed and the pointer rolls outside the object.onDragOver = function() {}Invoked when the pointer is dragged outside and then over the movie clip.onEnterFrame = function() {}Invoked repeatedly at the frame rate of the SWF file.onKeyDown = function() {}Invoked when a movie clip has input focus and a key is pressed.onKeyUp = function() {}Invoked when a key is released.onKillFocus = function(newFocus:Object) {}Invoked when a movie clip loses input focus.onLoad = function() {}Invoked when the movie clip is instantiated and appears in the Timeline.onMouseDown = function() {}Invoked when the mouse button is pressed.onMouseMove = function() {}Invoked when the mouse moves.onMouseUp = function() {}Invoked when the mouse button is released.onPress = function() {}Invoked when the user clicks the mouse while the pointer is over a movie clip.onRelease = function() {}Invoked when the mouse button is released over a movie clip.onReleaseOutside = function() {}Invoked when the mouse button is pressed inside the movie clip area and then released outside the movie clip area.onRollOut = function() {}Invoked when the pointer moves outside a movie clip area.onRollOver = function() {}Invoked when the pointer moves over a movie clip area.onSetFocus = function(oldFocus:Object) {}Invoked when a movie clip receives input focus.onUnload = function() {}Invoked in the first frame after the movie clip is removed from the Timeline.ModifiersSignatureDescriptionattachMovie(id:String, name:String, depth:Number, [initObject:Object]) : MovieClipTakes a symbol from the library and attaches it to the movie clip.beginFill(rgb:Number, [alpha:Number]) : VoidIndicates the beginning of a new drawing path.beginGradientFill(fillType:String, colors:Array, alphas:Array, ratios:Array, matrix:Object) : VoidIndicates the beginning of a new drawing path.clear() : VoidRemoves all the graphics created during runtime by using the movie clip draw methods, including line styles specified with MovieClip.lineStyle().createEmptyMovieClip(name:String, depth:Number) : MovieClipCreates an empty movie clip as a child of an existing movie clip.createTextField(instanceName:String, depth:Number, x:Number, y:Number, width:Number, height:Number) : TextFieldCreates a new, empty text field as a child of the movie clip on which you call this method.curveTo(controlX:Number, controlY:Number, anchorX:Number, anchorY:Number) : VoidDraws a curve using the current line style from the current drawing position to (anchorX, anchorY) using the control point that (controlX, controlY) specifies.duplicateMovieClip(name:String, depth:Number, [initObject:Object]) : MovieClipCreates an instance of the specified movie clip while the SWF file is playing.endFill() : VoidApplies a fill to the lines and curves added since the last call to beginFill() or beginGradientFill().getBounds(bounds:Object) : ObjectReturns properties that are the minimum and maximum x and y coordinate values of the movie clip, based on the bounds parameter.getBytesLoaded() : NumberReturns the number of bytes that have already loaded (streamed) for the movie clip.getBytesTotal() : NumberReturns the size, in bytes, of the movie clip.getDepth() : NumberReturns the depth of the movie clip instance.getInstanceAtDepth(depth:Number) : MovieClipDetermines if a particular depth is already occupied by a movie clip.getNextHighestDepth() : NumberDetermines a depth value that you can pass to MovieClip.attachMovie(), MovieClip.duplicateMovieClip(), or MovieClip.createEmptyMovieClip() to ensure that Flash renders the movie clip in front of all other objects on the same level and layer in the current movie clip.getSWFVersion() : NumberReturns an integer that indicates the Flash Player version for the movie clip was published.getURL(url:String, [window:String], [method:String]) : VoidLoads a document from the specified URL into the specified window.globalToLocal(pt:Object) : VoidConverts the pt object from Stage (global) coordinates to the movie clip&#39;s (local) coordinates.gotoAndPlay(frame:Object) : VoidStarts playing the SWF file at the specified frame.gotoAndStop(frame:Object) : VoidBrings the playhead to the specified frame of the movie clip and stops it there.hitTest() : BooleanEvaluates the movie clip to see if it overlaps or intersects with the hit area that the target or x and y coordinate parameters identify.lineStyle(thickness:Number, rgb:Number, alpha:Number, pixelHinting:Boolean, noScale:String, capsStyle:String, jointStyle:String, miterLimit:Number) : VoidSpecifies a line style that Flash uses for subsequent calls to lineTo() and curveTo() until you call lineStyle() with different parameters.lineTo(x:Number, y:Number) : VoidDraws a line using the current line style from the current drawing position to (x, y the current drawing position is then set to (x, y).loadMovie(url:String, [method:String]) : VoidLoads SWF or JPEG files into a movie clip in Flash Player while the original SWF file is playing.loadVariables(url:String, [method:String]) : VoidReads data from an external file and sets the values for variables in the movie clip.localToGlobal(pt:Object) : VoidConverts the pt object from the movie clip&#39;s (local) coordinates to the Stage (global) coordinates.moveTo(x:Number, y:Number) : VoidMoves the current drawing position to (x, y).nextFrame() : VoidSends the playhead to the next frame and stops it.play() : VoidMoves the playhead in the Timeline of the movie clip.prevFrame() : VoidSends the playhead to the previous frame and stops it.removeMovieClip() : VoidRemoves a movie clip instance created with duplicateMovieClip(), MovieClip.duplicateMovieClip(), MovieClip.createEmptyMovieClip(), or MovieClip.attachMovie().setMask(mc:Object) : VoidMakes the movie clip in the parameter mc a mask that reveals the calling movie clip.startDrag([lockCenter:Boolean], [left:Number], [top:Number], [right:Number], [bottom:Number]) : VoidLets the user drag the specified movie clip.stop() : VoidStops the movie clip currently playing.stopDrag() : VoidEnds a MovieClip.startDrag() method.swapDepths(target:Object) : VoidSwaps the stacking, or depth level (z-order), of this movie clip with the movie clip specified by the target parameter, or with the movie clip that currently occupies the depth level specified in the target parameter.unloadMovie() : VoidRemoves the contents of a movie clip instance.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)MovieClipObject | +-MovieClippublic dynamic class MovieClipextends ObjectThe methods for the MovieClip class provide the same functionality as actions that target movie clips. Some additional methods do not have equivalent actions in the Actions toolbox in the Actions panel. You do not use a constructor method to create a new movie clip. You can choose from among three methods to create new movie clip instances:The attachMovie() method allows you to create a new movie clip instance based on a movie clip symbol that exists in the library.The createEmptyMovieClip() method allows you to create a new, empty movie clip instance as a child based on another movie clip.The duplicateMovieClip() method allows you to create a movie clip instance based on another movie clip.To call the methods of the MovieClip class you reference movie clip instances by name, using the following syntax, where my_mc is a movie clip instance:my_mc.play(my_mc.gotoAndPlay(3You can extend the methods and event handlers of the MovieClip class by creating a subclass. Property summaryProperties inherited from class ObjectEvent summaryMethod summaryMethods inherited from class Object" />
   <page href="00005309.html" title="_alpha (MovieClip._alpha property)" text="_alpha (MovieClip._alpha property)public _alpha : NumberThe alpha transparency value of the movie clip. Valid values are 0 (fully transparent) to 100 (fully opaque). The default value is 100. Objects in a movie clip with _alpha set to 0 are active, even though they are invisible. For example, you can still click a button in a movie clip whose _alpha property is set to 0. To disable the button completely, you can set the movie clip&#39;s _visible property to false. You can extend the methods and event handlers of the MovieClip class by creating a subclass.ExampleThe following code sets the _alpha property of a dynamically created movie clip named triangle to 50% when the mouse rolls over the movie clip. Add the following ActionScript to your FLA or AS file: this.createEmptyMovieClip(&quot;triangle&quot;, this.getNextHighestDepth()triangle.beginFill(0x0000FF, 100triangle.moveTo(10, 10triangle.lineTo(10, 100triangle.lineTo(100, 10triangle.lineTo(10, 10triangle.onRollOver = function() { this._alpha = 50;};triangle.onRollOut = function() { this._alpha = 100;};See also_alpha (Button._alpha property), _alpha (TextField._alpha property), _visible (MovieClip._visible property)" />
   <page href="00005310.html" title="attachMovie (MovieClip.attachMovie method)" text="attachMovie (MovieClip.attachMovie method)public attachMovie(id:String, name:String, depth:Number, [initObject:Object]) : MovieClipTakes a symbol from the library and attaches it to the movie clip. Use MovieClip.removeMovieClip() or MovieClip.unloadMovie() to remove a SWF file attached with attachMovie(). You can extend the methods and event handlers of the MovieClip class by creating a subclass.Parametersid:String - The linkage name of the movie clip symbol in the library to attach to a movie clip on the Stage. This is the name entered in the Identifier field in the Linkage Properties dialog box.name:String - A unique instance name for the movie clip being attached to the movie clip.depth:Number - An integer specifying the depth level where the SWF file is placed.initObject:Object [optional] - (Supported for Flash Player 6 and later) An object containing properties with which to populate the newly attached movie clip. This parameter allows dynamically created movie clips to receive clip parameters. If initObject is not an object, it is ignored. All properties of initObject are copied into the new instance. The properties specified with initObject are available to the constructor function.ReturnsMovieClip - A reference to the newly created instance.ExampleThe following example attaches the symbol with the linkage identifier &quot;circle&quot; to the movie clip instance, which is on the Stage in the SWF file:this.attachMovie(&quot;circle&quot;, &quot;circle1_mc&quot;, this.getNextHighestDepth()this.attachMovie(&quot;circle&quot;, &quot;circle2_mc&quot;, this.getNextHighestDepth(), {_x:100, _y:100}See alsoremoveMovieClip (MovieClip.removeMovieClip method), unloadMovie (MovieClip.unloadMovie method), removeMovieClip function" />
   <page href="00005311.html" title="beginFill (MovieClip.beginFill method)" text="beginFill (MovieClip.beginFill method)public beginFill(rgb:Number, [alpha:Number]) : VoidIndicates 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 a fill is 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.Parametersrgb:Number - 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.alpha:Number [optional] - An integer from 0 to 100 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.ExampleThe following example creates a square with red fill on the Stage: this.createEmptyMovieClip(&quot;square_mc&quot;, this.getNextHighestDepth()square_mc.beginFill(0xFF0000square_mc.moveTo(10, 10square_mc.lineTo(100, 10square_mc.lineTo(100, 100square_mc.lineTo(10, 100square_mc.lineTo(10, 10square_mc.endFill(An example is also in the drawingapi.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample.See alsomoveTo (MovieClip.moveTo method), endFill (MovieClip.endFill method), beginGradientFill (MovieClip.beginGradientFill method)" />
   <page href="00005312.html" title="beginGradientFill (MovieClip.beginGradientFill method)" text="beginGradientFill (MovieClip.beginGradientFill method)public beginGradientFill(fillType:String, colors:Array, alphas:Array, ratios:Array, matrix:Object) : VoidIndicates 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 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 you call MovieClip.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 &quot;linear&quot; or &quot;radial&quot;.Any of the fields in the object for the matrix parameter are missing or invalid.You can extend the methods and event handlers of the MovieClip class by creating a subclass.ParametersfillType:String - Either the string &quot;linear&quot; or the string &quot;radial&quot;.colors:Array - 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:Array - An array of alpha values for the corresponding colors in the colors array; valid values are 0-100. If the value is less than 0, Flash uses 0. If the value is greater than 100, Flash uses 100.ratios:Array - An array of color distribution ratios; valid values are 0-255. This value defines the percentage of the width where the color is sampled at 100 percent.matrix:Object - A transformation matrix that is an object with either of the following two sets of properties: a, b, c, d, e, f, g, h, i, which can be used to describe a 3 x 3 matrix of the following form:  a b c d e f g h iThe following example uses the beginGradientFill() method with a matrix parameter of this type://import flash.geom.*this.createEmptyMovieClip(&quot;gradient_mc&quot;, this.getNextHighestDepth()gradient_mc._x = -100;gradient_mc._y = -100;with (gradient_mc) { colors = [0xFF0000, 0x0000FF]; fillType = &quot;radial&quot; alphas = [100, 100]; ratios = [0, 0xFF]; matrix = {a:200, b:0, c:0, d:0, e:200, f:0, g:200, h:200, i:1}; beginGradientFill(fillType, colors, alphas, ratios, matrix moveTo(100, 100 lineTo(100, 300 lineTo(300, 300 lineTo(300, 100 lineTo(100, 100 endFill(} This code draws the following image on the screen:matrixType, x, y, w, h, r. The properties indicate the following: matrixType is the string &quot;box&quot;, 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 the beginGradientFill() method with a matrix parameter of this type://import flash.geom.*this.createEmptyMovieClip(&quot;gradient_mc&quot;, this.getNextHighestDepth()gradient_mc._x = -100;gradient_mc._y = -100;with (gradient_mc) { colors = [0xFF0000, 0x0000FF]; fillType = &quot;radial&quot; alphas = [100, 100]; ratios = [0, 0xFF]; matrix = {matrixType:&quot;box&quot;, x:100, y:100, w:200, h:200,  r:(45/180)*Math.PI}; beginGradientFill(fillType, colors, alphas, ratios, matrix  moveTo(100, 100 lineTo(100, 300 lineTo(300, 300 lineTo(300, 100 lineTo(100, 100 endFill(}This code draws the following image on the screen:See alsobeginFill (MovieClip.beginFill method), endFill (MovieClip.endFill method), lineStyle (MovieClip.lineStyle method), lineTo (MovieClip.lineTo method), moveTo (MovieClip.moveTo method)" />
   <page href="00005313.html" title="clear (MovieClip.clear method)" text="clear (MovieClip.clear method)public clear() : VoidRemoves all the graphics created during runtime by using the movie clip draw methods, including line styles specified with MovieClip.lineStyle(). Shapes and lines that are manually drawn during authoring time (with the Flash drawing tools) are unaffected.ExampleThe following example draws a box on the Stage. When the user clicks the box graphic, it removes the graphic from the Stage. this.createEmptyMovieClip(&quot;box_mc&quot;, this.getNextHighestDepth()box_mc.onRelease = function() { this.clear(};drawBox(box_mc, 10, 10, 320, 240function drawBox(mc:MovieClip, x:Number, y:Number, w:Number, h:Number):Void { mc.lineStyle(0 mc.beginFill(0xEEEEEE mc.moveTo(x, y mc.lineTo(x+w, y mc.lineTo(x+w, y+h mc.lineTo(x, y+h mc.lineTo(x, y mc.endFill(}An example is also in the drawingapi.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample.See alsolineStyle (MovieClip.lineStyle method)" />
   <page href="00005314.html" title="createEmptyMovieClip (MovieClip.createEmptyMovieClip method)" text="createEmptyMovieClip (MovieClip.createEmptyMovieClip method)public createEmptyMovieClip(name:String, depth:Number) : MovieClipCreates an empty movie clip as a child of an existing movie clip. This method behaves similarly to the attachMovie() method, but you don&#39;t need to provide an external linkage identifier for the new movie clip. The registration point for a newly created empty movie clip is the upper-left corner. This method fails if any of the parameters are missing. You can extend the methods and event handlers of the MovieClip class by creating a subclass.Parametersname:String - A string that identifies the instance name of the new movie clip.depth:Number - An integer that specifies the depth of the new movie clip.ReturnsMovieClip - A reference to the newly created movie clip.ExampleThe following example creates an empty MovieClip named container, creates a new TextField inside of it, and then sets the new TextField.text property. var container:MovieClip = this.createEmptyMovieClip(&quot;container&quot;, this.getNextHighestDepth()var label:TextField = container.createTextField(&quot;label&quot;, 1, 0, 0, 150, 20label.text = &quot;Hello World&quot;;See alsoattachMovie (MovieClip.attachMovie method)" />
   <page href="00005315.html" title="createTextField (MovieClip.createTextField method)" text="createTextField (MovieClip.createTextField method)public createTextField(instanceName:String, depth:Number, x:Number, y:Number, width:Number, height:Number) : TextFieldCreates a new, empty text field as a child of the movie clip on which you call this method. You can use the createTextField() method to create text fields while a SWF file plays. The depth parameter determines the new text field&#39;s depth level (z-order position) in the movie clip. Each depth level can contain only one object. If you create a new text field on a depth that already has a text field, the new text field replaces the existing text field. To avoid overwriting existing text fields, use MovieClip.getInstanceAtDepth() to determine whether a specific depth is already occupied, or MovieClip.getNextHighestDepth(), to determine the highest unoccupied depth. The text field is positioned at (x, y) with dimensions width by height. The x and y parameters are relative to the container movie clip; these parameters correspond to the _x and _y properties of the text field. The width and height parameters correspond to the _width and _height properties of the text field. The default properties of a text field are as follows:type = &quot;dynamic&quot;border = falsebackground = falsepassword = falsemultiline = falsehtml = falseembedFonts = falseselectable = truewordWrap = falsemouseWheelEnabled = truecondenseWhite = falserestrict = nullvariable = nullmaxChars = nullstyleSheet = undefinedtabInded = undefinedA text field created with createTextField() receives the following default TextFormat object settings:font = &quot;Times New Roman&quot; // &quot;Times&quot; on Mac OSsize = 12color = 0x000000bold = falseitalic = falseunderline = falseurl = &quot;&quot;target = &quot;&quot;align = &quot;left&quot;leftMargin = 0rightMargin = 0indent = 0leading = 0blockIndent = 0bullet = falsedisplay = blocktabStops = [] // (empty array)You can extend the methods and event handlers of the MovieClip class by creating a subclass.ParametersinstanceName:String - A string that identifies the instance name of the new text field.depth:Number - A positive integer that specifies the depth of the new text field.x:Number - An integer that specifies the x coordinate of the new text field.y:Number - An integer that specifies the ycoordinate of the new text field.width:Number - A positive integer that specifies the width of the new text field.height:Number - A positive integer that specifies the height of the new text field.ReturnsTextField - ExampleThe following example creates a text field with a width of 300, a height of 100, an x coordinate of 100, a y coordinate of 100, no border, red, and underlined text: this.createTextField(&quot;my_txt&quot;, 1, 100, 100, 300, 100my_txt.multiline = true;my_txt.wordWrap = true;var my_fmt:TextFormat = new TextFormat(my_fmt.color = 0xFF0000;my_fmt.underline = true;my_txt.text = &quot;This is my first test field object text.&quot;;my_txt.setTextFormat(my_fmtAn example is also in the animations.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample.See alsogetInstanceAtDepth (MovieClip.getInstanceAtDepth method), getNextHighestDepth (MovieClip.getNextHighestDepth method), getNewTextFormat (TextField.getNewTextFormat method)" />
   <page href="00005316.html" title="_currentframe (MovieClip._currentframe property)" text="_currentframe (MovieClip._currentframe property)public _currentframe : Number [read-only]Returns the number of the frame in which the playhead is located in the movie clip&#39;s Timeline.ExampleThe following example uses the _currentframe property to direct the playhead of the actionClip_mc movie clip to advance five frames ahead of its current location: actionClip_mc.gotoAndStop(actionClip_mc._currentframe + 5" />
   <page href="00005317.html" title="curveTo (MovieClip.curveTo method)" text="curveTo (MovieClip.curveTo method)public curveTo(controlX:Number, controlY:Number, anchorX:Number, anchorY:Number) : VoidDraws a curve using the current line style from the current drawing position to (anchorX, anchorY) using the control point that ((controlX, controlY) specifies. The current drawing position is then set to (anchorX, anchorY). If the movie clip you are drawing in contains content created with the Flash drawing tools, calls to curveTo() are drawn underneath this content. If you call the curveTo() method before any calls to the moveTo() method, the current drawing position defaults to (0,0). If any of the parameters are missing, this method fails and the current drawing position is not changed. You can extend the methods and event handlers of the MovieClip class by creating a subclass.ParameterscontrolX:Number - An integer that specifies the horizontal position of the control point relative to the registration point of the parent movie clip.controlY:Number - An integer that specifies the vertical position of the control point relative to the registration point of the parent movie clip.anchorX:Number - An integer that specifies the horizontal position of the next anchor point relative to the registration point of the parent movie clip.anchorY:Number - An integer that specifies the vertical position of the next anchor point relative to the registration point of the parent movie clip.ExampleThe following example draws a nearly circular curve with a solid blue hairline stroke and a solid red fill: this.createEmptyMovieClip(&quot;circle_mc&quot;, 1with (circle_mc) { lineStyle(0, 0x0000FF, 100 beginFill(0xFF0000 moveTo(0, 100 curveTo(0,200,100,200 curveTo(200,200,200,100 curveTo(200,0,100,0 curveTo(0,0,0,100 endFill(}The curve drawn in this example is a quadratic Bezier curve. Quadratic Bezier curves consist of two anchor points and a control point. The curve interpolates the two anchor points, and curves toward the control point. The following script uses the curveTo() method and the Math class to create a circle:this.createEmptyMovieClip(&quot;circle2_mc&quot;, 2circle2_mc.lineStyle(0, 0x000000drawCircle(circle2_mc, 100, 100, 100function drawCircle(mc:MovieClip, x:Number, y:Number, r:Number):Void { 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, &#39;+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}An example is also in the drawingapi.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample.See alsobeginFill (MovieClip.beginFill method), createEmptyMovieClip (MovieClip.createEmptyMovieClip method), endFill (MovieClip.endFill method), lineStyle (MovieClip.lineStyle method), lineTo (MovieClip.lineTo method), moveTo (MovieClip.moveTo method), Math" />
   <page href="00005318.html" title="_droptarget (MovieClip._droptarget property)" text="_droptarget (MovieClip._droptarget property)public _droptarget : String [read-only]Returns the absolute path in slash-syntax notation of the movie clip instance on which this movie clip was dropped. The _droptarget property always returns a path that starts with a slash (/). To compare the _droptarget property of an instance to a reference, use the eval() function to convert the returned value from slash syntax to a dot-syntax reference (ActionScript 2.0 does not support slash syntax.) Note: This property is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example evaluates the _droptarget property of the garbage_mc movie clip instance and uses eval() to convert it from slash syntax to a dot syntax reference. The garbage_mc reference is then compared to the reference to the trashcan_mc movie clip instance. If the two references are equivalent, the visibility of garbage_mc is set to false. If they are not equivalent, the garbage instance resets to its original position. origX = garbage_mc._x;origY = garbage_mc._y;garbage_mc.onPress = function() { this.startDrag(};garbage_mc.onRelease = function() { this.stopDrag( if (eval(this._droptarget) == trashcan_mc) { this._visible = false; } else { this._x = origX; this._y = origY; }};See alsostartDrag (MovieClip.startDrag method), stopDrag (MovieClip.stopDrag method), eval function" />
   <page href="00005319.html" title="duplicateMovieClip (MovieClip.duplicateMovieClip method)" text="duplicateMovieClip (MovieClip.duplicateMovieClip method)public duplicateMovieClip(name:String, depth:Number, [initObject:Object]) : MovieClipCreates an instance of the specified movie clip while the SWF file is playing. Duplicated movie clips always start playing at Frame 1, no matter what frame the original movie clip is on when the duplicateMovieClip() method is called. Variables in the parent movie clip are not copied into the duplicate movie clip. Movie clips that are created with the duplicateMovieClip() method are not duplicated if you call the duplicateMovieClip() method on their parent. If the parent movie clip is deleted, the duplicate movie clip is also deleted. If you used MovieClip.loadMovie() or the MovieClipLoader class to load a movie clip, the contents of the SWF file are not duplicated. This means that you cannot save bandwidth by loading a JPEG, GIF, PNG, or SWF file and then duplicating the movie clip. Contrast this method with the global function version of duplicateMovieClip(). The global version of this method requires a parameter that specifies the target movie clip to duplicate. Such a parameter is unnecessary for the MovieClip class version, because the target of the method is the movie clip instance on which the method is invoked. Moreover, the global version of duplicateMovieClip() supports neither the initobject parameter nor the return value of a reference to the newly created MovieClip instance.Parametersname:String - A unique identifier for the duplicate movie clip.depth:Number - A unique integer specifying the depth at which the new movie clip is placed. Use depth -16384 to place the new movie clip instance beneath all content created in the authoring environment. Values between -16383 and -1, inclusive, are reserved for use by the authoring environment and should not be used with this method. The remaining valid depth values range from 0 to 1048575, inclusive.initObject:Object [optional] - (Supported for Flash Player 6 and later.) An object containing properties with which to populate the duplicated movie clip. This parameter allows dynamically created movie clips to receive clip parameters. If initObject is not an object, it is ignored. All properties of initObject are copied into the new instance. The properties specified with initObject are available to the constructor function.ReturnsMovieClip - A reference to the duplicated movie clip (supported for Flash Player 6 and later).ExampleThe following example duplicates a newly created MovieClip a number of times and traces the target for each duplicate. var container:MovieClip = setUpContainer(var ln:Number = 10;var spacer:Number = 1;var duplicate:MovieClip;for(var i:Number = 1; i &lt; ln; i++) { var newY:Number = i * (container._height + spacer duplicate = container.duplicateMovieClip(&quot;clip-&quot; + i, i, {_y:newY} trace(duplicate // _level0.clip-[number]}function setUpContainer():MovieClip { var mc:MovieClip = this.createEmptyMovieClip(&quot;container&quot;, this.getNextHighestDepth() var w:Number = 100; var h:Number = 20; mc.beginFill(0x333333 mc.lineTo(w, 0 mc.lineTo(w, h mc.lineTo(0, h mc.lineTo(0, 0 mc.endFill( return mc;}See alsoloadMovie (MovieClip.loadMovie method), removeMovieClip (MovieClip.removeMovieClip method), duplicateMovieClip function" />
   <page href="00005320.html" title="enabled (MovieClip.enabled property)" text="enabled (MovieClip.enabled property)public enabled : BooleanA Boolean value that indicates whether a movie clip is enabled. The default value of enabled is true. If enabled is set to false, the movie clip&#39;s callback methods and onaction event handlers are no longer invoked, and the Over, Down, and Up frames are disabled. The enabled property does not affect the Timeline of the movie clip; if a movie clip is playing, it continues to play. The movie clip continues to receive movie clip events (for example, mouseDown, mouseUp, keyDown, and keyUp). The enabled property only governs the button-like properties of a movie clip. You can change the enabled property at any time; the modified movie clip is immediately enabled or disabled. The enabled property can be read out of a prototype object. If enabled is set to false, the object is not included in automatic tab ordering.ExampleThe following example disables the circle_mc movie clip when the user clicks it: circle_mc.onRelease = function() { trace(&quot;disabling the &quot;+this._name+&quot; movie clip.&quot; this.enabled = false;};" />
   <page href="00005321.html" title="endFill (MovieClip.endFill method)" text="endFill (MovieClip.endFill method)public endFill() : VoidApplies a fill to the lines and curves added since the last call to beginFill() or beginGradientFill(). Flash uses the fill that was specified in the previous call to beginFill() or beginGradientFill(). If the current drawing position does not equal the previous position specified in a moveTo() method and a fill is defined, the path is closed with a line and then filled.ExampleThe following example creates a square with red fill on the Stage: this.createEmptyMovieClip(&quot;square_mc&quot;, this.getNextHighestDepth()square_mc.beginFill(0xFF0000square_mc.moveTo(10, 10square_mc.lineTo(100, 10square_mc.lineTo(100, 100square_mc.lineTo(10, 100square_mc.lineTo(10, 10square_mc.endFill(An example is also in the drawingapi.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample.See alsobeginFill (MovieClip.beginFill method), beginGradientFill (MovieClip.beginGradientFill method), moveTo (MovieClip.moveTo method)" />
   <page href="00005322.html" title="focusEnabled (MovieClip.focusEnabled property)" text="focusEnabled (MovieClip.focusEnabled property)public focusEnabled : BooleanIf the value is undefined or false, a movie clip cannot receive input focus unless it is a button. If the focusEnabled property value is true, a movie clip can receive input focus even if it is not a button.ExampleThe following example sets the focusEnabled property for the movie clip my_mc to false: my_mc.focusEnabled = false;" />
   <page href="00005323.html" title="_focusrect (MovieClip._focusrect property)" text="_focusrect (MovieClip._focusrect property)public _focusrect : BooleanA Boolean value that specifies whether a movie clip has a yellow rectangle around it when it has input focus. This property can override the global _focusrect property. The default value of the _focusrect property of a movie clip instance is null; the movie clip instance does not override the global _focusrect property. If the _focusrect property of a movie clip instance is set to true or false, it overrides the setting of the global _focusrect property for the single movie clip instance. Note: For Flash Lite 2.0, when the _focusrect property is disabled (in other words, MovieClip._focusrect is set to false), the movie clip still receives all key press and mouse events. Also for Flash Lite 2.0, you can change the color of the focus rectangle using the fscommand2 SetFocusRectColor command. This behavior is different from Flash Player, for which the color of the focus rectangle is restricted to yellow.ExampleThis example demonstrates how to hide the yellow rectangle around a specified movie clip instance in a SWF file when the instance has focus in a browser window. Create three movie clips called mc1_mc, mc2_mc, and mc3_mc, and add the following ActionScript to Frame 1 of the Timeline: mc1_mc._focusrect = true;mc2_mc._focusrect = false;mc3_mc._focusrect = true;mc1_mc.onRelease = traceOnRelease;mc3_mc.onRelease = traceOnRelease;function traceOnRelease() { trace(this._name}To test the SWF file in a browser window, select File &gt; Publish Preview &gt; HTML. To give the SWF focus, click it in the browser window and press Tab to focus each instance. You cannot execute code for this movie clip in the browser by pressing Enter or the Spacebar when _focusrect is disabled.You can also test your SWF file in the test environment. Select Control &gt; Disable Keyboard Shortcuts in the test environment. This allows you to view the focus rectangle around the instances in the SWF file.See also_focusrect property, _focusrect (Button._focusrect property)" />
   <page href="00005324.html" title="_framesloaded (MovieClip._framesloaded property)" text="_framesloaded (MovieClip._framesloaded property)public _framesloaded : Number [read-only]The number of frames that are loaded from a streaming SWF file. This property is useful for determining whether the contents of a specific frame, and all the frames before it, are loaded and are available locally in the browser. It is also useful for monitoring the downloading of large SWF files. For example, you might want to display a message to users indicating that the SWF file is loading until a specified frame in the SWF file has finished loading.ExampleThe following example uses the _framesloaded property to start a SWF file when all the frames are loaded. If all the frames aren&#39;t loaded, the _xscale property of the bar_mc movie clip instance is increased proportionally to create a progress bar. Enter the following ActionScript in Frame 1 of the Timeline:var pctLoaded:Number = Math.round(this.getBytesLoaded()/this.getBytesTotal()*100bar_mc._xscale = pctLoaded;Add the following code to Frame 2:if (this._framesloaded &lt; this._totalframes) { this.gotoAndPlay(1} else { this.gotoAndStop(3}Place your content on or after Frame 3. Then add the following code to Frame 3:stop(See alsoMovieClipLoader" />
   <page href="00005325.html" title="getBounds (MovieClip.getBounds method)" text="getBounds (MovieClip.getBounds method)public getBounds(bounds:Object) : ObjectReturns properties that are the minimum and maximum x and y coordinate values of the movie clip, based on the bounds parameter. Note: Use MovieClip.lcalToGlobal() and MovieClip.globalToLocal() to convert the movie clip&#39;s local coordinates to Stage coordinates, or Stage coordinates to local coordinates, respectively.You can extend the methods and event handlers of the MovieClip class by creating a subclass.Parametersbounds:Object - The target path of the Timeline whose coordinate system you want to use as a reference point.ReturnsObject - An object with the properties xMin, xMax, yMin, and yMax.ExampleThe following example creates a movie clip called square_mc. The code draws a square for that movie clip and uses MovieClip.getBounds() to display the coordinate values of the instance in the Output panel. this.createEmptyMovieClip(&quot;square_mc&quot;, 1square_mc._x = 10;square_mc._y = 10;square_mc.beginFill(0xFF0000square_mc.moveTo(0, 0square_mc.lineTo(100, 0square_mc.lineTo(100, 100square_mc.lineTo(0, 100square_mc.lineTo(0, 0square_mc.endFill(var bounds_obj:Object = square_mc.getBounds(thisfor (var i in bounds_obj) { trace(i+&quot; --&gt; &quot;+bounds_obj[i]}The following information appears in the Output panel:yMax --&gt; 110yMin --&gt; 10xMax --&gt; 110xMin --&gt; 10See alsoglobalToLocal (MovieClip.globalToLocal method), localToGlobal (MovieClip.localToGlobal method)" />
   <page href="00005326.html" title="getBytesLoaded (MovieClip.getBytesLoaded method)" text="getBytesLoaded (MovieClip.getBytesLoaded method)public getBytesLoaded() : NumberReturns the number of bytes that have already loaded (streamed) for the movie clip. You can compare this value with the value returned by MovieClip.getBytesTotal() to determine what percentage of a movie clip has loaded. You can extend the methods and event handlers of the MovieClip class by creating a subclass.ReturnsNumber - An integer indicating the number of bytes loaded.ExampleThe following example uses the _framesloaded property to start a SWF file when all the frames are loaded. If all the frames aren&#39;t loaded, the _xscale property of the loader movie clip instance is increased proportionally to create a progress bar. Enter the following ActionScript in Frame 1 of the Timeline:var pctLoaded:Number = Math.round(this.getBytesLoaded()/this.getBytesTotal() * 100bar_mc._xscale = pctLoaded;Add the following code to Frame 2:if (this._framesloaded&lt;this._totalframes) { this.gotoAndPlay(1} else { this.gotoAndStop(3}Place your content on or after Frame 3, and then add the following code to Frame 3:stop(See alsogetBytesTotal (MovieClip.getBytesTotal method)" />
   <page href="00005327.html" title="getBytesTotal (MovieClip.getBytesTotal method)" text="getBytesTotal (MovieClip.getBytesTotal method)public getBytesTotal() : NumberReturns the size, in bytes, of the movie clip. For movie clips that are external (the root SWF file or a movie clip that is being loaded into a target or a level), the return value is the uncompressed size of the SWF file. You can extend the methods and event handlers of the MovieClip class by creating a subclass.ReturnsNumber - An integer indicating the total size, in bytes, of the movie clip.ExampleThe following example uses the _framesloaded property to start a SWF file when all the frames are loaded. If all the frames aren&#39;t loaded, the _xscale property of the movie clip instance loader is increased proportionally to create a progress bar. Enter the following ActionScript in Frame 1 of the Timeline:var pctLoaded:Number = Math.round(this.getBytesLoaded()/this.getBytesTotal()*100bar_mc._xscale = pctLoaded;Add the following code to Frame 2:if (this._framesloaded&lt;this._totalframes) { this.gotoAndPlay(1} else { this.gotoAndStop(3}Place your content on or after Frame 3. Then add the following code to Frame 3:stop(See alsogetBytesLoaded (MovieClip.getBytesLoaded method)" />
   <page href="00005328.html" title="getDepth (MovieClip.getDepth method)" text="getDepth (MovieClip.getDepth method)public getDepth() : NumberReturns the depth of the movie clip instance. Each movie clip, button, and text field has a unique depth associated with it that determines how the object appears in front of or in back of other objects. Objects with higher depths appear in front.You can extend the methods and event handlers of the MovieClip class by creating a subclass.ReturnsNumber - The depth of the movie clip.ExampleThe following code traces the depth of all movie clip instances on the Stage: for (var i in this) { if (typeof (this[i]) == &quot;movieclip&quot;) { trace(&quot;movie clip &#39;&quot;+this[i]._name+&quot;&#39; is at depth &quot;+this[i].getDepth() }}See alsogetInstanceAtDepth (MovieClip.getInstanceAtDepth method), getNextHighestDepth (MovieClip.getNextHighestDepth method), swapDepths (MovieClip.swapDepths method), getDepth (TextField.getDepth method), getDepth (Button.getDepth method)" />
   <page href="00005329.html" title="getInstanceAtDepth (MovieClip.getInstanceAtDepth method)" text="getInstanceAtDepth (MovieClip.getInstanceAtDepth method)public getInstanceAtDepth(depth:Number) : MovieClipDetermines if a particular depth is already occupied by a movie clip. You can use this method before using MovieClip.attachMovie(), MovieClip.duplicateMovieClip(), or MovieClip.createEmptyMovieClip() to determine if the depth parameter you want to pass to any of these methods already contains a movie clip. You can extend the methods and event handlers of the MovieClip class by creating a subclass.Parametersdepth:Number - An integer that specifies the depth level to query.ReturnsMovieClip - A reference to the MovieClip instance located at the specified depth, or undefined if there is no movie clip at that depth.ExampleThe following example displays the depth occupied by the triangle movie clip instance in the Output panel: this.createEmptyMovieClip(&quot;triangle&quot;, 1triangle.beginFill(0x0000FF, 100triangle.moveTo(100, 100triangle.lineTo(100, 150triangle.lineTo(150, 100triangle.lineTo(100, 100trace(this.getInstanceAtDepth(1) // output: _level0.triangleSee alsoattachMovie (MovieClip.attachMovie method), duplicateMovieClip (MovieClip.duplicateMovieClip method), createEmptyMovieClip (MovieClip.createEmptyMovieClip method), getDepth (MovieClip.getDepth method), getNextHighestDepth (MovieClip.getNextHighestDepth method), swapDepths (MovieClip.swapDepths method)" />
   <page href="00005330.html" title="getNextHighestDepth (MovieClip.getNextHighestDepth method)" text="getNextHighestDepth (MovieClip.getNextHighestDepth method)public getNextHighestDepth() : NumberDetermines a depth value that you can pass to MovieClip.attachMovie(), MovieClip.duplicateMovieClip(), or MovieClip.createEmptyMovieClip() to ensure that Flash renders the movie clip in front of all other objects on the same level and layer in the current movie clip. The value returned is 0 or higher (that is, negative numbers are not returned). You can extend the methods and event handlers of the MovieClip class by creating a subclass.Note: You should not use this method if you are also using V2 components. If you placed a V2 component either on the stage or in the library, the getNextHighestDepth() method returns depth 1048676, which is outside the valid range. This can prevent successful calls to MovieClip.removeMovieClip().ReturnsNumber - An integer that reflects the next available depth index that would render above all other objects on the same level and layer within the movie clip.ExampleThe following example draws thre movie clip instances, using the getNextHighestDepth() method as the depth parameter of the createEmptyMovieClip() method, and labels each movie clip them with its depth: for (i = 0; i &lt; 3; i++) { drawClip(i}function drawClip(n:Number):Void { this.createEmptyMovieClip(&quot;triangle&quot; + n, this.getNextHighestDepth() var mc:MovieClip = eval(&quot;triangle&quot; + n mc.beginFill(0x00aaFF, 100 mc.lineStyle(4, 0xFF0000, 100 mc.moveTo(0, 0 mc.lineTo(100, 100 mc.lineTo(0, 100 mc.lineTo(0, 0 mc._x = n * 30; mc._y = n * 50 mc.createTextField(&quot;label&quot;, this.getNextHighestDepth(), 20, 50, 200, 200) mc.label.text = mc.getDepth(}See alsogetDepth (MovieClip.getDepth method), getInstanceAtDepth (MovieClip.getInstanceAtDepth method), swapDepths (MovieClip.swapDepths method), attachMovie (MovieClip.attachMovie method), duplicateMovieClip (MovieClip.duplicateMovieClip method), createEmptyMovieClip (MovieClip.createEmptyMovieClip method)" />
   <page href="00005331.html" title="getSWFVersion (MovieClip.getSWFVersion method)" text="getSWFVersion (MovieClip.getSWFVersion method)public getSWFVersion() : NumberReturns an integer that indicates the Flash Player version for the movie clip was published. If the movie clip is a JPEG, GIF, or PNG file, or if an error occurs and Flash can&#39;t determine the SWF version of the movie clip, -1 is returned. You can extend the methods and event handlers of the MovieClip class by creating a subclass.ReturnsNumber - An integer that specifies the Flash Player version that was targeted when the SWF file loaded into the movie clip was published.ExampleThe following example creates a new container and outputs the value of getSWFVersion(). It then uses MovieClipLoader to load an external SWF file that was published to Flash Player 7 and outputs the value of getSWFVersion() after the onLoadInit handler is triggered. var container:MovieClip = this.createEmptyMovieClip(&quot;container&quot;, this.getUpperEmptyDepth()var listener:Object = new Object(listener.onLoadInit = function(target:MovieClip):Void { trace(&quot;target: &quot; + target.getSWFVersion() // target: 7}var mcLoader:MovieClipLoader = new MovieClipLoader(mcLoader.addListener(listenertrace(&quot;container: &quot; + container.getSWFVersion() // container: 8mcLoader.loadClip(&quot;FlashPlayer7.swf&quot;, container" />
   <page href="00005332.html" title="getURL (MovieClip.getURL method)" text="getURL (MovieClip.getURL method)public getURL(url:String, [window:String], [method:String]) : VoidLoads a document from the specified URL into the specified window. The getURL() method can also be used to pass variables to another application defined at the URL by using a GET or POST method. Web pages that host Flash movies must explicitly set the allowScriptAccess attribute to allow or deny scripting for the Flash Player from the HTML code (in the PARAM tag for Internet Explorer or the EMBED tag for Netscape Navigator):When allowScriptAccess is &quot;never&quot;, outbound scripting always fails.When allowScriptAccess is &quot;always&quot;, outbound scripting always succeeds.When allowScriptAccess is &quot;sameDomain&quot; (supported by SWF files starting with version 8 ), outbound scripting is allowed if the SWF file is from the same domain as the hosting web page.If allowScriptAccess is not specified by an HTML page, it defaults to &quot;sameDomain&quot; for version 8 SWF files, and it defaults to &quot;always&quot; for earlier version SWF files.You can extend the methods and event handlers of the MovieClip class by creating a subclass.Parametersurl:String - The URL from which to obtain the document.window:String [optional] - A parameter specifying the name, frame, or expression that specifies the window or HTML frame that the document is loaded into. You can also use one of the following reserved target names: _self specifies the current frame in the current window, _blank specifies a new window, _parent specifies the parent of the current frame, and _top specifies the top-level frame in the current window.method:String [optional] - A String (either &quot;GET&quot; or &quot;POST&quot;) that specifies a method for sending variables associated with the SWF file to load. If no variables are present, omit this parameter; otherwise, specify whether to load variables using a GET or POST method. GET appends the variables to the end of the URL and is used for a small number of variables. POST sends the variables in a separate HTTP header and is used for long strings of variables.ExampleThe following ActionScript creates a new movie clip instance and opens the Macromedia website in a new browser window: this.createEmptyMovieClip(&quot;loader_mc&quot;, this.getNextHighestDepth()loader_mc.getURL(&quot;http://www.macromedia.com&quot;, &quot;_blank&quot;The getURL() method also allows you to send variables to a remove server-side script, as seen in the following code:this.createEmptyMovieClip(&quot;loader_mc&quot;, this.getNextHighestDepth()loader_mc.username = &quot;some user input&quot;;loader_mc.password = &quot;random string&quot;;loader_mc.getURL(&quot;http://www.flash-mx.com/mm/viewscope.cfm&quot;, &quot;_blank&quot;, &quot;GET&quot;See alsogetURL function, sendAndLoad (LoadVars.sendAndLoad method), send (LoadVars.send method)" />
   <page href="00005333.html" title="globalToLocal (MovieClip.globalToLocal method)" text="globalToLocal (MovieClip.globalToLocal method)public globalToLocal(pt:Object) : VoidConverts the pt object from Stage (global) coordinates to the movie clip&#39;s (local) coordinates. The MovieClip.globalToLocal() method allows you to convert any given x and y coordinates from values that are relative to the top-left corner of the Stage to values that are relative to the top-left corner of a specific movie clip.You must first create a generic object that has two properties, x and y. These x and y values (and they must be called x and y) are called the global coordinates because they relate to the top-left corner of the Stage. The x property represents the horizontal offset from the top-left corner. In other words, it represents how far to the right the point lies. For example, if x = 50, the point lies 50 pixels to the right of the top-left corner. The y property represents the vertical offset from the top-left corner. In other words, it represents how far down the point lies. For example, if y = 20, the point lies 20 pixels below the top-left corner. The following code creates a generic object with these coordinates:var myPoint:Object = new Object(myPoint.x = 50;myPoint.y = 20;Alternatively, you can create the object and assign the values at the same time with a literal Object value:var myPoint:Object = {x:50, y:20};After you create a point object with global coordinates, you can convert the coordinates to local coordinates. The globalToLocal() method doesn&#39;t return a value because it changes the values of x and y in the generic object that you send as the parameter. It changes them from values relative to the Stage (global coordinates) to values relative to a specific movie clip (local coordinates).For example, if you create a movie clip that is positioned at the point (_x:100, _y:100), and you pass the global point representing the top-left corner of the Stage (x:0, y:0) to the globalToLocal() method, the method should convert the x and y values to the local coordinates, which in this case is (x:-100, y:-100). This is because the x and y coordinates are now expressed relative to the top-left corner of your movie clip rather than the top-left corner of the stage. The values are negative because to get from the top-left corner of your movie clip to the top-left corner of the Stage you have to move 100 pixels to the left (negative x) and 100 pixels up (negative y).The movie clip coordinates were expressed using _x and _y, because those are the MovieClip properties that you use to set the x and y values for MovieClips. However, your generic object uses x and y without the underscore. The following code converts the x and y values to the local coordinates:var myPoint:Object = {x:0, y:0}; // Create your generic point object.this.createEmptyMovieClip(&quot;myMovieClip&quot;, this.getNextHighestDepth()myMovieClip._x = 100; // _x for movieclip x positionmyMovieClip._y = 100; // _y for movieclip y positionmyMovieClip.globalToLocal(myPointtrace (&quot;x: &quot; + myPoint.x // output: -100trace (&quot;y: &quot; + myPoint.y // output: -100You can extend the methods and event handlers of the MovieClip class by creating a subclass.Parameterspt:Object - The name or identifier of an object created with the generic Object class. The object specifies the x and y coordinates as properties.ExampleAdd the following ActionScript to a FLA or AS file in the same directory as an image called photo1.jpg: this.createTextField(&quot;coords_txt&quot;, this.getNextHighestDepth(), 10, 10, 100, 22coords_txt.html = true;coords_txt.multiline = true;coords_txt.autoSize = true;this.createEmptyMovieClip(&quot;target_mc&quot;, this.getNextHighestDepth()target_mc._x = 100;target_mc._y = 100;target_mc.loadMovie(&quot;photo1.jpg&quot;var mouseListener:Object = new Object(mouseListener.onMouseMove = function() { var point:Object = {x:_xmouse, y:_ymouse}; target_mc.globalToLocal(point var rowHeaders = &quot;&lt;b&gt; &amp;nbsp; t&lt;/b&gt;&lt;b&gt;_x t&lt;/b&gt;&lt;b&gt;_y&lt;/b&gt;&quot;; var row_1 = &quot;_root t&quot;+_xmouse+&quot; t&quot;+_ymouse; var row_2 = &quot;target_mc t&quot;+point.x+&quot; t&quot;+point.y; coords_txt.htmlText = &quot;&lt;textformat tabstops=&#39;[100, 150]&#39;&gt;&quot;; coords_txt.htmlText += rowHeaders; coords_txt.htmlText += row_1; coords_txt.htmlText += row_2; coords_txt.htmlText += &quot;&lt;/textformat&gt;&quot;;};Mouse.addListener(mouseListenerSee alsogetBounds (MovieClip.getBounds method), localToGlobal (MovieClip.localToGlobal method), Object" />
   <page href="00005334.html" title="gotoAndPlay (MovieClip.gotoAndPlay method)" text="gotoAndPlay (MovieClip.gotoAndPlay method)public gotoAndPlay(frame:Object) : VoidStarts playing the SWF file at the specified frame. To specify a scene as well as a frame, use gotoAndPlay(). You can extend the methods and event handlers of the MovieClip class by creating a subclass.Parametersframe:Object - A number representing the frame number, or a string representing the label of the frame, to which the playhead is sent.ExampleThe following example uses the _framesloaded property to start a SWF file when all of the frames are loaded. If all of the frames aren&#39;t loaded, the _xscale property of the loader movie clip instance is increased proportionally to create a progress bar. Enter the following ActionScript in Frame 1 of the Timeline:var pctLoaded:Number = Math.round(this.getBytesLoaded()/this.getBytesTotal()*100bar_mc._xscale = pctLoaded;Add the following code to Frame 2:if (this._framesloaded&lt;this._totalframes) { this.gotoAndPlay(1} else { this.gotoAndStop(3}Place your content on or after Frame 3. Then add the following code to Frame 3:stop(See alsogotoAndPlay function, play function" />
   <page href="00005335.html" title="gotoAndStop (MovieClip.gotoAndStop method)" text="gotoAndStop (MovieClip.gotoAndStop method)public gotoAndStop(frame:Object) : VoidBrings the playhead to the specified frame of the movie clip and stops it there. To specify a scene in addition to a frame, use gotoAndStop(). You can extend the methods and event handlers of the MovieClip class by creating a subclass.Parametersframe:Object - The frame number to which the playhead is sent.ExampleThe following example uses the _framesloaded property to start a SWF file when all the frames are loaded. If all the frames aren&#39;t loaded, the _xscale property of the loader movie clip instance is increased proportionally to create a progress bar. Enter the following ActionScript in Frame 1 of the Timeline:var pctLoaded:Number = Math.round(this.getBytesLoaded()/this.getBytesTotal()*100bar_mc._xscale = pctLoaded;Add the following code to Frame 2:if (this._framesloaded&lt;this._totalframes) { this.gotoAndPlay(1} else { this.gotoAndStop(3}Place your content on or after Frame 3. Then add the following code to Frame 3:stop(See alsogotoAndStop function, stop function" />
   <page href="00005336.html" title="_height (MovieClip._height property)" text="_height (MovieClip._height property)public _height : NumberThe height of the movie clip, in pixels.ExampleThe following code example displays the height and width of a movie clip in the Output panel: this.createEmptyMovieClip(&quot;image_mc&quot;, this.getNextHighestDepth()var image_mcl:MovieClipLoader = new MovieClipLoader(var mclListener:Object = new Object(mclListener.onLoadInit = function(target_mc:MovieClip) { trace(target_mc._name+&quot; = &quot;+target_mc._width+&quot; X &quot;+target_mc._height+&quot; pixels&quot;};image_mcl.addListener(mclListenerimage_mcl.loadClip(&quot;example.jpg&quot;, image_mcSee also_width (MovieClip._width property)" />
   <page href="00005337.html" title="_highquality (MovieClip._highquality property)" text="_highquality (MovieClip._highquality property)public _highquality : NumberDeprecated since Flash Player 7. This property was deprecated in favor of MovieClip._quality.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 will smooth bitmaps if the SWF file does not contain animation. Specify 0 (low quality) to prevent anti-aliasing. This property can overwrite the global _highquality property.ExampleThe following ActionScript specifies that best quality anti-aliasing should be applied to the SWF file.  my_mc._highquality = 2;See also_quality (MovieClip._quality property), _quality property" />
   <page href="00005338.html" title="hitArea (MovieClip.hitArea property)" text="hitArea (MovieClip.hitArea property)public hitArea : ObjectDesignates another movie clip to serve as the hit area for a movie clip. If the hitArea property does not exist or is null or undefined, the movie clip itself is used as the hit area. The value of the hitArea property may be a reference to a movie clip object. You can change the hitArea property at any time; the modified movie clip immediately takes on the new hit area behavior. The movie clip designated as the hit area does not need to be visible; its graphical shape, although not visible, is hit-tested. The hitArea property can be read out of a prototype object.ExampleThe following example sets the circle_mc movie clip as the hit area for the square_mc movie clip. Place these two movie clips on the Stage and test the document. When you click circle_mc, the square_mc movie clip traces that it was clicked. square_mc.hitArea = circle_mc;square_mc.onRelease = function() { trace(&quot;hit! &quot;+this._name};You can also set the circle_mc movie clip visible property to false to hide the hit area for square_mc.circle_mc._visible = false;See alsohitTest (MovieClip.hitTest method)" />
   <page href="00005339.html" title="hitTest (MovieClip.hitTest method)" text="hitTest (MovieClip.hitTest method)public hitTest() : BooleanEvaluates the movie clip to see if it overlaps or intersects with the hit area that the target or x and y coordinate parameters identify. Usage 1: Compares the x and y coordinates to the shape or bounding box of the specified instance, according to the shapeFlag setting. If shapeFlag is set to true, only the area actually occupied by the instance on the Stage is evaluated, and if x and y overlap at any point, a value of true is returned. This evaluation is useful for determining if the movie clip is within a specified hit or hotspot area. Usage 2: Evaluates the bounding boxes of the target and specified instance, and returns true if they overlap or intersect at any point.Parametersx: Number The x coordinate of the hit area on the Stage. y: Number The y coordinate of the hit area on the Stage. The x and y coordinates are defined in the global coordinate space. shapeFlag: Boolean A Boolean value specifying whether to evaluate the entire shape of the specified instance (true), or just the bounding box (false). This parameter can be specified only if the hit area is identified by using x and y coordinate parameters. target: Object The target path of the hit area that may intersect or overlap with the movie clip. The target parameter usually represents a button or text-entry field. ReturnsBoolean - A Boolean value of true if the movie clip overlaps with the specified hit area, false otherwise.ExampleThe following example uses hitTest() to determine if the circle_mc movie clip overlaps or intersects the square_mc movie clip when the user releases the mouse button: square_mc.onPress = function() { this.startDrag(};square_mc.onRelease = function() { this.stopDrag( if (this.hitTest(circle_mc)) { trace(&quot;you hit the circle&quot; }};See alsogetBounds (MovieClip.getBounds method), globalToLocal (MovieClip.globalToLocal method), localToGlobal (MovieClip.localToGlobal method)" />
   <page href="00005340.html" title="lineStyle (MovieClip.lineStyle method)" text="lineStyle (MovieClip.lineStyle method)public lineStyle(thickness:Number, rgb:Number, alpha:Number, pixelHinting:Boolean, noScale:String, capsStyle:String, jointStyle:String, miterLimit:Number) : VoidSpecifies a line style that Flash uses for subsequent calls to lineTo() and curveTo() until you call lineStyle() with different parameters. You can call lineStyle() in the middle of drawing a path to specify different styles for different line segments within a path. Note: Calls to clear() set the line style back to undefined.You can extend the methods and event handlers of the MovieClip class by creating a subclass.Parametersthickness:Number - An integer that indicates the thickness of the line in points; valid values are 0 to 255. If a number is not specified, or if the parameter is undefined, a line is not drawn. If a value of less than 0 is passed, Flash uses 0. The value 0 indicates hairline thickness; the maximum thickness is 255. If a value greater than 255 is passed, the Flash interpreter uses 255.rgb:Number - A hex color value (for example, red is 0xFF0000, blue is 0x0000FF, and so on) of the line. If a value isn&#39;t indicated, Flash uses 0x000000 (black).alpha:Number - An integer that indicates the alpha value of the line&#39;s color; valid values are 0 to 100. If a value isn&#39;t indicated, Flash uses 100 (solid). If the value is less than 0, Flash uses 0; if the value is greater than 100, Flash uses 100.pixelHinting:Boolean - noScale:String - capsStyle:String - jointStyle:String - miterLimit:Number - ExampleThe following code draws a triangle with a 5-pixel, solid magenta line with no fill. this.createEmptyMovieClip(&quot;triangle_mc&quot;, 1triangle_mc.lineStyle(5, 0xff00ff, 100triangle_mc.moveTo(200, 200triangle_mc.lineTo(300, 300triangle_mc.lineTo(100, 300triangle_mc.lineTo(200, 200See alsobeginFill (MovieClip.beginFill method), beginGradientFill (MovieClip.beginGradientFill method), clear (MovieClip.clear method), curveTo (MovieClip.curveTo method), lineTo (MovieClip.lineTo method), moveTo (MovieClip.moveTo method)" />
   <page href="00005341.html" title="lineTo (MovieClip.lineTo method)" text="lineTo (MovieClip.lineTo method)public lineTo(x:Number, y:Number) : VoidDraws a line using the current line style from the current drawing position to (x, y the current drawing position is then set to (x, y). If the movie clip that you are drawing in contains content that was created with the Flash drawing tools, calls to lineTo() are drawn underneath the content. If you call lineTo() before any calls to the moveTo() method, the current drawing position defaults to (0,0). If any of the parameters are missing, this method fails and the current drawing position is not changed. You can extend the methods and event handlers of the MovieClip class by creating a subclass.Parametersx:Number - An integer indicating the horizontal position relative to the registration point of the parent movie clip.y:Number - An integer indicating the vertical position relative to the registration point of the parent movie clip.ExampleThe following example draws a triangle with a 5-pixel, solid magenta line and a p artially transparent blue fill: this.createEmptyMovieClip(&quot;triangle_mc&quot;, 1triangle_mc.beginFill(0x0000FF, 30triangle_mc.lineStyle(5, 0xFF00FF, 100triangle_mc.moveTo(200, 200triangle_mc.lineTo(300, 300triangle_mc.lineTo(100, 300triangle_mc.lineTo(200, 200triangle_mc.endFill(See alsobeginFill (MovieClip.beginFill method), createEmptyMovieClip (MovieClip.createEmptyMovieClip method), endFill (MovieClip.endFill method), lineStyle (MovieClip.lineStyle method), moveTo (MovieClip.moveTo method)" />
   <page href="00005342.html" title="loadMovie (MovieClip.loadMovie method)" text="loadMovie (MovieClip.loadMovie method)public loadMovie(url:String, [method:String]) : VoidLoads SWF or JPEG files into a movie clip in Flash Player while the original SWF file is playing. Tip: To monitor the progress of the download, use the MovieClipLoader.loadClip() method instead of the loadMovie() method. Without the loadMovie() method, Flash Player displays a single SWF file and then closes. The loadMovie() method lets you display several SWF files at once and switch between SWF files without loading another HTML document.A SWF file or image loaded into a movie clip inherits the position, rotation, and scale properties of the movie clip. You can use the target path of the movie clip to target the loaded SWF file.When you call the loadMovie() method, set the MovieClip._lockroot property to true in the loader movie, as shown in the following code example. If you don&#39;t set _lockroot to true in the loader movie, any references to _root in the loaded movie point to the _root of the loader instead of the _root of the loaded movie.myMovieClip._lockroot = true;Use the MovieClip.unloadMovie() method to remove SWF files or images loaded with the loadMovie() method.Use the MovieClip.loadVariables() method, the XML object, Flash Remoting, or Runtime Shared Objects to keep the active SWF file and load new data into it.Using event handlers with MovieClip.loadMovie() can be unpredictable. If you attach an event handler to a button by using on(), or if you create a dynamic handler by using an event handler method such as MovieClip.onPress, and then you call loadMovie(), the event handler does not remain after the new content is loaded. However, if you attach an event handler to a movie clip by using onClipEvent() or on(), and then call loadMovie() on that movie clip, the event handler remains after the new content is loaded.You can extend the methods and event handlers of the MovieClip class by creating a subclass.Parametersurl:String - The absolute or relative URL of the SWF or JPEG file to be loaded. A relative path must be relative to the SWF file at level 0. Absolute URLs must include the protocol reference, such as http:// or file:///.method:String [optional] - Specifies an HTTP method for sending or loading variables. The parameter must be the string GET or POST. If no variables are to be sent, omit this parameter. The GET method appends the variables to the end of the URL and is used for small numbers of variables. The POST method sends the variables in a separate HTTP header and is used for long strings of variables.ExampleThe following example creates a new movie clip, then creates child inside of it and loads a PNG image into the child. This allows the parent to retain any instance values that were assigned prior to the call to loadMovie. var mc:MovieClip = this.createEmptyMovieClip(&quot;mc&quot;, this.getNextHighestDepth()mc.onRelease = function():Void { trace(this.image._url // http://www.w3.org/Icons/w3c_main.png}var image:MovieClip = mc.createEmptyMovieClip(&quot;image&quot;, mc.getNextHighestDepth()image.loadMovie(&quot;http://www.w3.org/Icons/w3c_main.png&quot;See also_lockroot (MovieClip._lockroot property), unloadMovie (MovieClip.unloadMovie method), loadVariables (MovieClip.loadVariables method), loadMovie (MovieClip.loadMovie method), onPress (MovieClip.onPress handler), MovieClipLoader, onClipEvent handler, Constants, loadMovieNum function, unloadMovie function, unloadMovieNum function" />
   <page href="00005343.html" title="loadVariables (MovieClip.loadVariables method)" text="loadVariables (MovieClip.loadVariables method)public loadVariables(url:String, [method:String]) : VoidReads data from an external file and sets the values for variables in the movie clip. The external file can be a text file that ColdFusion generates, a CGI script, an Active Server Page (ASP), a PHP script, or any other properly formatted text file. The file can contain any number of variables. The loadVariables method can also be used to update variables in the active movie clip with new values.The loadVariables method requires that the text of the URL be in the standard MIME format: application/x-www-form-urlencoded (CGI script format).In SWF files running in a version earlier than Flash Player 7, url must be in the same superdomain as the SWF file that is issuing this call. A superdomain is derived by removing the left-most component of a file&#39;s URL. For example, a SWF file at www.someDomain.com can load data from a source at store.someDomain.com because both files are in the same superdomain of someDomain.com.In SWF files of any version running in Flash Player 7 or later, url must be in exactly the same domain as the SWF file that is issuing this call. For example, a SWF file at www.someDomain.com can load data only from sources that are also at www.someDomain.com. To load data from a different domain, you can place a cross-domain policy file on the server hosting the data source that is being accessed. To load variables into a specific level, use loadVariablesNum() instead of loadVariables().You can extend the methods and event handlers of the MovieClip class by creating a subclass. Parametersurl:String - The absolute or relative URL for the external file that contains the variables to be loaded. If the SWF file issuing this call is running in a web browser, url must be in the same domain as the SWF file; for details, see &quot;Description,&quot; below.method:String [optional] - Specifies an HTTP method for sending variables. The parameter must be the string GET or POST. If no variables are sent, omit this parameter. The GET method appends the variables to the end of the URL and is used for small numbers of variables. The POST method sends the variables in a separate HTTP header and is used for long strings of variables.ExampleThe following example loads information from a text file called params.txtinto the target_mc movie clip that is created by using createEmptyMovieClip(). The setInterval() function is used to check the loading progress. The script checks for a variable in the params.txt file named done. this.createEmptyMovieClip(&quot;target_mc&quot;, this.getNextHighestDepth()target_mc.loadVariables(&quot;params.txt&quot;function checkParamsLoaded() { if (target_mc.done == undefined) { trace(&quot;not yet.&quot; } else { trace(&quot;finished loading. killing interval.&quot; trace(&quot;-------------&quot; for (i in target_mc) { trace(i+&quot;: &quot;+target_mc[i] } trace(&quot;-------------&quot; clearInterval(param_interval }}var param_interval = setInterval(checkParamsLoaded, 100The params.txt file includes the following text:var1=&quot;hello&quot;&amp;var2=&quot;goodbye&quot;&amp;done=&quot;done&quot;See alsoloadMovie (MovieClip.loadMovie method), loadVariablesNum function, unloadMovie (MovieClip.unloadMovie method)" />
   <page href="00005344.html" title="localToGlobal (MovieClip.localToGlobal method)" text="localToGlobal (MovieClip.localToGlobal method)public localToGlobal(pt:Object) : VoidConverts the pt object from the movie clip&#39;s (local) coordinates to the Stage (global) coordinates. The MovieClip.localToGlobal() method allows you to convert any given x and y coordinates from values that are relative to the top-left corner of a specific movie clip to values that are relative to the top-left corner of the Stage.You must first create a generic object that has two properties, x and y. These x and y values (and they must be called x and y) are called the local coordinates because they relate to the top-left corner of the movie clip. The x property represents the horizontal offset from the top-left corner of the movie clip. In other words, it represents how far to the right the point lies. For example, if x = 50, the point lies 50 pixels to the right of the top-left corner. The y property represents the vertical offset from the top-left corner of the movie clip. In other words, it represents how far down the point lies. For example, if y = 20, the point lies 20 pixels below the top-left corner. The following code creates a generic object with these coordinates.var myPoint:Object = new Object(myPoint.x = 50;myPoint.y = 20;Alternatively, you can create the object and assign the values at the same time with a literal Object value.var myPoint:Object = {x:50, y:20};After you create a point object with local coordinates, you can convert the coordinates to global coordinates. The localToGlobal() method doesn&#39;t return a value because it changes the values of x and y in the generic object that you send as the parameter. It changes them from values relative to a specific movie clip (local coordinates) to values relative to the Stage (global coordinates).For example, if you create a movie clip that is positioned at the point (_x:100, _y:100), and you pass a local point representing a point near the top-left corner of the movie clip (x:10, y:10) to the localToGlobal() method, the method should convert the x and y values to global coordinates, which in this case is (x:110, y:110). This conversion occurs because the x and y coordinates are now expressed relative to the top-left corner of the Stage rather than the top-left corner of your movie clip.The movie clip coordinates were expressed using _x and _y, because those are the MovieClip properties that you use to set the x and y values for MovieClips. However, your generic object uses x and y without the underscore. The following code converts the x and y coordinates to global coordinates:var myPoint:Object = {x:10, y:10}; // create your generic point objectthis.createEmptyMovieClip(&quot;myMovieClip&quot;, this.getNextHighestDepth()myMovieClip._x = 100; // _x for movieclip x positionmyMovieClip._y = 100; // _y for movieclip y positionmyMovieClip.localToGlobal(myPointtrace (&quot;x: &quot; + myPoint.x // output: 110trace (&quot;y: &quot; + myPoint.y // output: 110You can extend the methods and event handlers of the MovieClip class by creating a subclass.Parameterspt:Object - The name or identifier of an object created with the Object class, specifying the x and y coordinates as properties.ExampleThe following example converts x and y coordinates of the my_mc object, from the movie clip&#39;s (local) coordinates to the Stage (global) coordinates. The center point of the movie clip is reflected after you click and drag the instance. this.createTextField(&quot;point_txt&quot;, this.getNextHighestDepth(), 0, 0, 100, 22var mouseListener:Object = new Object(mouseListener.onMouseMove = function() { var point:Object = {x:my_mc._width/2, y:my_mc._height/2}; my_mc.localToGlobal(point point_txt.text = &quot;x:&quot;+point.x+&quot;, y:&quot;+point.y;};Mouse.addListener(mouseListenermy_mc.onPress = function() { this.startDrag(};my_mc.onRelease = function() { this.stopDrag(};See alsoglobalToLocal (MovieClip.globalToLocal method)" />
   <page href="00005345.html" title="_lockroot (MovieClip._lockroot property)" text="_lockroot (MovieClip._lockroot property)public _lockroot : BooleanA Boolean value that specifies what _root refers to when a SWF file is loaded into a movie clip. The _lockroot property is undefined by default. You can set this property within the SWF file that is being loaded or in the handler that is loading the movie clip. For example, suppose you have a document called Games.fla that lets a user choose a game to play, and loads the game (for example, Chess.swf) into the game_mc movie clip. Make sure that, after being loaded into Games.swf, any use of _root in Chess.swf will refer to _root in Chess.swf (not _root in Games.swf). If you have access to Chess.fla and publish it to Flash Player 7 or later, you can add this statement to Chess.fla on the main Timeline:this._lockroot = true;If you don&#39;t have access to Chess.fla (for example, if you are loading Chess.swf from someone else&#39;s site into chess_mc), you can set the Chess.swf _lockroot property when you load it. Place the following ActionScript on the main Timeline of Games.fla: chess_mc._lockroot = true; In this case, Chess.swf can be published for any version of Flash Player, as long as Games.swf is published for Flash Player 7 or later. When calling loadMovie(), set the MovieClip._lockroot property to true in the loader movie, as shown in the following code. If you don&#39;t set _lockroot to true in the loader movie, any references to _root in the loaded movie point to the _root of the loader instead of the _root of the loaded movie:myMovieClip._lockroot = true;ExampleIn the following example, lockroot.fla has _lockroot applied to the main SWF file. If the SWF file is loaded into another FLA document, _root always refers to the scope of lockroot.swf, which helps prevent conflicts. Place the following ActionScript on the main Timeline of lockroot.fla: this._lockroot = true;_root.myVar = 1;_root.myOtherVar = 2;trace(&quot;from lockroot.swf&quot;for (i in _root) { trace(&quot; &quot;+i+&quot; -&gt; &quot;+_root[i]}trace(&quot;&quot;which traces the following information:from lockroot.swfmyOtherVar -&gt; 2myVar -&gt; 1_lockroot -&gt; true$version -&gt; WIN 7,0,19,0The following example loads two SWF files, lockroot.swf and nolockroot.swf. The lockroot.fla document contains the ActionScript from the preceding example. The nolockroot FLA file has the following code placed on Frame 1 of the Timeline:_root.myVar = 1;_root.myOtherVar = 2;trace(&quot;from nolockroot.swf&quot;for (i in _root) { trace(&quot; &quot;+i+&quot; -&gt; &quot;+_root[i]}trace(&quot;&quot;The lockroot.swf file has _lockroot applied to it, and nolockroot.swf does not. After the files are loaded, each file dumps variables from their _root scopes. Place the following ActionScript on the main Timeline of a FLA document:this.createEmptyMovieClip(&quot;lockroot_mc&quot;, this.getNextHighestDepth()lockroot_mc.loadMovie(&quot;lockroot.swf&quot;this.createEmptyMovieClip(&quot;nolockroot_mc&quot;, this.getNextHighestDepth()nolockroot_mc.loadMovie(&quot;nolockroot.swf&quot;function dumpRoot() { trace(&quot;from current SWF file&quot; for (i in _root) { trace(&quot; &quot;+i+&quot; -&gt; &quot;+_root[i] } trace(&quot;&quot;}dumpRoot(which traces the following information:from current SWF filedumpRoot -&gt; [type Function]$version -&gt; WIN 7,0,19,0nolockroot_mc -&gt; _level0.nolockroot_mclockroot_mc -&gt; _level0.lockroot_mcfrom nolockroot.swfmyVar -&gt; 1i -&gt; lockroot_mcdumpRoot -&gt; [type Function]$version -&gt; WIN 7,0,19,0nolockroot_mc -&gt; _level0.nolockroot_mclockroot_mc -&gt; _level0.lockroot_mcfrom lockroot.swfmyOtherVar -&gt; 2myVar -&gt; 1The file with no _lockroot applied also contains all of the other variables that the root SWF file contains. If you don&#39;t have access to the nolockroot.fla, you can use the following ActionScript added to the main Timeline to change the _lockroot in the preceding main FLA document:this.createEmptyMovieClip(&quot;nolockroot_mc&quot;, this.getNextHighestDepth()nolockroot_mc._lockroot = true;nolockroot_mc.loadMovie(&quot;nolockroot.swf&quot;which then traces the following:from current SWF filedumpRoot -&gt; [type Function]$version -&gt; WIN 7,0,19,0nolockroot_mc -&gt; _level0.nolockroot_mclockroot_mc -&gt; _level0.lockroot_mcfrom nolockroot.swfmyOtherVar -&gt; 2myVar -&gt; 1from lockroot.swfmyOtherVar -&gt; 2myVar -&gt; 1See also_root property, _lockroot (MovieClip._lockroot property), attachMovie (MovieClip.attachMovie method), loadMovie (MovieClip.loadMovie method), onLoadInit (MovieClipLoader.onLoadInit event listener)" />
   <page href="00005346.html" title="moveTo (MovieClip.moveTo method)" text="moveTo (MovieClip.moveTo method)public moveTo(x:Number, y:Number) : VoidMoves the current drawing position to (x, y). If any of the parameters are missing, this method fails and the current drawing position is not changed. You can extend the methods and event handlers of the MovieClip class by creating a subclass.Parametersx:Number - An integer indicating the horizontal position relative to the registration point of the parent movie clip.y:Number - An integer indicating the vertical position relative to the registration point of the parent movie clip.ExampleThe following example draws a triangle with a 5-pixel, solid magenta line and a partially transparent blue fill: this.createEmptyMovieClip(&quot;triangle_mc&quot;, 1triangle_mc.beginFill(0x0000FF, 30triangle_mc.lineStyle(5, 0xFF00FF, 100triangle_mc.moveTo(200, 200triangle_mc.lineTo(300, 300triangle_mc.lineTo(100, 300triangle_mc.lineTo(200, 200triangle_mc.endFill(See alsocreateEmptyMovieClip (MovieClip.createEmptyMovieClip method), lineStyle (MovieClip.lineStyle method), lineTo (MovieClip.lineTo method)" />
   <page href="00005347.html" title="_name (MovieClip._name property)" text="_name (MovieClip._name property)public _name : StringThe instance name of the movie clip.See also_name (Button._name property)" />
   <page href="00005348.html" title="nextFrame (MovieClip.nextFrame method)" text="nextFrame (MovieClip.nextFrame method)public nextFrame() : VoidSends the playhead to the next frame and stops it. You can extend the methods and event handlers of the MovieClip class by creating a subclass.ExampleThe following example uses _framesloaded and nextFrame()to load content into a SWF file. Do not add any code to Frame 1, but add the following ActionScript to Frame 2 of the Timeline: if (this._framesloaded &gt;= 3) { this.nextFrame(} else { this.gotoAndPlay(1}Then, add the following code (and the content you want to load) on Frame 3:stop(See alsonextFrame function, prevFrame function, prevFrame (MovieClip.prevFrame method)" />
   <page href="00005349.html" title="onData (MovieClip.onData handler)" text="onData (MovieClip.onData handler)onData = function() {}Invoked when a movie clip receives data from a MovieClip.loadVariables() or MovieClip.loadMovie() call. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. This handler can be used only with movie clips for which you have a symbol in the library that is associated with a class. If you want an event handler to be invoked when a specific movie clip receives data, you must use onClipEvent() instead of this handler. The latter handler is invoked when any movie clip receives data.ExampleThe following example illustrates the correct use of MovieClip.onData() and onClipEvent(data). The symbol_mc is a movie clip symbol in the library. It is linked to the MovieClip class. The first function below is triggered for each instance of symbol_mc when it receives data. The dynamic_mc is a movie clip that is being loaded with MovieClip.loadMovie(). The code using dynamic_mc below attempts to call a function when the movie clip is loaded, but it doesn&#39;t work. The loaded SWF file must be a symbol in the library associated with the MovieClip class. The last function uses onClipEvent(data). The onClipEvent() event handler is invoked for any movie clip that receives data, whether the movie clip is in the library or not. Therefore, the last function in this example is invoked when symbol_mc is instantiated and also when replacement.swf is loaded.// The following function is triggered for each instance of symbol_mc// when it receives data.symbol_mc.onData = function() { trace(&quot;The movie clip has received data&quot;}// This code attempts to call a function when the clip is loaded, // but it will not work, because the loaded SWF is not a symbol// in the library associated with the MovieClip class.function output(){ trace(&quot;Will never be called.&quot;}dynamic_mc.onData = output;dynamic_mc.loadMovie(&quot;replacement.swf&quot;// The following function is invoked for any movie clip that// receives data, whether it is in the library or not.onClipEvent( data ) { trace(&quot;The movie clip has received data&quot;}See alsoonClipEvent handler" />
   <page href="00005350.html" title="onDragOut (MovieClip.onDragOut handler)" text="onDragOut (MovieClip.onDragOut handler)onDragOut = function() {}Invoked when the mouse button is pressed and the pointer rolls outside the object. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. Note: This event handler is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example defines a function for the onDragOut method that sends a trace() action to the Output panel: my_mc.onDragOut = function () { trace (&quot;onDragOut called&quot;}See alsoonDragOver (MovieClip.onDragOver handler)" />
   <page href="00005351.html" title="onDragOver (MovieClip.onDragOver handler)" text="onDragOver (MovieClip.onDragOver handler)onDragOver = function() {}Invoked when the pointer is dragged outside and then over the movie clip. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. Note: This event handler is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example defines a function for the onDragOver method that sends a trace() action to the Output panel: my_mc.onDragOver = function () { trace (&quot;onDragOver called&quot;}See alsoonDragOut (MovieClip.onDragOut handler)" />
   <page href="00005352.html" title="onEnterFrame (MovieClip.onEnterFrame handler)" text="onEnterFrame (MovieClip.onEnterFrame handler)onEnterFrame = function() {}Invoked repeatedly at the frame rate of the SWF file. The function that you assign to the onEnterFrame event handler is processed before any other ActionScript code that is attached to the affected frames. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or that is linked to a symbol in the library. ExampleThe following example defines a function for the onEnterFrame event handler that sends a trace() action to the Output panel: my_mc.onEnterFrame = function () { trace (&quot;onEnterFrame called&quot;}" />
   <page href="00005353.html" title="onKeyDown (MovieClip.onKeyDown handler)" text="onKeyDown (MovieClip.onKeyDown handler)onKeyDown = function() {}Invoked when a movie clip has input focus and a key is pressed. The onKeyDown event handler is invoked with no parameters. You can use the Key.getAscii() and Key.getCode() methods to determine which key was pressed. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. The onKeyDown event handler works only if the movie clip has input focus enabled and set. First, the MovieClip.focusEnabled property must be set to true for the movie clip. Then, the clip must be given focus. This can be done either by using Selection.setFocus() or by setting the Tab key to navigate to the clip.If Selection.setFocus() is used, the path for the movie clip must be passed to Selection.setFocus(). It is very easy for other elements to take the focus back after the mouse is moved.ExampleThe following example defines a function for the onKeyDown() method that sends a trace() action to the Output panel. Create a movie clip called my_mc and add the following ActionScript to your FLA or AS file: my_mc.onKeyDown = function () { trace (&quot;key was pressed&quot;}The movie clip must have focus for the onKeyDown event handler to work. Add the following ActionScript to set input focus:my_mc.tabEnabled = true;my_mc.focusEnabled = true;Selection.setFocus(my_mcWhen you tab to the movie clip and press a key, key was pressed is displayed in the Output panel. However, this does not occur after you move the mouse, because the movie clip loses focus. Therefore, you should use Key.onKeyDown in most cases.See alsogetAscii (Key.getAscii method), getCode (Key.getCode method), focusEnabled (MovieClip.focusEnabled property), setFocus (Selection.setFocus method), onKeyDown (Key.onKeyDown event listener), onKeyUp (MovieClip.onKeyUp handler)" />
   <page href="00005354.html" title="onKeyUp (MovieClip.onKeyUp handler)" text="onKeyUp (MovieClip.onKeyUp handler)onKeyUp = function() {}Invoked when a key is released. The onKeyUp event handler is invoked with no parameters. You can use the Key.getAscii() and Key.getCode() methods to determine which key was pressed. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. The onKeyUp event handler works only if the movie clip has input focus enabled and set. First, the MovieClip.focusEnabled property must be set to true for the movie clip. Then, the clip must be given focus. This can be done either by using Selection.setFocus() or by setting the Tab key to navigate to the clip.If Selection.setFocus() is used, the path for the movie clip must be passed to Selection.setFocus(). It is very easy for other elements to take the focus back after the mouse is moved.ExampleThe following example defines a function for the onKeyUp method that sends a trace() action to the Output panel: my_mc.onKeyUp = function () { trace (&quot;onKey called&quot;}The following example sets input focus:my_mc.focusEnabled = true;Selection.setFocus(my_mcSee alsogetAscii (Key.getAscii method), getCode (Key.getCode method), focusEnabled (MovieClip.focusEnabled property), setFocus (Selection.setFocus method), onKeyDown (Key.onKeyDown event listener), onKeyDown (MovieClip.onKeyDown handler)" />
   <page href="00005355.html" title="onKillFocus (MovieClip.onKillFocus handler)" text="onKillFocus (MovieClip.onKillFocus handler)onKillFocus = function(newFocus:Object) {}Invoked when a movie clip loses input focus. The onKillFocus method receives one parameter, newFocus, which is an object that represents the new object receiving the focus. If no object receives the focus, newFocus contains the value null. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. ParametersnewFocus:Object - The object that is receiving the input focus.ExampleThe following example displays information about the movie clip that loses focus, and the instance that currently has focus. Two movie clips, called my_mc and other_mc, are on the Stage. You can add the following ActionScript to your AS or FLA document: my_mc.onRelease = Void;other_mc.onRelease = Void;my_mc.onKillFocus = function(newFocus) { trace(&quot;onKillFocus called, new focus is: &quot;+newFocus};When you press the Tab key to move between the two instances, information is displayed in the Output panel.See alsoonSetFocus (MovieClip.onSetFocus handler)" />
   <page href="00005356.html" title="onLoad (MovieClip.onLoad handler)" text="onLoad (MovieClip.onLoad handler)onLoad = function() {}Invoked when the movie clip is instantiated and appears in the Timeline. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. This handler can be used only with movie clips for which you have a symbol in the library that is associated with a class. If you want an event handler to be invoked when a specific movie clip loads, for example when you use MovieClip.loadMovie() to load a SWF file dynamically, you must use onClipEvent(load) or the MovieClipLoader class instead of this handler. Unlike MovieClip.onLoad, the other handlers are invoked when any movie clip loads.ExampleThis example shows you how to use the onLoad event handler in an ActionScript 2.0 class definition that extends the MovieClip class. First, create a class file named Oval.as and define a class method named onLoad() and make sure that the class file is placed in the proper class path: // contents of Oval.asclass Oval extends MovieClip{ public function onLoad () { trace (&quot;onLoad called&quot; }}Second, create a movie clip symbol in your library and name it Oval. Context-click (usually right-click) on the symbol in the Library panel and select Linkage... from the pop-up menu. Click on &quot;Export for ActionScript&quot; and fill in the &quot;Identifier&quot; and &quot;ActionScript 2.0 Class&quot; fields with the word &quot;Oval&quot; (no quotes). Leave &quot;Export in First Frame&quot; checked and click OK.Third, go to the first frame of your file and enter the following code in the Actions Panel:var myOval:Oval = Oval(attachMovie(&quot;Oval&quot;,&quot;Oval_1&quot;,1)Finally, do a test movie, and you should see the output text &quot;onLoad called&quot;.See alsoloadMovie (MovieClip.loadMovie method), onClipEvent handler, MovieClipLoader" />
   <page href="00005357.html" title="onMouseDown (MovieClip.onMouseDown handler)" text="onMouseDown (MovieClip.onMouseDown handler)onMouseDown = function() {}Invoked when the mouse button is pressed. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. Note: This event handler is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example defines a function for the onMouseDown method that sends a trace() action to the Output panel: my_mc.onMouseDown = function () { trace (&quot;onMouseDown called&quot;}" />
   <page href="00005358.html" title="onMouseMove (MovieClip.onMouseMove handler)" text="onMouseMove (MovieClip.onMouseMove handler)onMouseMove = function() {}Invoked when the mouse moves. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. Note: This event handler is supported in Flash Lite only if System.capabilities.hasMouse is true.ExampleThe following example defines a function for the onMouseMove method that sends a trace() action to the Output panel: my_mc.onMouseMove = function () { trace (&quot;onMouseMove called&quot;}" />
   <page href="00005359.html" title="onMouseUp (MovieClip.onMouseUp handler)" text="onMouseUp (MovieClip.onMouseUp handler)onMouseUp = function() {}Invoked when the mouse button is released. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. Note: This event handler is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example defines a function for the onMouseUp method that sends a trace() action to the Output panel: my_mc.onMouseUp = function () { trace (&quot;onMouseUp called&quot;}" />
   <page href="00005360.html" title="onPress (MovieClip.onPress handler)" text="onPress (MovieClip.onPress handler)onPress = function() {}Invoked when the user clicks the mouse while the pointer is over a movie clip. You must define a function that executes when the event handler is invoked. You can define the in the library.ExampleThe following example defines a function for the onPress method that sends a trace() action to the Output panel: my_mc.onPress = function () { trace (&quot;onPress called&quot;}" />
   <page href="00005361.html" title="onRelease (MovieClip.onRelease handler)" text="onRelease (MovieClip.onRelease handler)onRelease = function() {}Invoked when the mouse button is released over a movie clip. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library.ExampleThe following example defines a function for the onRelease method that sends a trace() action to the Output panel: my_mc.onRelease = function () { trace (&quot;onRelease called&quot;}" />
   <page href="00005362.html" title="onReleaseOutside (MovieClip.onReleaseOutside handler)" text="onReleaseOutside (MovieClip.onReleaseOutside handler)onReleaseOutside = function() {}Invoked when the mouse button is pressed inside the movie clip area and then released outside the movie clip area. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. Note: This event handler is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example defines a function for the onReleaseOutside method that sends a trace() action to the Output panel: my_mc.onReleaseOutside = function () { trace (&quot;onReleaseOutside called&quot;}" />
   <page href="00005363.html" title="onRollOut (MovieClip.onRollOut handler)" text="onRollOut (MovieClip.onRollOut handler)onRollOut = function() {}Invoked when the pointer moves outside a movie clip area. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. ExampleThe following example defines a function for the onRollOut method that sends a trace() action to the Output panel: my_mc.onRollOut = function () { trace (&quot;onRollOut called&quot;}" />
   <page href="00005364.html" title="onRollOver (MovieClip.onRollOver handler)" text="onRollOver (MovieClip.onRollOver handler)onRollOver = function() {}Invoked when the pointer moves over a movie clip area. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. ExampleThe following example defines a function for the onRollOver method that sends a trace() action to the Output panel: my_mc.onRollOver = function () { trace (&quot;onRollOver called&quot;}" />
   <page href="00005365.html" title="onSetFocus (MovieClip.onSetFocus handler)" text="onSetFocus (MovieClip.onSetFocus handler)onSetFocus = function(oldFocus:Object) {}Invoked when a movie clip receives input 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 movie clip to a text field, oldFocus contains the movie clip instance. If there is no previously focused object, oldFocus contains a null value.You must define a function that executes when the event handler in invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. ParametersoldFocus:Object - The object to lose focus.ExampleThe following example displays information about the movie clip that receives input focus, and the instance that previously had focus. Two movie clips, called my_mc and other_mc are on the Stage. Add the following ActionScript to your AS or FLA document: my_mc.onRelease = Void;other_mc.onRelease = Void;my_mc.onSetFocus = function(oldFocus) { trace(&quot;onSetFocus called, previous focus was: &quot;+oldFocus}When you press the Tab key between the two instances, information is displayed in the Output panel.See alsoonKillFocus (MovieClip.onKillFocus handler)" />
   <page href="00005366.html" title="onUnload (MovieClip.onUnload handler)" text="onUnload (MovieClip.onUnload handler)onUnload = function() {}Invoked in the first frame after the movie clip is removed from the Timeline. Flash processes the actions associated with the onUnload event handler before attaching any actions to the affected frame. You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library.ExampleThe following example defines a function for the MovieClip.onUnload method that sends a trace() action to the Output panel: my_mc.onUnload = function () { trace (&quot;onUnload called&quot;}" />
   <page href="00005367.html" title="_parent (MovieClip._parent property)" text="_parent (MovieClip._parent property)public _parent : MovieClipA reference to the movie clip or object that contains the current movie clip or object. The current object is the object that references the _parent property. Use the _parent property to specify a relative path to movie clips or objects that are above the current movie clip or object. You can use _parent to move up multiple levels in the display list as in the following:this._parent._parent._alpha = 20;ExampleThe following example traces the reference to a movie clip and its relationship to the main Timeline. Create a movie clip with the instance name my_mc, and add it to the main Timeline. Add the following ActionScript to your FLA or AS file: my_mc.onRelease = function() { trace(&quot;You clicked the movie clip: &quot;+this trace(&quot;The parent of &quot;+this._name+&quot; is: &quot;+this._parent}When you click the movie clip, the following information appears in the Output panel:You clicked the movie clip: _level0.my_mcThe parent of my_mc is: _level0See also_parent (Button._parent property), _root property, targetPath function, _parent (TextField._parent property)" />
   <page href="00005368.html" title="play (MovieClip.play method)" text="play (MovieClip.play method)public play() : VoidMoves the playhead in the Timeline of the movie clip. You can extend the methods and event handlers of the MovieClip class by creating a subclass.ExampleUse the following ActionScript to play the main Timeline of a SWF file. This ActionScript is for a movie clip button called my_mc on the main Timeline:stop(my_mc.onRelease = function() { this._parent.play(};Use the following ActionScript to play the Timeline of a movie clip in a SWF file. This ActionScript is for a button called my_btn on the main Timeline that plays a movie clip called animation_mc:animation_mc.stop(my_btn.onRelease = function(){ animation_mc.play(};See alsoplay function, gotoAndPlay (MovieClip.gotoAndPlay method), gotoAndPlay function" />
   <page href="00005369.html" title="prevFrame (MovieClip.prevFrame method)" text="prevFrame (MovieClip.prevFrame method)public prevFrame() : VoidSends the playhead to the previous frame and stops it. You can extend the methods and event handlers of the MovieClip class by creating a subclass.ExampleIn the following example, two movie clip buttons control the Timeline. The prev_mc button moves the playhead to the previous frame, and the next_mc button moves the playhead to the next frame. Add content to a series of frames on the Timeline, and add the following ActionScript to Frame 1 of the Timeline: stop(prev_mc.onRelease = function() { var parent_mc:MovieClip = this._parent; if (parent_mc._currentframe&gt;1) { parent_mc.prevFrame( } else { parent_mc.gotoAndStop(parent_mc._totalframes }};next_mc.onRelease = function() { var parent_mc:MovieClip = this._parent; if (parent_mc._currentframe&lt;parent_mc._totalframes) { parent_mc.nextFrame( } else { parent_mc.gotoAndStop(1 }};See alsoprevFrame function" />
   <page href="00005370.html" title="_quality (MovieClip._quality property)" text="ValueDescriptionGraphic Anti-Aliasing &quot;LOW&quot;  Low rendering quality. Graphics are not anti-aliased.  &quot;MEDIUM&quot;  Medium rendering quality. This setting is suitable for movies that do not contain text.  Graphics are anti-aliased using a 2 x 2 pixel grid.  &quot;HIGH&quot;  High rendering quality. This setting is the default rendering quality setting that Flash uses.  Graphics are anti-aliased using a 4 x 4 pixel grid.  &quot;BEST&quot;  Very high rendering quality.  Graphics are anti-aliased using a 4 x 4 pixel grid. _quality (MovieClip._quality property)public _quality : StringSets or retrieves the rendering quality used for a SWF file. Device fonts are always aliased and therefore are unaffected by the _quality property. The _quality property can be set to the following values: Note: Although you can specify this property for a MovieClip object, it is also a global property, and you can specify its value simply as _quality.ExampleThis example sets the rendering quality of a movie clip named my_mc to LOW: my_mc._quality = &quot;LOW&quot;;See also_quality property" />
   <page href="00005371.html" title="removeMovieClip (MovieClip.removeMovieClip method)" text="removeMovieClip (MovieClip.removeMovieClip method)public removeMovieClip() : VoidRemoves a movie clip instance created with duplicateMovieClip(), MovieClip.duplicateMovieClip(), MovieClip.createEmptyMovieClip(), or MovieClip.attachMovie(). This method does not remove a movie clip assigned to a negative depth value. Movie clips created in the authoring tool are assigned negative depth values by default. To remove a movie clip that is assigned to a negative depth value, first use MovieClip.swapDepths() to move the movie clip to a positive depth value.Note: If you are using V2 components, and use MovieClip.getNextHighestDepth() instead of the DepthManager class to assign depth values, you may find that removeMovieClip() fails silently. When any V2 component is used, the DepthManager class automatically reserves the highest (1048575) and lowest (-16383) available depths for cursors and tooltips. A subsequent call to getNextHighestDepth() returns 1048576, which is outside the valid range. The removeMovieClip() method fails silently if it encounters a depth value outside the valid range. If you must use getNextHighestDepth() with V2 components, then you can use swapDepths() to assign a valid depth value or use MovieClip.unloadMovie() to remove the contents of the movie clip. Alternatively, you can use the DepthManager class to assign depth values within the valid range.You can extend the methods and event handlers of the MovieClip class by creating a subclass. ExampleEach time you click a button in the following example, you attach a movie clip instance to the Stage in a random position. When you click a movie clip instance, you remove that instance from the SWF file. function randRange(min:Number, max:Number):Number { var randNum:Number = Math.round(Math.random()*(max-min))+min; return randNum;}var bugNum:Number = 0;addBug_btn.onRelease = addBug;function addBug() { var thisBug:MovieClip = this._parent.attachMovie(&quot;bug_id&quot;, &quot;bug&quot;+bugNum+&quot;_mc&quot;, bugNum, {_x:randRange(50, 500), _y:randRange(50, 350)} thisBug.onRelease = function() { this.removeMovieClip( }; bugNum++;}See alsoduplicateMovieClip function, createEmptyMovieClip (MovieClip.createEmptyMovieClip method), duplicateMovieClip (MovieClip.duplicateMovieClip method), attachMovie (MovieClip.attachMovie method), swapDepths (MovieClip.swapDepths method)" />
   <page href="00005372.html" title="_rotation (MovieClip._rotation property)" text="_rotation (MovieClip._rotation property)public _rotation : NumberSpecifies the rotation of the movie clip, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement my_mc._rotation = 450 is the same as my_mc._rotation = 90.ExampleThe following example creates a triangle movie clip instance dynamically. When you run the SWF file, click the movie clip to rotate it: this.createEmptyMovieClip(&quot;triangle&quot;, this.getNextHighestDepth()triangle.beginFill(0x0000FF, 100triangle.moveTo(100, 100triangle.lineTo(100, 150triangle.lineTo(150, 100triangle.lineTo(100, 100triangle.onMouseUp= function() { this._rotation += 15;};See also_rotation (Button._rotation property), _rotation (TextField._rotation property)" />
   <page href="00005373.html" title="setMask (MovieClip.setMask method)" text="setMask (MovieClip.setMask method)public setMask(mc:Object) : VoidMakes the movie clip in the parameter mc a mask that reveals the calling movie clip. The setMask() method allows multiple-frame movie clips with complex, multilayered content to act as masks (which is possible by using mask layers). If you have device fonts in a masked movie clip, they are drawn but not masked. You can&#39;t set a movie clip to be its own maskfor example, my_mc.setMask(my_mc).If you create a mask layer that contains a movie clip, and then apply the setMask() method to it, the setMask() call takes priority and this is not reversible. For example, you could have a movie clip in a mask layer called UIMask that masks another layer that contains another movie clip called UIMaskee. If, as the SWF file plays, you call UIMask.setMask(UIMaskee), from that point on, UIMask is masked by UIMaskee. To cancel a mask created with ActionScript, pass the value null to the setMask() method. The following code cancels the mask without affecting the mask layer in the Timeline.UIMask.setMask(nullYou can extend the methods and event handlers of the MovieClip class by creating a subclass.Parametersmc:Object - The instance name of a movie clip to be a mask. This can be a String or a MovieClip.ExampleThe following code uses the circleMask_mc movie clip to mask the theMaskee_mc movie clip: theMaskee_mc.setMask(circleMask_mc" />
   <page href="00005374.html" title="_soundbuftime (MovieClip._soundbuftime property)" text="_soundbuftime (MovieClip._soundbuftime property)public _soundbuftime : NumberSpecifies the number of seconds a sound prebuffers before it starts to stream. Note: Although you can specify this property for a MovieClip object, it is actually a global property that applies to all sounds loaded, and you can specify its value simply as _soundbuftime. Setting this property for a MovieClip object actually sets the global property.See also_soundbuftime property" />
   <page href="00005375.html" title="startDrag (MovieClip.startDrag method)" text="startDrag (MovieClip.startDrag method)public startDrag([lockCenter:Boolean], [left:Number], [top:Number], [right:Number], [bottom:Number]) : VoidLets the user drag the specified movie clip. The movie clip remains draggable until explicitly stopped through a call to MovieClip.stopDrag(), or until another movie clip is made draggable. Only one movie clip at a time is draggable. You can extend the methods and event handlers of the MovieClip class by creating a subclass.Note: This method is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ParameterslockCenter:Boolean [optional] - 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 on the movie clip (false).left:Number [optional] - Value relative to the coordinates of the movie clip&#39;s parent that specify a constraint rectangle for the movie clip.top:Number [optional] - Value relative to the coordinates of the movie clip&#39;s parent that specify a constraint rectangle for the movie clip.right:Number [optional] - Value relative to the coordinates of the movie clip&#39;s parent that specify a constraint rectangle for the movie clip.bottom:Number [optional] - Value relative to the coordinates of the movie clip&#39;s parent that specify a constraint rectangle for the movie clip.ExampleThe following example creates a draggable movie clip instance called mc_1: this.createEmptyMovieClip(&quot;mc_1&quot;, 1with (mc_1) { lineStyle(1, 0xCCCCCC beginFill(0x4827CF moveTo(0, 0 lineTo(80, 0 lineTo(80, 60 lineTo(0, 60 lineTo(0, 0 endFill(} mc_1.onPress = function() {  this.startDrag(};mc_1.onRelease = function() { this.stopDrag(};See also_droptarget (MovieClip._droptarget property), startDrag function, stopDrag (MovieClip.stopDrag method)" />
   <page href="00005376.html" title="stop (MovieClip.stop method)" text="stop (MovieClip.stop method)public stop() : VoidStops the movie clip currently playing. You can extend the methods and event handlers of the MovieClip class by creating a subclass.ExampleThe following example shows how to stop a movie clip named aMovieClip: aMovieClip.stop(See alsostop function" />
   <page href="00005377.html" title="stopDrag (MovieClip.stopDrag method)" text="stopDrag (MovieClip.stopDrag method)public stopDrag() : VoidEnds a MovieClip.startDrag() method. A movie clip that was made draggable with that method remains draggable until a stopDrag() method is added, or until another movie clip becomes draggable. Only one movie clip is draggable at a time. You can extend the methods and event handlers of the MovieClip class by creating a subclass.Note: This method is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example creates a draggable movie clip instance called mc_1: this.createEmptyMovieClip(&quot;mc_1&quot;, 1with (mc_1) { lineStyle(1, 0xCCCCCC beginFill(0x4827CF moveTo(0, 0 lineTo(80, 0 lineTo(80, 60 lineTo(0, 60 lineTo(0, 0 endFill(} mc_1.onPress = function() {  this.startDrag(};mc_1.onRelease = function() { this.stopDrag(};See also_droptarget (MovieClip._droptarget property), startDrag (MovieClip.startDrag method), stopDrag function" />
   <page href="00005378.html" title="swapDepths (MovieClip.swapDepths method)" text="swapDepths (MovieClip.swapDepths method)public swapDepths(target:Object) : VoidSwaps the stacking, or depth level (z-order), of this movie clip with the movie clip specified by the target parameter, or with the movie clip that currently occupies the depth level specified in the target parameter. Both movie clips must have the same parent movie clip. Swapping the depth level of movie clips has the effect of moving one movie clip in front of or behind the other. If a movie clip is tweening when this method is called, the tweening is stopped. . You can extend the methods and event handlers of the MovieClip class by creating a subclass.Parameterstarget:Object - This parameter can take one of two forms: A number that specifies the depth level where the movie clip is to be placed.A string that specifies the movie clip instance whose depth is swapped with the movie clip for which the method is being applied. Both movie clips must have the same parent movie clip.ExampleThe following example swaps the stacking order of two movie clip instances. Overlap two movie clip instances, called myMC1_mc and myMC2_mc, on the Stage and then add the following script to the parent Timeline: myMC1_mc.onRelease = function() { this.swapDepths(myMC2_mc};myMC2_mc.onRelease = function() { this.swapDepths(myMC1_mc};See also_level property, getDepth (MovieClip.getDepth method), getInstanceAtDepth (MovieClip.getInstanceAtDepth method), getNextHighestDepth (MovieClip.getNextHighestDepth method)" />
   <page href="00005379.html" title="tabChildren (MovieClip.tabChildren property)" text="tabChildren (MovieClip.tabChildren property)public tabChildren : BooleanDetermines whether the children of a movie clip are included in the automatic tab ordering. If the tabChildren property is undefined or true, the children of a movie clip are included in automatic tab ordering. If the value of tabChildren is false, the children of a movie clip are not included in automatic tab ordering. The default value is undefined.ExampleA list box UI widget built as a movie clip contains several items. The user can click each item to select it, so each item is a button. However, only the list box itself should be a tab stop. The items inside the list box should be excluded from tab ordering. To do this, the tabChildren property of the list box should be set to false. The tabChildren property has no effect if the tabIndex property is used; the tabChildren property affects only automatic tab ordering.The following example disables tabbing for all children movie clips inside a parent movie clip called menu_mc:menu_mc.onRelease = function(){};menu_mc.menu1_mc.onRelease = function(){};menu_mc.menu2_mc.onRelease = function(){};menu_mc.menu3_mc.onRelease = function(){};menu_mc.menu4_mc.onRelease = function(){};menu_mc.tabChildren = false;Change the last line of code to the following to include the children movie clip instances of menu_mc in the automatic tab ordering:menu_mc.tabChildren = true;See alsotabIndex (Button.tabIndex property), tabEnabled (MovieClip.tabEnabled property), tabIndex (MovieClip.tabIndex property), tabIndex (TextField.tabIndex property)" />
   <page href="00005380.html" title="tabEnabled (MovieClip.tabEnabled property)" text="tabEnabled (MovieClip.tabEnabled property)public tabEnabled : BooleanSpecifies whether the movie clip is included in automatic tab ordering. It is undefined by default. If the tabEnabled property is undefined, the object is included in automatic tab ordering only if it defines at least one movie clip handler, such as MovieClip.onRelease. If tabEnabled is true, the object is included in automatic tab ordering. If the tabIndex property is also set to a value, the object is included in custom tab ordering as well. If tabEnabled is false, the object is not included in automatic or custom tab ordering, even if the tabIndex property is set. However, if MovieClip.tabChildren is true, the movie clip&#39;s children can still be included in automatic tab ordering, even if tabEnabled is false.ExampleThe following example does not include myMC2_mc in the automatic tab ordering: myMC1_mc.onRelease = function() {};myMC2_mc.onRelease = function() {};myMC3_mc.onRelease = function() {};myMC2_mc.tabEnabled = false;See alsoonRelease (MovieClip.onRelease handler), tabEnabled (Button.tabEnabled property), tabChildren (MovieClip.tabChildren property), tabIndex (MovieClip.tabIndex property), tabEnabled (TextField.tabEnabled property)" />
   <page href="00005381.html" title="tabIndex (MovieClip.tabIndex property)" text="tabIndex (MovieClip.tabIndex property)public tabIndex : NumberLets you customize the tab ordering of objects in a movie. The tabIndex property is undefined by default. You can set the tabIndex property on a button, movie clip, or text field instance. If an object in a SWF file contains a tabIndex property, automatic tab ordering is disabled, and the tab ordering is calculated from the tabIndex properties of objects in the SWF file. The custom tab ordering includes only objects that have tabIndex properties.The tabIndex property must be a positive integer. The objects are ordered according to their tabIndex properties, in ascending order. An object with a tabIndex value of 1 precedes an object with a tabIndex value of 2. The custom tab ordering disregards the hierarchical relationships of objects in a SWF file. All objects in the SWF file with tabIndex properties are placed in the tab order. Do not use the same tabIndex value for multiple objects.ExampleThe following ActionScript sets a custom tab order for three movie clip instances. myMC1_mc.onRelease = function() {};myMC2_mc.onRelease = function() {};myMC3_mc.onRelease = function() {};myMC1_mc.tabIndex = 2;myMC2_mc.tabIndex = 1;myMC3_mc.tabIndex = 3;See alsotabIndex (Button.tabIndex property), tabIndex (TextField.tabIndex property)" />
   <page href="00005382.html" title="_target (MovieClip._target property)" text="_target (MovieClip._target property)public _target : String [read-only]Returns the target path of the movie clip instance, in slash notation. Use the eval() function to convert the target path to dot notation.ExampleThe following example displays the target paths of movie clip instances in a SWF file, in both slash and dot notation. for (var i in this) { if (typeof (this[i]) == &quot;movieclip&quot;) { trace(&quot;name: &quot; + this[i]._name + &quot;, t target: &quot; + this[i]._target + &quot;, t target(2):&quot;  + eval(this[i]._target) }}" />
   <page href="00005383.html" title="_totalframes (MovieClip._totalframes property)" text="_totalframes (MovieClip._totalframes property)public _totalframes : Number [read-only]Returns the total number of frames in the movie clip instance specified in the MovieClip parameter.ExampleIn the following example, two movie clip buttons control the Timeline. The prev_mc button moves the playhead to the previous frame, and the next_mc button moves the playhead to the next frame. Add content to a series of frames on the Timeline, and add the following ActionScript to Frame 1 of the Timeline: stop(prev_mc.onRelease = function() { var parent_mc:MovieClip = this._parent; if (parent_mc._currentframe&gt;1) { parent_mc.prevFrame( } else { parent_mc.gotoAndStop(parent_mc._totalframes }};next_mc.onRelease = function() { var parent_mc:MovieClip = this._parent; if (parent_mc._currentframe&lt;parent_mc._totalframes) { parent_mc.nextFrame( } else { parent_mc.gotoAndStop(1 }};" />
   <page href="00005384.html" title="trackAsMenu (MovieClip.trackAsMenu property)" text="trackAsMenu (MovieClip.trackAsMenu property)public trackAsMenu : BooleanA Boolean value that indicates whether other buttons or movie clips can receive a release event from a mouse or stylus. If you drag a stylus or mouse across a movie clip and then release it on a second movie clip, the onRelease event is registered for the second movie clip. This allows you to create menus for the second movie clip. You can set the trackAsMenu property on any button or movie clip object. If you have not defined the trackAsMenu property, the default behavior is false. You can change the trackAsMenu property at any time; the modified movie clip immediately takes on the new behavior.Note: This property is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example sets the trackAsMenu property for three movie clips on the Stage. Click a movie clip and release the mouse button on a second movie clip to see which instance receives the event. myMC1_mc.trackAsMenu = true;myMC2_mc.trackAsMenu = true;myMC3_mc.trackAsMenu = false;myMC1_mc.onRelease = clickMC;myMC2_mc.onRelease = clickMC;myMC3_mc.onRelease = clickMC;function clickMC() { trace(&quot;you clicked the &quot;+this._name+&quot; movie clip.&quot;};See alsotrackAsMenu (Button.trackAsMenu property)" />
   <page href="00005385.html" title="unloadMovie (MovieClip.unloadMovie method)" text="unloadMovie (MovieClip.unloadMovie method)public unloadMovie() : VoidRemoves the contents of a movie clip instance. The instance properties and clip handlers remain. To remove the instance, including its properties and clip handlers, use MovieClip.removeMovieClip().You can extend the methods and event handlers of the MovieClip class by creating a subclass.ExampleThe following example unloads a movie clip instance called box when a user clicks the box movie clip: this.createEmptyMovieClip(&quot;box&quot;, 1with (box) { lineStyle(1, 0xCCCCCC beginFill(0x4827CF moveTo(0, 0 lineTo(80, 0 lineTo(80, 60 lineTo(0, 60 lineTo(0, 0 endFill(}box.onRelease = function() { box.unloadMovie(};See alsoremoveMovieClip (MovieClip.removeMovieClip method), attachMovie (MovieClip.attachMovie method), loadMovie (MovieClip.loadMovie method), unloadMovie function, unloadMovieNum function" />
   <page href="00005386.html" title="_url (MovieClip._url property)" text="_url (MovieClip._url property)public _url : String [read-only]Retrieves the URL of the SWF, JPEG, GIF, or PNG file from which the movie clip was downloaded.ExampleThe following example displays the URL of the image that is loaded into the image_mc instance in the Output panel. this.createEmptyMovieClip(&quot;image_mc&quot;, 1var mclListener:Object = new Object(mclListener.onLoadInit = function(target_mc:MovieClip) { trace(&quot;_url: &quot;+target_mc._url};var image_mcl:MovieClipLoader = new MovieClipLoader(image_mcl.addListener(mclListenerimage_mcl.loadClip(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;, image_mc" />
   <page href="00005387.html" title="_visible (MovieClip._visible property)" text="_visible (MovieClip._visible property)public _visible : BooleanA Boolean value that indicates whether the movie clip is visible. Movie clips that are not visible (_visible property set to false) are disabled. For example, a button in a movie clip with _visible set to false cannot be clicked.ExampleThe following example sets the _visible property for two movie clips called myMC1_mc and myMC2_mc. The property is set to true for one instance, and false for the other. Notice that myMC1_mc instance cannot be clicked after the _visible property is set to false. myMC1_mc.onRelease = function() { trace(this._name+&quot;._visible = false&quot; this._visible = false;};myMC2_mc.onRelease = function() { trace(this._name+&quot;._alpha = 0&quot; this._alpha = 0;};See also_visible (Button._visible property), _visible (TextField._visible property)" />
   <page href="00005388.html" title="_width (MovieClip._width property)" text="_width (MovieClip._width property)public _width : NumberThe width of the movie clip, in pixels.ExampleThe following code example displays the height and width of a movie clip in the Output panel: this.createEmptyMovieClip(&quot;triangle&quot;, this.getNextHighestDepth()triangle.beginFill(0x0000FF, 100triangle.moveTo(100, 100triangle.lineTo(100, 150triangle.lineTo(150, 100triangle.lineTo(100, 100trace(triangle._name + &quot; = &quot; + triangle._width + &quot; X &quot; + triangle._height + &quot; pixels&quot;See also_height (MovieClip._height property)" />
   <page href="00005389.html" title="_x (MovieClip._x property)" text="_x (MovieClip._x property)public _x : NumberAn integer that sets the x coordinate of a movie clip relative to the local coordinates of the parent movie clip. If a movie clip is in the main Timeline, its coordinate system refers to the upper-left corner of the Stage as (0, 0). If the move clip is inside another movie clip that has transformations, the movie clip is in the local coordinate system of the enclosing movie clip. Thus, for a movie clip rotated 90˚ counterclockwise, the movie clip&#39;s children inherit a coordinate system that is rotated 90˚ counterclockwise. The movie clip&#39;s coordinates refer to the registration point position.See also_xscale (MovieClip._xscale property), _y (MovieClip._y property), _yscale (MovieClip._yscale property)" />
   <page href="00005390.html" title="_xmouse (MovieClip._xmouse property)" text="_xmouse (MovieClip._xmouse property)public _xmouse : Number [read-only]Returns the x coordinate of the mouse position. Note: This property is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example returns the current x and y coordinates of the mouse on the Stage (_level0) and in relation to a movie clip on the Stage called my_mc: this.createTextField(&quot;mouse_txt&quot;, this.getNextHighestDepth(), 0, 0, 150, 66mouse_txt.html = true;mouse_txt.multiline = true;var row1_str:String = &quot;&amp;nbsp; t&lt;b&gt;_xmouse t&lt;/b&gt;&lt;b&gt;_ymouse&lt;/b&gt;&quot;;my_mc.onMouseMove = function() { mouse_txt.htmlText = &quot;&lt;textformat tabStops=&#39;[50,100]&#39;&gt;&quot;; mouse_txt.htmlText += row1_str; mouse_txt.htmlText += &quot;&lt;b&gt;_level0&lt;/b&gt; t&quot;+_xmouse+&quot; t&quot;+_ymouse; mouse_txt.htmlText += &quot;&lt;b&gt;my_mc&lt;/b&gt; t&quot;+this._xmouse+&quot; t&quot;+this._ymouse; mouse_txt.htmlText += &quot;&lt;/textformat&gt;&quot;;};See alsohasMouse (capabilities.hasMouse property), _ymouse (MovieClip._ymouse property)" />
   <page href="00005391.html" title="_xscale (MovieClip._xscale property)" text="_xscale (MovieClip._xscale property)public _xscale : NumberSets the horizontal scale (percentage) of the movie clip as applied from the registration point of the movie clip. The default registration point is (0,0). Scaling the local coordinate system affects the _x and _y property settings, which are defined in whole pixels. For example, if the parent movie clip is scaled to 50%, setting the _y property moves an object in the movie clip by half the number of pixels that it would if the movie were set at 100%.ExampleThe following example creates a movie clip called box_mc at runtime. The Drawing API is used to draw a box in this instance, and when the mouse rolls over the box, horizontal and vertical scaling is applied to the movie clip. When the mouse rolls off the instance, it returns to the previous scaling. this.createEmptyMovieClip(&quot;box_mc&quot;, 1box_mc._x = 100;box_mc._y = 100;with (box_mc) { lineStyle(1, 0xCCCCCC beginFill(0xEEEEEE moveTo(0, 0 lineTo(80, 0 lineTo(80, 60 lineTo(0, 60 lineTo(0, 0 endFill(};box_mc.onRollOver = function() { this._x -= this._width/2; this._y -= this._height/2; this._xscale = 200; this._yscale = 200;};box_mc.onRollOut = function() { this._xscale = 100; this._yscale = 100; this._x += this._width/2; this._y += this._height/2;};See also_x (MovieClip._x property), _y (MovieClip._y property), _yscale (MovieClip._yscale property), _width (MovieClip._width property)" />
   <page href="00005392.html" title="_y (MovieClip._y property)" text="_y (MovieClip._y property)public _y : NumberSets the y coordinate of a movie clip relative to the local coordinates of the parent movie clip. If a movie clip is in the main Timeline, its coordinate system refers to the upper-left corner of the Stage.as (0,0). If the movie clip is inside another movie clip that has transformations, the movie clip is in the local coordinate system of the enclosing movie clip. Thus, for a movie clip rotated 90˚ counterclockwise, the movie clip&#39;s children inherit a coordinate system that is rotated 90˚ counterclockwise. The movie clip&#39;s coordinates refer to the registration point position.See also_x (MovieClip._x property), _xscale (MovieClip._xscale property), _yscale (MovieClip._yscale property)" />
   <page href="00005393.html" title="_ymouse (MovieClip._ymouse property)" text="_ymouse (MovieClip._ymouse property)public _ymouse : Number [read-only]Indicates the y coordinate of the mouse position. Note: This property is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example returns the current x and y coordinates of the mouse on the Stage (_level0) and in relation to a movie clip on the Stage called my_mc. this.createTextField(&quot;mouse_txt&quot;, this.getNextHighestDepth(), 0, 0, 150, 66mouse_txt.html = true;mouse_txt.multiline = true;var row1_str:String = &quot;&amp;nbsp; t&lt;b&gt;_xmouse t&lt;/b&gt;&lt;b&gt;_ymouse&lt;/b&gt;&quot;;my_mc.onMouseMove = function() { mouse_txt.htmlText = &quot;&lt;textformat tabStops=&#39;[50,100]&#39;&gt;&quot;; mouse_txt.htmlText += row1_str; mouse_txt.htmlText += &quot;&lt;b&gt;_level0&lt;/b&gt; t&quot;+_xmouse+&quot; t&quot;+_ymouse; mouse_txt.htmlText += &quot;&lt;b&gt;my_mc&lt;/b&gt; t&quot;+this._xmouse+&quot; t&quot;+this._ymouse; mouse_txt.htmlText += &quot;&lt;/textformat&gt;&quot;;};See alsohasMouse (capabilities.hasMouse property), _xmouse (MovieClip._xmouse property)" />
   <page href="00005394.html" title="_yscale (MovieClip._yscale property)" text="_yscale (MovieClip._yscale property)public _yscale : NumberSets the vertical scale (percentage) of the movie clip as applied from the registration point of the movie clip. The default registration point is (0,0). Scaling the local coordinate system affects the _x and _y property settings, which are defined in whole pixels. For example, if the parent movie clip is scaled to 50%, you set the _x property to move an object in the movie clip by half the number of pixels that it would if the movie were at 100%.ExampleThe following example creates a movie clip at runtime called box_mc. The Drawing API is used to draw a box in this instance, and when the mouse rolls over the box, horizontal and vertical scaling is applied to the movie clip. When the mouse rolls off the instance, it returns to the previous scaling. this.createEmptyMovieClip(&quot;box_mc&quot;, 1box_mc._x = 100;box_mc._y = 100;with (box_mc) { lineStyle(1, 0xCCCCCC beginFill(0xEEEEEE moveTo(0, 0 lineTo(80, 0 lineTo(80, 60 lineTo(0, 60 lineTo(0, 0 endFill(};box_mc.onRollOver = function() { this._x -= this._width/2; this._y -= this._height/2; this._xscale = 200; this._yscale = 200;};box_mc.onRollOut = function() { this._xscale = 100; this._yscale = 100; this._x += this._width/2; this._y += this._height/2;};See also_x (MovieClip._x property), _xscale (MovieClip._xscale property), _y (MovieClip._y property), _height (MovieClip._height property)" />
   <page href="00005395.html" title="MovieClipLoader" text="constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)EventDescriptiononLoadComplete = function(listenerObject, [target_mc]) {}Invoked when a file loaded with MovieClipLoader.loadClip() is completely downloaded.onLoadError = function(target_mc, errorCode) {}Invoked when a file loaded with MovieClipLoader.loadClip() has failed to load.onLoadInit = function([target_mc]) {}Invoked when the actions on the first frame of the loaded clip are executed.onLoadProgress = function([target_mc], loadedBytes, totalBytes) {}Invoked every time the loading content is written to disk during the loading process (that is, between MovieClipLoader.onLoadStart and MovieClipLoader.onLoadComplete).onLoadStart = function([target_mc]) {}Invoked when a call to MovieClipLoader.loadClip() has successfully begun to download a file.SignatureDescriptionMovieClipLoader()Creates a MovieClipLoader object that you can use to implement a number of listeners to respond to events while a SWF, JPEG, GIF, or PNG file is downloading.ModifiersSignatureDescriptionaddListener(listener:Object) : BooleanRegisters an object to receive notification when a MovieClipLoader event handler is invoked.getProgress(target:Object) : ObjectReturns the number of bytes loaded and total number of bytes for a file that is being loaded by using MovieClipLoader.loadClip( for compressed movies, the getProgress method reflects the number of compressed bytes.loadClip(url:String, target:Object) : BooleanLoads a SWF or JPEG file into a movie clip in Flash Player while the original movie is playing.removeListener(listener:Object) : BooleanRemoves the listener that was used to receive notification when a MovieClipLoader event handler was invoked.unloadClip(target:Object) : BooleanRemoves a movie clip that was loaded by means of MovieClipLoader.loadClip().addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)MovieClipLoaderObject | +-MovieClipLoaderpublic class MovieClipLoaderextends ObjectThe MovieClipLoader class lets you implement listener callbacks that provide status information while SWF, JPEG, GIF, and PNG files are being loaded (downloaded) into movie clips. To use MovieClipLoader features, use MovieClipLoader.loadClip() instead of loadMovie() or MovieClip.loadMovie() to load SWF files. After you issue the MovieClipLoader.loadClip() method, the following events take place in the order listed:When the first bytes of the downloaded file are written to disk, the MovieClipLoader.onLoadStart listener is invoked.If you implemented the MovieClipLoader.onLoadProgress listener, it is invoked during the loading process.&lt;br /&gt;Note: You can call MovieClipLoader.getProgress() at any time during the load process.When the entire downloaded file is written to disk, the MovieClipLoader.onLoadComplete listener is invoked.After the downloaded file&#39;s first frame actions are executed, the MovieClipLoader.onLoadInit listener is invoked.After MovieClipLoader.onLoadInit is invoked, you can set properties, use methods, and otherwise interact with the loaded movie.If the file fails to load completely, the MovieClipLoader.onLoadError listener is invoked.Property summaryProperties inherited from class ObjectEvent summaryConstructor summaryMethod summaryMethods inherited from class Object" />
   <page href="00005396.html" title="addListener (MovieClipLoader.addListener method)" text="addListener (MovieClipLoader.addListener method)public addListener(listener:Object) : BooleanRegisters an object to receive notification when a MovieClipLoader event handler is invoked.Parameterslistener:Object - An object that listens for a callback notification from the MovieClipLoader event handlers.ReturnsBoolean - A Boolean value. The return value is true if the listener was established successfully; otherwise the return value is false.ExampleThe following example loads an image into a movie clip called image_mc. The movie clip instance is rotated and centered on the Stage, and both the Stage and movie clip have a stroke drawn around their perimeters. this.createEmptyMovieClip(&quot;image_mc&quot;, this.getNextHighestDepth()var mclListener:Object = new Object(mclListener.onLoadInit = function(target_mc:MovieClip) { target_mc._x = Stage.width/2-target_mc._width/2; target_mc._y = Stage.height/2-target_mc._width/2; var w:Number = target_mc._width; var h:Number = target_mc._height; target_mc.lineStyle(4, 0x000000 target_mc.moveTo(0, 0 target_mc.lineTo(w, 0 target_mc.lineTo(w, h target_mc.lineTo(0, h target_mc.lineTo(0, 0 target_mc._rotation = 3;};var image_mcl:MovieClipLoader = new MovieClipLoader(image_mcl.addListener(mclListenerimage_mcl.loadClip(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;, image_mcSee alsoonLoadComplete (MovieClipLoader.onLoadComplete event listener), onLoadError (MovieClipLoader.onLoadError event listener), onLoadInit (MovieClipLoader.onLoadInit event listener), onLoadProgress (MovieClipLoader.onLoadProgress event listener), onLoadStart (MovieClipLoader.onLoadStart event listener), removeListener (MovieClipLoader.removeListener method)" />
   <page href="00005397.html" title="getProgress (MovieClipLoader.getProgress method)" text="getProgress (MovieClipLoader.getProgress method)public getProgress(target:Object) : ObjectReturns the number of bytes loaded and total number of bytes for a file that is being loaded by using MovieClipLoader.loadClip( for compressed movies, the getProgress method reflects the number of compressed bytes. The getProgress method lets you explicitly request this information, instead of (or in addition to) writing a MovieClipLoader.onLoadProgress listener function.Parameterstarget:Object - A SWF, JPEG, GIF, or PNG file that is loaded using MovieClipLoader.loadClip().ReturnsObject - An object that has two integer properties: bytesLoaded and bytesTotal.ExampleThe following example demonstrates usage of the getProgress method. Rather than using this method, one will usually create a listener object and listen for the onLoadProgress event. Another important note about this method, is that the first, synchronous call to getProgress can return the bytesLoaded and bytesTotal of the container and not the values for the externally requested object. var container:MovieClip = this.createEmptyMovieClip(&quot;container&quot;, this.getNextHighestDepth()var image:MovieClip = container.createEmptyMovieClip(&quot;image&quot;, container.getNextHighestDepth()var mcLoader:MovieClipLoader = new MovieClipLoader(var listener:Object = new Object(listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void { trace(target + &quot;.onLoadProgress with &quot; + bytesLoaded + &quot; bytes of &quot; + bytesTotal }mcLoader.addListener(listenermcLoader.loadClip(&quot;http://www.w3.org/Icons/w3c_main.png&quot;, imagevar interval:Object = new Object(interval.id = setInterval(checkProgress, 100, mcLoader, image, intervalfunction checkProgress(mcLoader:MovieClipLoader, image:MovieClip, interval:Object):Void { trace(&quot;&gt;&gt; checking progress now with : &quot; + interval.id var progress:Object = mcLoader.getProgress(image trace(&quot;bytesLoaded: &quot; + progress.bytesLoaded + &quot; bytesTotal: &quot; + progress.bytesTotal if(progress.bytesLoaded == progress.bytesTotal) { clearInterval(interval.id }}See alsoloadClip (MovieClipLoader.loadClip method), onLoadProgress (MovieClipLoader.onLoadProgress event listener)" />
   <page href="00005398.html" title="loadClip (MovieClipLoader.loadClip method)" text="loadClip (MovieClipLoader.loadClip method)public loadClip(url:String, target:Object) : BooleanLoads a SWF or JPEG file into a movie clip in Flash Player while the original movie is playing. Using this method lets you display several SWF files at once and switch between SWF files without loading another HTML document. Using the loadClip() method instead of loadMovie() or MovieClip.loadMovie() has a number of advantages. The following handlers are implemented by the use of a listener object. You activate the listener by using MovieClipLoader.addListener(listenerObject) to register it with the MovieClipLoader class.The MovieClipLoader.onLoadStart handler is invoked when loading begins.The MovieClipLoader.onLoadError handler is invoked if the clip cannot be loaded. The MovieClipLoader.onLoadProgress handler is invoked as the loading process progresses. The MovieClipLoader.onLoadComplete handler is invoked when a file completes downloading, but before the loaded movie clip&#39;s methods and properties are available. This handler is called before the onLoadInit handler.The MovieClipLoader.onLoadInit handler is invoked after the actions in the first frame of the clip are executed, so you can begin manipulating the loaded clip. This handler is called after the onLoadComplete handler. For most purposes, use the onLoadInit handler.A SWF file or image loaded into a movie clip inherits the position, rotation, and scale properties of the movie clip. You can use the target path of the movie clip to target the loaded movie.You can use the loadClip() method to load one or more files into a single movie clip or level; MovieClipLoader listener objects are passed to the loading target movie clip instance as a parameter. Alternatively, you can create a different MovieClipLoader object for each file that you load.Use MovieClipLoader.unloadClip() to remove movies or images loaded with this method or to cancel a load operation that is in progress.MovieClipLoader.getProgress() and MovieClipLoaderListener.onLoadProgress do not report the actual bytesLoaded and bytesTotal values in the Authoring player when the files are local. When you use the Bandwidth Profiler feature in the authoring environment, MovieClipLoader.getProgress() and MovieClipLoaderListener.onLoadProgress report the download at the actual download rate, not at the reduced bandwidth rate that the Bandwidth Profiler provides. Parametersurl:String - The absolute or relative URL of the SWF or JPEG file to be loaded. A relative path must be relative to the SWF file at level 0. Absolute URLs must include the protocol reference, such as http:// or file:///. Filenames cannot include disk drive specifications.target:Object - The target path of a movie clip, or an integer specifying the level in Flash Player into which the movie will be loaded. The target movie clip is replaced by the loaded SWF file or image.ReturnsBoolean - A Boolean value. The return value is true if the URL request was sent successfully; otherwise the return value is false.ExampleThe following example shows you how to use the MovieClipLoader.loadClip method by creating handler for the onLoadInit event and then making the request. The following code should either be placed directly into a frame action on a timeline, or pasted into a class that extends MovieClip.Create a handler method for the onLoadInit event.public function onLoadInit(mc:MovieClip):Void { trace(&quot;onLoadInit: &quot; + mc}Create an empty MovieClip and use the MovieClipLoader to load an image into it. var container:MovieClip = createEmptyMovieClip(&quot;container&quot;, getNextHighestDepth()var mcLoader:MovieClipLoader = new MovieClipLoader(mcLoader.addListener(thismcLoader.loadClip(&quot;YourImage.jpg&quot;, containerfunction onLoadInit(mc:MovieClip) { trace(&quot;onLoadInit: &quot; + mc}See alsoonLoadInit (MovieClipLoader.onLoadInit event listener)" />
   <page href="00005399.html" title="MovieClipLoader constructor" text="MovieClipLoader constructorpublic MovieClipLoader()Creates a MovieClipLoader object that you can use to implement a number of listeners to respond to events while a SWF, JPEG, GIF, or PNG file is downloading.ExampleSee MovieClipLoader.loadClip().See alsoaddListener (MovieClipLoader.addListener method), loadClip (MovieClipLoader.loadClip method)" />
   <page href="00005400.html" title="onLoadComplete (MovieClipLoader.onLoadComplete event listener)" text="onLoadComplete (MovieClipLoader.onLoadComplete event listener)onLoadComplete = function(listenerObject, [target_mc]) {}Invoked when a file loaded with MovieClipLoader.loadClip() is completely downloaded. The value for target_mc identifies the movie clip for which this call is being made. This is useful if multiple files are being loaded with the same set of listeners. This parameter is passed by Flash to your code, but you do not have to implement all of the parameters in the listener function.When you use the onLoadComplete and onLoadInit events with the MovieClipLoader class, it&#39;s important to understand how this differs from the way they work with your SWF file. The onLoadComplete event is called after the SWF or JPEG file is loaded, but before the application is initialized. At this point you cannot access the loaded movie clip&#39;s methods and properties, and because of this you cannot call a function, move to a specific frame, and so on. In most situations, it&#39;s better to use the onLoadInit event instead, which is called after the content is loaded and is fully initialized. ParameterslistenerObject: - A listener object that was added using MovieClipLoader.addListener().target_mc: [optional] - A movie clip loaded by a MovieClipLoader.loadClip() method. This parameter is optional.ExampleThe following example loads an image into a movie clip instance called image_mc. The onLoadInit and onLoadComplete events are used to determine how long it takes to load the image. The information appears in a dynamically created text field called timer_txt. this.createEmptyMovieClip(&quot;image_mc&quot;, this.getNextHighestDepth()var mclListener:Object = new Object(mclListener.onLoadStart = function(target_mc:MovieClip) { target_mc.startTimer = getTimer(};mclListener.onLoadComplete = function(target_mc:MovieClip) { target_mc.completeTimer = getTimer(};mclListener.onLoadInit = function(target_mc:MovieClip) { var timerMS:Number = target_mc.completeTimer-target_mc.startTimer; target_mc.createTextField(&quot;timer_txt&quot;, target_mc.getNextHighestDepth(), 0, target_mc._height, target_mc._width, 22 target_mc.timer_txt.text = &quot;loaded in &quot;+timerMS+&quot; ms.&quot;;};var image_mcl:MovieClipLoader = new MovieClipLoader(image_mcl.addListener(mclListenerimage_mcl.loadClip(&quot;http://www.macromedia.com/images/shared/product_boxes/112x112/box_studio_112x112.jpg&quot;, image_mcSee alsoaddListener (MovieClipLoader.addListener method), loadClip (MovieClipLoader.loadClip method), onLoadStart (MovieClipLoader.onLoadStart event listener), onLoadError (MovieClipLoader.onLoadError event listener), onLoadInit (MovieClipLoader.onLoadInit event listener)" />
   <page href="00005401.html" title="onLoadError (MovieClipLoader.onLoadError event listener)" text="onLoadError (MovieClipLoader.onLoadError event listener)onLoadError = function(target_mc, errorCode) {}Invoked when a file loaded with MovieClipLoader.loadClip() has failed to load. This listener can be invoked for various reasons, including if the server is down, if the file is not found, or if a security violation occurs. Call this listener on a listener object that you add using MovieClipLoader.addListener().The value for target_mc identifies the movie clip this call is being made for. This parameter is useful if you are loading multiple files with the same set of listeners.For the errorCode parameter, the string &quot;URLNotFound&quot; is returned if neither the MovieClipLoader.onLoadStart or MovieClipLoader.onLoadComplete listener is called, for example, if a server is down or the file is not found. The string &quot;LoadNeverCompleted&quot; is returned if MovieClipLoader.onLoadStart was called but MovieClipLoader.onLoadComplete was not called, for example, if the download was interrupted because of server overload, server crash, and so on.Parameterstarget_mc: - A movie clip loaded by a MovieClipLoader.loadClip() method.errorCode: - A string that explains the reason for the failure.ExampleThe following example displays information in the Output panel when an image fails to load. this.createEmptyMovieClip(&quot;image_mc&quot;, this.getNextHighestDepth()var mclListener:Object = new Object(mclListener.onLoadError = function(target_mc:MovieClip, errorCode:String) { trace(&quot;ERROR!&quot; switch (errorCode) { case &#39;URLNotFound&#39; : trace(&quot; t Unable to connect to URL: &quot;+target_mc._url break; case &#39;LoadNeverCompleted&#39; : trace(&quot; t Unable to complete download: &quot;+target_mc break; }};mclListener.onLoadInit = function(target_mc:MovieClip) { trace(&quot;success&quot; trace(image_mcl.getProgress(target_mc).bytesTotal+&quot; bytes loaded&quot;};var image_mcl:MovieClipLoader = new MovieClipLoader(image_mcl.addListener(mclListenerimage_mcl.loadClip(&quot;http://www.fakedomain.com/images/bad_hair_day.jpg&quot;, image_mcSee alsoaddListener (MovieClipLoader.addListener method), loadClip (MovieClipLoader.loadClip method), onLoadStart (MovieClipLoader.onLoadStart event listener), onLoadComplete (MovieClipLoader.onLoadComplete event listener)" />
   <page href="00005402.html" title="onLoadInit (MovieClipLoader.onLoadInit event listener)" text="onLoadInit (MovieClipLoader.onLoadInit event listener)onLoadInit = function([target_mc]) {}Invoked when the actions on the first frame of the loaded clip are executed. After this listener is invoked, you can set properties, use methods, and otherwise interact with the loaded movie. Call this listener on a listener object that you add using MovieClipLoader.addListener(). The value for target_mc identifies the movie clip this call is being made for. This parameter is useful if you are loading multiple files with the same set of listeners. Parameterstarget_mc: MovieClip [optional] A movie clip loaded by a MovieClipLoader.loadClip() method.Parameterstarget_mc: [optional] - A movie clip loaded by a MovieClipLoader.loadClip() method.ExampleThe following example loads an image into a movie clip instance called image_mc. The onLoadInit and onLoadComplete events are used to determine how long it takes to load the image. This information appears in a text field called timer_txt. this.createEmptyMovieClip(&quot;image_mc&quot;, this.getNextHighestDepth()var mclListener:Object = new Object(mclListener.onLoadStart = function(target_mc:MovieClip) { target_mc.startTimer = getTimer(};mclListener.onLoadComplete = function(target_mc:MovieClip) { target_mc.completeTimer = getTimer(};mclListener.onLoadInit = function(target_mc:MovieClip) { var timerMS:Number = target_mc.completeTimer-target_mc.startTimer; target_mc.createTextField(&quot;timer_txt&quot;, target_mc.getNextHighestDepth(), 0, target_mc._height, target_mc._width, 22 target_mc.timer_txt.text = &quot;loaded in &quot;+timerMS+&quot; ms.&quot;;};var image_mcl:MovieClipLoader = new MovieClipLoader(image_mcl.addListener(mclListenerimage_mcl.loadClip(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;, image_mcThe following example checks whether a movie is loaded into a movie clip created at runtime:this.createEmptyMovieClip(&quot;tester_mc&quot;, 1var mclListener:Object = new Object(mclListener.onLoadInit = function(target_mc:MovieClip) { trace(&quot;movie loaded&quot;}var image_mcl:MovieClipLoader = new MovieClipLoader(image_mcl.addListener(mclListenerimage_mcl.loadClip(&quot;http://www.yourserver.com/your_movie.swf&quot;, tester_mcSee alsoaddListener (MovieClipLoader.addListener method), loadClip (MovieClipLoader.loadClip method), onLoadStart (MovieClipLoader.onLoadStart event listener)" />
   <page href="00005403.html" title="onLoadProgress (MovieClipLoader.onLoadProgress event listener)" text="onLoadProgress (MovieClipLoader.onLoadProgress event listener)onLoadProgress = function([target_mc], loadedBytes, totalBytes) {}Invoked every time the loading content is written to disk during the loading process (that is, between MovieClipLoader.onLoadStart and MovieClipLoader.onLoadComplete). Call this listener on a listener object that you add using MovieClipLoader.addListener(). You can use this method to display information about the progress of the download, using the loadedBytes and totalBytes parameters. The value for target_mc identifies the movie clip this call is being made for. This is useful if you are loading multiple files with the same set of listeners.Note: If you attempt to use onLoadProgress in test movie mode with a local file that resides on your hard disk, it will not work properly because, in test movie mode, Flash Player loads local files in their entirety.Parameterstarget_mc: MovieClip [optional] A movie clip loaded by a MovieClipLoader.loadClip() method.loadedBytes: Number The number of bytes that had been loaded when the listener was invoked.totalBytes: Number The total number of bytes in the file being loaded.Parameterstarget_mc: [optional] - A movie clip loaded by a MovieClipLoader.loadClip() method.loadedBytes: - The number of bytes that had been loaded when the listener was invoked.totalBytes: - The total number of bytes in the file being loaded.ExampleThe following example creates a new movie clip, a new MovieClipLoader and an anonymous event listener. It should periodically output the progress of a load and finally provide notification when the load is complete and the asset is available to ActionScript. var container:MovieClip = this.createEmptyMovieClip(&quot;container&quot;, this.getNextHighestDepth()var mcLoader:MovieClipLoader = new MovieClipLoader(var listener:Object = new Object(listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void { trace(target + &quot;.onLoadProgress with &quot; + bytesLoaded + &quot; bytes of &quot; + bytesTotal}listener.onLoadInit = function(target:MovieClip):Void { trace(target + &quot;.onLoadInit&quot;}mcLoader.addListener(listenermcLoader.loadClip(&quot;http://www.w3.org/Icons/w3c_main.png&quot;, containerSee alsoaddListener (MovieClipLoader.addListener method), loadClip (MovieClipLoader.loadClip method), getProgress (MovieClipLoader.getProgress method)" />
   <page href="00005404.html" title="onLoadStart (MovieClipLoader.onLoadStart event listener)" text="onLoadStart (MovieClipLoader.onLoadStart event listener)onLoadStart = function([target_mc]) {}Invoked when a call to MovieClipLoader.loadClip() has successfully begun to download a file. Call this listener on a listener object that you add using MovieClipLoader.addListener(). The value for target_mc identifies the movie clip this call is being made for. This parameter is useful if you are loading multiple files with the same set of listeners.Parameterstarget_mc: MovieClip [optional] A movie clip loaded by a MovieClipLoader.loadClip() method.Parameterstarget_mc: [optional] - A movie clip loaded by a MovieClipLoader.loadClip() method.ExampleThe following example loads an image into a movie clip instance called image_mc. The onLoadInit and onLoadComplete events are used to determine how long it takes to load the image. This information appears in a text field called timer_txt. this.createEmptyMovieClip(&quot;image_mc&quot;, this.getNextHighestDepth()var mclListener:Object = new Object(mclListener.onLoadStart = function(target_mc:MovieClip) { target_mc.startTimer = getTimer(};mclListener.onLoadComplete = function(target_mc:MovieClip) { target_mc.completeTimer = getTimer(};mclListener.onLoadInit = function(target_mc:MovieClip) { var timerMS:Number = target_mc.completeTimer-target_mc.startTimer; target_mc.createTextField(&quot;timer_txt&quot;, target_mc.getNextHighestDepth(), 0, target_mc._height, target_mc._width, 22 target_mc.timer_txt.text = &quot;loaded in &quot;+timerMS+&quot; ms.&quot;;};var image_mcl:MovieClipLoader = new MovieClipLoader(image_mcl.addListener(mclListenerimage_mcl.loadClip(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;, image_mcSee alsoaddListener (MovieClipLoader.addListener method), loadClip (MovieClipLoader.loadClip method), onLoadError (MovieClipLoader.onLoadError event listener), onLoadInit (MovieClipLoader.onLoadInit event listener), onLoadComplete (MovieClipLoader.onLoadComplete event listener)" />
   <page href="00005405.html" title="removeListener (MovieClipLoader.removeListener method)" text="removeListener (MovieClipLoader.removeListener method)public removeListener(listener:Object) : BooleanRemoves the listener that was used to receive notification when a MovieClipLoader event handler was invoked. No further loading messages will be received.Parameterslistener:Object - A listener object that was added using MovieClipLoader.addListener().ReturnsBoolean - ExampleThe following example loads an image into a movie clip, and enables the user to start and stop the loading process using two buttons called start_button and stop_button. When the user starts or stops the progress, information is displayed in the Output panel. this.createEmptyMovieClip(&quot;image_mc&quot;, this.getNextHighestDepth()var mclListener:Object = new Object(mclListener.onLoadStart = function(target_mc:MovieClip) { trace(&quot; t onLoadStart&quot;};mclListener.onLoadComplete = function(target_mc:MovieClip) { trace(&quot; t onLoadComplete&quot;};mclListener.onLoadError = function(target_mc:MovieClip, errorCode:String) { trace(&quot; t onLoadError: &quot;+errorCode};mclListener.onLoadInit = function(target_mc:MovieClip) { trace(&quot; t onLoadInit&quot; start_button.enabled = true; stop_button.enabled = false;};var image_mcl:MovieClipLoader = new MovieClipLoader(//start_button.clickHandler = function() { trace(&quot;Starting...&quot; start_button.enabled = false; stop_button.enabled = true; // image_mcl.addListener(mclListener image_mcl.loadClip(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;, image_mc};stop_button.clickHandler = function() { trace(&quot;Stopping...&quot; start_button.enabled = true; stop_button.enabled = false; // image_mcl.removeListener(mclListener};stop_button.enabled = false;See alsoaddListener (MovieClipLoader.addListener method)" />
   <page href="00005406.html" title="unloadClip (MovieClipLoader.unloadClip method)" text="unloadClip (MovieClipLoader.unloadClip method)public unloadClip(target:Object) : BooleanRemoves a movie clip that was loaded by means of MovieClipLoader.loadClip(). If you call this method while a movie is loading, MovieClipLoader.onLoadError is invoked.Parameterstarget:Object - The string or integer passed to the corresponding call to my_mcl.loadClip().ReturnsBoolean - ExampleThe following example loads an image into a movie clip called image_mc. If you click the movie clip, the movie clip is removed and information is displayed in the Output panel. this.createEmptyMovieClip(&quot;image_mc&quot;, this.getNextHighestDepth()var mclListener:Object = new Object(mclListener.onLoadInit = function(target_mc:MovieClip) { target_mc._x = 100; target_mc._y = 100; target_mc.onRelease = function() { trace(&quot;Unloading clip...&quot; trace(&quot; t name: &quot;+target_mc._name trace(&quot; t url: &quot;+target_mc._url image_mcl.unloadClip(target_mc };};var image_mcl:MovieClipLoader = new MovieClipLoader(image_mcl.addListener(mclListenerimage_mcl.loadClip(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;, image_mcSee alsoloadClip (MovieClipLoader.loadClip method), onLoadError (MovieClipLoader.onLoadError event listener)" />
   <page href="00005407.html" title="NetConnection" text="MethodDescriptionconnect( connect(command:String, ... arguments):voidOpens a connection to a server.close( close():void Closes the connection that was opened locally or with the server and dispatches the netStatus event with a code property of NetConnection.Connect.Closed.NetConnectionCreates a NetConnection object that you can use with a NetStream object to invoke commands on a remote application server or to play back streaming video (FLV) files either locally or from a server." />
   <page href="00005408.html" title="connect (NetConnection.connect) method" text="connect (NetConnection.connect) methodOpens a connection to a server. Through this connection, you can play back audio or video (FLV) files from the local file system, or you can invoke commands on a remote server. When using this method, consider the Flash Player security model and the following security considerations:By default, the website denies access between sandboxes. The website can enable access to a resource by using a cross-domain policy file. A website can deny access to a resource by adding server-side ActionScript application logic in Flash Media Server. You cannot use the NetConnection.connect() method if the calling SWF file is in the local-with-file-system sandbox. You can prevent a SWF file from using this method by setting the allowNetworking parameter of the the object and embed tags in the HTML page that contains the SWF content." />
   <page href="00005409.html" title="close (NetConnection.close method) " text="close (NetConnection.close method) public function close():voidCloses the connection that was opened locally or with the server and dispatches the netStatus event with a code property of NetConnection.Connect.Closed. This method disconnects all NetStream objects running over this connection; any queued data that has not been sent is discarded. (To terminate streams without closing the connection, use NetStream.close().) If you call this method and then want to reconnect, you must recreate the NetStream object.See also NetStream" />
   <page href="00005410.html" title="NetStream" text="Standard security restrictions apply. For example a remote SWF file cannot access absolute file:// URLs in the form of &quot;file://C:/somefile.flv&quot;.MethodDescriptionclose() close():void Stops playing all data on the stream, sets the time property to 0, and makes the stream available for another use.pause() pause():void Pauses playback of a video stream.play() play(... arguments):void Begins playback of external audio or a video (FLV) file.seek() Seeks the keyframe closest to the specified number of seconds from the beginning of the stream.setBufferTime() Specifies how long to buffer messages before starting to display.PropertiesDescriptionbufferLength The number of seconds of data currently in the buffer.bufferTime The number of seconds assigned to the buffer by setBufferTime().bytesLoaded The number of bytes of data that have been loaded into the player.bytesTotal The total size in bytes of the file being loaded into the player.currentFPS The number of frames per second being displayed.time The position of the playhead, in seconds.EventDescriptiononStatus Invoked when a status change or error is posted for the NetStream object.onCuePoint Invoked when an embedded cue point is reached during the playing of an FLV.OnMetaData Invoked when Flash Player receives descriptive information embedded in the FLV.NetStreamCreates a stream that can be used for playing FLV files through the specified NetConnection object.Local file URLs are also supported by simply replacing &quot;http:&quot; with &quot;file:&quot; For example:NetStream.play(&quot;http://somefile.flv&quot;NetStream.play(&quot;file://somefile.flv&quot;NetStream Class methodsNetStream Class propertiesNetStream Class events" />
   <page href="00005411.html" title="bufferLength (NetStream.bufferLength property)" text="bufferLength (NetStream.bufferLength property)public bufferLength : Number [read-only]The number of seconds of data currently in the buffer. You can use this property in conjunction with NetStream.bufferTime to estimate how close the buffer is to being full--for example, to display feedback to a user who is waiting for data to be loaded into the buffer.Availability ActionScript 1.0; Flash Player 7 : This property is also supported in Flash Player 6 when used with Flash Media Server. For more information, see the Flash Media Server documentation.ExampleThe following example dynamically creates a text field that displays information about the number of seconds that are currently in the buffer. The text field also displays the buffer length that the video is set to, and percentage of buffer that is filled. this.createTextField(&quot;buffer_txt&quot;, this.getNextHighestDepth(), 10, 10, 300, 22buffer_txt.html = true;var connection_nc:NetConnection = new NetConnection(connection_nc.connect(nullvar stream_ns:NetStream = new NetStream(connection_ncstream_ns.setBufferTime(3my_video.attachVideo(stream_nsstream_ns.play(&quot;video1.flv&quot;var buffer_interval:Number = setInterval(checkBufferTime, 100, stream_nsfunction checkBufferTime(my_ns:NetStream):Void { var bufferPct:Number = Math.min(Math.round(my_ns.bufferLength/my_ns.bufferTime*100), 100 var output_str:String = &quot;&lt;textformat tabStops=&#39;[100,200]&#39;&gt;&quot;; output_str += &quot;Length: &quot;+my_ns.bufferLength+&quot; t&quot;+&quot;Time: &quot;+my_ns.bufferTime+&quot; t&quot;+&quot;Buffer:&quot;+bufferPct+&quot;%&quot;; output_str += &quot;&lt;/textformat&gt;&quot;; buffer_txt.htmlText = output_str;}" />
   <page href="00005412.html" title="bufferTime (NetStream.bufferTime property)" text="bufferTime (NetStream.bufferTime property)public bufferTime : Number [read-only]The number of seconds assigned to the buffer by NetStream.setBufferTime(). The default value is .1(one-tenth of a second). To determine the number of seconds currently in the buffer, use NetStream.bufferLength.Availability ActionScript 1.0; Flash Player 7: This property is also supported in Flash Player 6 when used with Flash Media Server. For more information, see the Flash Media Server documentation.ExampleThe following example dynamically creates a text field that displays information about the number of seconds that are currently in the buffer. The text field also displays the buffer length that the video is set to, and percentage of buffer that is filled. this.createTextField(&quot;buffer_txt&quot;, this.getNextHighestDepth(), 10, 10, 300, 22buffer_txt.html = true;var connection_nc:NetConnection = new NetConnection(connection_nc.connect(nullvar stream_ns:NetStream = new NetStream(connection_ncstream_ns.setBufferTime(3my_video.attachVideo(stream_nsstream_ns.play(&quot;video1.flv&quot;var buffer_interval:Number = setInterval(checkBufferTime, 100, stream_nsfunction checkBufferTime(my_ns:NetStream):Void {var bufferPct:Number = Math.min(Math.round(my_ns.bufferLengthmy_ns.bufferTime*100), 100var output_str:String = &quot;&lt;textformat tabStops=&#39;[100,200]&#39;&gt;&quot;;output_str += &quot;Length: &quot;+my_ns.bufferLength+&quot; t&quot;+&quot;Time:&quot;+my_ns.bufferTime+&quot; t&quot;+&quot;Buffer:&quot;+bufferPct+&quot;%&quot;;output_str += &quot;&lt;/textformat&gt;&quot;;buffer_txt.htmlText = output_str;}" />
   <page href="00005413.html" title="bytesLoaded (NetStream.bytesLoaded property)" text="bytesLoaded (NetStream.bytesLoaded property)public bytesLoaded : Number [read-only]The number of bytes of data that have been loaded into the player. You can use this method in conjunction with NetStream.bytesTotal to estimate how close the buffer is to being full--for example, to display feedback to a user who is waiting for data to be loaded into the buffer.Availability ActionScript 1.0; Flash Player 7ExampleThe following example creates a progress bar using the Drawing API and the bytesLoaded and bytesTotal properties. The bar displays the progress of the operation as video1.flv is loaded into the video object instance called my_video. A text field called loaded_txt is dynamically created to display information about the loading progress as well. var connection_nc:NetConnection = new NetConnection(connection_nc.connect(nullvar stream_ns:NetStream = new NetStream(connection_ncmy_video.attachVideo(stream_nsstream_ns.play(&quot;video1.flv&quot;this.createTextField(&quot;loaded_txt&quot;, this.getNextHighestDepth(), 10, 10, 160, 22this.createEmptyMovieClip(&quot;progressBar_mc&quot;, this.getNextHighestDepth()progressBar_mc.createEmptyMovieClip(&quot;bar_mc&quot;, progressBar_mc.getNextHighestDepth()with (progressBar_mc.bar_mc) { beginFill(0xFF0000 moveTo(0, 0 lineTo(100, 0 lineTo(100, 10 lineTo(0, 10 lineTo(0, 0 endFill( _xscale = 0;}progressBar_mc.createEmptyMovieClip(&quot;stroke_mc&quot;, progressBar_mc.getNextHighestDepth()with (progressBar_mc.stroke_mc) { lineStyle(0, 0x000000 moveTo(0, 0 lineTo(100, 0 lineTo(100, 10 lineTo(0, 10 lineTo(0, 0}var loaded_interval:Number = setInterval(checkBytesLoaded, 500, stream_nsfunction checkBytesLoaded(my_ns:NetStream) { var pctLoaded:Number = Math.round(my_ns.bytesLoaded/my_ns.bytesTotal*100 loaded_txt.text = Math.round(my_ns.bytesLoaded/1000)+&quot; of &quot;+Math.round(my_ns.bytesTotal/1000)+&quot; KB loaded (&quot;+pctLoaded+&quot;%)&quot;; progressBar_mc.bar_mc._xscale = pctLoaded; if (pctLoaded&gt;=100) { clearInterval(loaded_interval }}" />
   <page href="00005414.html" title="bytesTotal (NetStream.bytesTotal property)" text="bytesTotal (NetStream.bytesTotal property)public bytesTotal : Number [read-only]The total size in bytes of the file being loaded into the player.AvailabilityActionScript 1.0; Flash Player 7ExampleThe following example creates a progress bar using the Drawing API and the bytesLoaded and bytesTotal properties. The bar displays the progress of the operation as video1.flv is loaded into the video object instance called my_video. A text field called loaded_txt is dynamically created to display information about the loading progress as well. var connection_nc:NetConnection = new NetConnection(connection_nc.connect(nullvar stream_ns:NetStream = new NetStream(connection_ncmy_video.attachVideo(stream_nsstream_ns.play(&quot;video1.flv&quot;this.createTextField(&quot;loaded_txt&quot;, this.getNextHighestDepth(), 10, 10, 160, 22this.createEmptyMovieClip(&quot;progressBar_mc&quot;, this.getNextHighestDepth()progressBar_mc.createEmptyMovieClip(&quot;bar_mc&quot;, progressBar_mc.getNextHighestDepth()with (progressBar_mc.bar_mc) { beginFill(0xFF0000 moveTo(0, 0 lineTo(100, 0 lineTo(100, 10 lineTo(0, 10 lineTo(0, 0 endFill( _xscale = 0;}progressBar_mc.createEmptyMovieClip(&quot;stroke_mc&quot;, progressBar_mc.getNextHighestDepth()with (progressBar_mc.stroke_mc) { lineStyle(0, 0x000000 moveTo(0, 0 lineTo(100, 0 lineTo(100, 10 lineTo(0, 10 lineTo(0, 0}var loaded_interval:Number = setInterval(checkBytesLoaded, 500, stream_nsfunction checkBytesLoaded(my_ns:NetStream) { var pctLoaded:Number = Math.round(my_ns.bytesLoaded/my_ns.bytesTotal*100 loaded_txt.text = Math.round(my_ns.bytesLoaded/1000)+&quot; of &quot;+Math.round(my_ns.bytesTotal/1000)+&quot; KB loaded (&quot;+pctLoaded+&quot;%)&quot;; progressBar_mc.bar_mc._xscale = pctLoaded; if (pctLoaded&gt;=100) { clearInterval(loaded_interval }}" />
   <page href="00005415.html" title="currentFps (NetStream.currentFps property)" text="currentFps (NetStream.currentFps property)public currentFps : Number [read-only]The number of frames per second being displayed. If you are exporting FLV files to be played back on a number of systems, you can check this value during testing to determine how much compression to apply when exporting the file.AvailabilityActionScript 1.0; Flash Player 7: This property is also supported in Flash Player 6 when used with Flash Media Server. For more information, see the Flash Media Server documentation.ExampleThe following example creates a text field that displays the current number of frames per second that video1.flv displays. var connection_nc:NetConnection = new NetConnection(connection_nc.connect(nullvar stream_ns:NetStream = new NetStream(connection_ncmy_video.attachVideo(stream_nsstream_ns.play(&quot;video1.flv&quot;this.createTextField(&quot;fps_txt&quot;, this.getNextHighestDepth(), 10, 10, 50, 22fps_txt.autoSize = true;var fps_interval:Number = setInterval(displayFPS, 500, stream_nsfunction displayFPS(my_ns:NetStream) { fps_txt.text = &quot;currentFps (frames per second): &quot;+Math.floor(my_ns.currentFps}time (NetStream.time property)" />
   <page href="00005416.html" title="time (NetStream.time property)" text="time (NetStream.time property)public time : Number [read-only]The position of the playhead, in seconds.AvailabilityActionScript 1.0; Flash Player 7: This property is also supported in Flash Player 6 when used with Flash Media Server. For more information, see the Flash Media Server documentation.ExampleThe following example displays the current position of the playhead in a dynamically created text field called time_txt. Select New Video from the Library options menu to create a video object instance, and give it an instance name my_video. Create a new video object called my_video. Add the following ActionScript to your FLA or AS file: var connection_nc:NetConnection = new NetConnection(connection_nc.connect(nullvar stream_ns:NetStream = new NetStream(connection_ncmy_video.attachVideo(stream_nsstream_ns.play(&quot;video1.flv&quot;//stream_ns.onStatus = function(infoObject:Object) { statusCode_txt.text = infoObject.code;};this.createTextField(&quot;time_txt&quot;, this.getNextHighestDepth(), 10, 10, 100, 22time_txt.text = &quot;LOADING&quot;;var time_interval:Number = setInterval(checkTime, 500, stream_nsfunction checkTime(my_ns:NetStream) { var ns_seconds:Number = my_ns.time; var minutes:Number = Math.floor(ns_seconds/60 var seconds = Math.floor(ns_seconds%60 if (seconds&lt;10) { seconds = &quot;0&quot;+seconds; } time_txt.text = minutes+&quot;:&quot;+seconds;}" />
   <page href="00005417.html" title="onStatus (NetStream.onStatus handler)" text="Code propertyLevel propertyMeaningNetStream.Buffer.Empty statusData is not being received quickly enough to fill the buffer. Data flow will be interrupted until the buffer refills, at which time a NetStream.Buffer.Full message will be sent and the stream will begin playing again.NetStream.Buffer.Full statusThe buffer is full and the stream will begin playing.NetStream.Buffer.Flush statusData has finished streaming, and the remaining buffer will be emptied.NetStream.Play.Start statusPlayback has started.NetStream.Play.Stop statusPlayback has stopped.NetStream.Play.StreamNotFound statusThe FLV file passed to the play() method can&#39;t be found.NetStream.Seek.InvalidTime error For video downloaded with progressive download, the user has tried to seek or play past the end of the video data that has downloaded thus far, or past the end of the video once the entire file has downloaded. The Error.message.details property contains a time code that indicates the last valid position to which the user can seek. See Error.message property.NetStream.Seek.Notify statusThe seek operation is complete.onStatus (NetStream.onStatus handler)onStatus = function(infoObject:Object) {}Invoked every time a status change or error is posted for the NetStream object. If you want to respond to this event handler, you must create a function to process the information object. The information object has a code property containing a string that describes the result of the onStatus handler, and a level property containing a string that is either status or error.The following events notify you when certain NetStream activities occur.If you consistently see errors regarding the buffer, you should try changing the buffer using the NetStream.setBufferTime() method.AvailabilityActionScript 1.0; Flash Player 6ParametersinfoObject:Object - A parameter defined according to the status message or error message.ExampleThe following example displays data about the stream in the Output panel: var connection_nc:NetConnection = new NetConnection(connection_nc.connect(nullvar stream_ns:NetStream = new NetStream(connection_ncmy_video.attachVideo(stream_nsstream_ns.play(&quot;video1.flv&quot;stream_ns.onStatus = function(infoObject:Object) { trace(&quot;NetStream.onStatus called: (&quot;+getTimer()+&quot; ms)&quot; for (var prop in infoObject) { trace(&quot; t&quot;+prop+&quot;: t&quot;+infoObject[prop] } trace(&quot;&quot;};" />
   <page href="00005418.html" title="onCuePoint (NetStream.onCuePoint handler)" text="PropertyDescriptionnameThe name given to the cue point when it was embedded in the FLV file.timeThe time in seconds at which the cue point occurred in the video file during playback.typeThe type of cue point that was reached, either &quot;navigation&quot; or &quot;event&quot;.parametersA associative array of name/value pair strings specified for this cue point. Any valid string can be used for the parameter name or value.onCuePoint (NetStream.onCuePoint handler)onCuePoint = function(infoObject:Object) {}Invoked when an embedded cue point is reached while playing an FLV file. You can use this handler to trigger actions in your code when the video reaches a specific cue point. This lets you synchronize other actions in your application with video playback events. Two types of cue points can be embedded in an FLV file.A &quot;navigation&quot; cue point specifies a keyframe within the FLV file and the cue point&#39;s time property corresponds to that exact keyframe. Navigation cue points are often used as bookmarks or entry points to let users navigate through the video file. An &quot;event&quot; cue point is specified by time, whether or not that time corresponds to a specific keyframe. An event cue point usually represents a time in the video when something happens that could be used to trigger other application events. The onCuePoint event handler receives an object with these properties:You can define cue points in an FLV file when you first encode the file, or when you import a video clip in the Flash Authoring tool by using the Video Import wizard.The onMetaData event handler also retrieves information about the cue points in a video file. However the onMetaData event handler gets information about all of the cue points before the video begins playing. The onCuePoint event handler receives information about a single cue point at the time specified for that cue point during playback.Generally if you want your code to respond to a specific cue point at the time it occurs you should use the onCuePoint event handler to trigger some action in your code.You can use the list of cue points provided to the onMetaData() event handler to let your user start playing the video at predefined points along the video stream. Pass the value of the cue point&#39;s time property to the NetStream.seek() method to play the video from that cue point.AvailabilityActionScript 1.0; Flash Player 8ParametersinfoObject:Object - An object containing the name, time, type, and parameters for the cue point.ExampleThe code in this example starts by creating new NetConnection and NetStream objects. Then it defines the onCuePoint() handler for the NetStream object. The handler cycles through each named property in the infoObject object and prints the property&#39;s name and value. When it finds the property named parameters it cycles through each parameter name in the list and prints the parameter name and value. var nc:NetConnection = new NetConnection(nc.connect(nullvar ns:NetStream = new NetStream(ncns.onCuePoint = function(infoObject:Object) { trace(&quot;onCuePoint:&quot; for (var propName:String in infoObject) { if (propName != &quot;parameters&quot;) { trace(propName + &quot; = &quot; + infoObject[propName] } else { trace(&quot;parameters =&quot; if (infoObject.parameters != undefined) { for (var paramName:String in infoObject.parameters) { trace(&quot; &quot; + paramName + &quot;: &quot; + infoObject.parameters[paramName] } } else { trace(&quot;undefined&quot; } }  } trace(&quot;---------&quot; }ns.play(&quot;http://www.helpexamples.com/flash/video/cuepoints.flv&quot;This causes the following information to be displayed: onCuePoint: parameters = lights: beginning type = navigation time = 0.418 name = point1 --------- onCuePoint: parameters = lights: middle type = navigation time = 7.748 name = point2 --------- onCuePoint: parameters = lights: end type = navigation time = 16.02 name = point3 ---------The parameter name &quot;lights&quot; is an arbitrary name used by the author of the example video. You can give cue point parameters any name you want." />
   <page href="00005419.html" title="onMetaData (NetStream.onMetaData handler)" text="onMetaData (NetStream.onMetaData handler)onMetaData = function(infoObject:Object) {}Invoked when the Flash Player receives descriptive information embedded in the FLV file being played. The Flash Video Exporter utility (version 1.1 or greater) embeds a video&#39;s duration, creation date, data rates, and other information into the video file itself. Different video encoders embed different sets of metadata.This handler is triggered after a call to the NetStream.play() method, but before the video playhead has advanced.In many cases the duration value embedded in FLV metadata approximates the actual duration but is not exact. In other words it will not always match the value of the NetStream.time property when the playhead is at the end of the video stream.Availability ActionScript 1.0; Flash Player 7ParametersinfoObject:Object - An object containing one property for each metadata item.ExampleThe code in this example starts by creating new NetConnection and NetStream objects. Then it defines the onMetaData() handler for the NetStream object. The handler cycles through each named property in the infoObject object and prints the property&#39;s name and value. var nc:NetConnection = new NetConnection(nc.connect(nullvar ns:NetStream = new NetStream(ncns.onMetaData = function(infoObject:Object) { for (var propName:String in infoObject) { trace(propName + &quot; = &quot; + infoObject[propName] }};ns.play(&quot;http://www.helpexamples.com/flash/video/water.flv&quot;This causes the following information to be displayed:canSeekToEnd = true videocodecid = 4 framerate = 15 videodatarate = 400 height = 215 width = 320 duration = 7.347The list of properties will vary depending on the software that was used to encode the FLV file." />
   <page href="00005420.html" title="close (NetStream.setBufferTime) method" text="close (NetStream.setBufferTime) methodpublic close() : VoidStops playing all data on the stream, sets the NetStream.time property to 0, and makes the stream available for another use. This command also deletes the local copy of an FLV file that was downloaded using HTTP. Although Flash Player deletes the local copy of the FLV file that it creates, a copy of the video may persist in the browser&#39;s cache directory. If complete prevention of caching or local storage of the FLV file is required, use Flash Media Server.Availability ActionScript 1.0; Flash Player 7: This method is also supported in Flash Player 6 when used with Flash Media Server. For more information, see the Flash Media Server documentation.ExampleThe following close() function closes a connection and deletes the temporary copy of video1.flv that was stored on the local disk when you click the button called close_btn: var connection_nc:NetConnection = new NetConnection(connection_nc.connect(nullvar stream_ns:NetStream = new NetStream(connection_ncmy_video.attachVideo(stream_nsstream_ns.play(&quot;video1.flv&quot;close_btn.onRelease = function(){ stream_ns.close(};" />
   <page href="00005421.html" title="pause (NetStream.pause) method" text="pause (NetStream.pause) methodpublic pause([flag:Boolean]) : VoidPauses or resumes playback of a stream. The first time you call this method (without sending a parameter), it pauses play; the next time, it resumes play. You might want to attach this method to a button that the user presses to pause or resume playback.AvailabilityActionScript 1.0; Flash Player 7: This method is also supported in Flash Player 6 when used with Flash Media Server. For more information, see the Flash Media Server documentation.Parametersflag:Boolean [optional] - A Boolean value specifying whether to pause play (true) or resume play (false). If you omit this parameter, NetStream.pause() acts as a toggle: the first time it is called on a specified stream, it pauses play, and the next time it is called, it resumes play.ExampleThe following examples illustrate some uses of this method: my_ns.pause( // pauses play first time issuedmy_ns.pause( // resumes playmy_ns.pause(false // no effect, play continuesmy_ns.pause( // pauses play" />
   <page href="00005422.html" title="play (NetStream.play method) " text="play (NetStream.play method) public play(name:Object, start:Number, len:Number, reset:Object) : VoidBegins playback of an external video (FLV) file. To view video data, you must call a Video.attachVideo() method; audio being streamed with the video, or an FLV file that contains only audio, is played automatically. If you want to control the audio associated with an FLV file, you can use MovieClip.attachAudio() to route the audio to a movie clip; you can then create a Sound object to control some aspects of the audio. For more information, see MovieClip.attachAudio().If the FLV file can&#39;t be found, the NetStream.onStatus event handler is invoked. If you want to stop a stream that is currently playing, use NetStream.close().You can play local FLV files that are stored in the same directory as the SWF file or in a subdirectory; you can&#39;t navigate to a higher-level directory. For example, if the SWF file is located in a directory named /training, and you want to play a video stored in the /training/videos directory, you would use the following syntax:my_ns.play(&quot;videos/videoName.flv&quot;To play a video stored in the /training directory, you would use the following syntax:my_ns.play(&quot;videoName.flv&quot;When using this method, consider the Flash Player security model.For Flash Player 8:NetStream.play() is not allowed if the calling SWF file is in the local-with-file-system sandbox and the resource is in a non-local sandbox. Network sandbox access from the local-trusted or local-with-networking sandbox requires permission from the website via a cross-domain policy file. For more information, see the following:The Flash Player 9 Security white paper at http://www.adobe.com/go/fp9_0_security The Flash Player 8 Security-Related API white paper at http://www.adobe.com/go/fp8_security_apis AvailabilityActionScript 1.0; Flash Player 7: This method is also supported in Flash Player 6 when used with Flash Media Server. For more information, see the Flash Media Server documentation.Parametersname:Object - The name of an FLV file to play, in quotation marks. Both http:// and file:// formats are supported; the file:// location is always relative to the location of the SWF file.start:Number - len:Number - reset:Object - ExampleThe following example illustrates some ways to use the NetStream.play() method. You can play a file that is on a user&#39;s computer. The joe_user directory is a subdirectory of the directory where the SWF is stored. And, you can play a file on a server: // Play a file that is on the user&#39;s computer.my_ns.play(&quot;file://joe_user/flash/videos/lectureJune26.flv&quot;// Play a file on a server.my_ns.play(&quot;http://someServer.someDomain.com/flash/video/orientation.flv&quot;" />
   <page href="00005423.html" title="seek (NetStream.seek method) " text="seek (NetStream.seek method) public seek(offset:Number) : VoidSeeks the keyframe closest to the specified number of seconds from the beginning of the stream. Playback resumes when this location is reached.AvailabilityActionScript 1.0; Flash Player 7: This method is also supported in Flash Player 6 when used with Flash Media Server. For more information, see the Flash Media Server documentation.Parametersoffset:Number - The approximate time value, in seconds, by which to move the playhead in an FLV file. The playhead moves to the keyframe of the video that&#39;s closest to the value specified by offset. To return to the beginning of the stream, pass 0 to offset. To seek forward from the beginning of the stream, pass the number of seconds you want to advance. For example, to position the playhead 15 seconds from the beginning, use my_ns.seek(15). To seek relative to the current position, pass my_ns.time + n or my_ns.time - n to seek n seconds forward or backward, respectively, from the current position. For example, to rewind 20 seconds from the current position, use my_ns.seek(my_ns.time - 20). The precise location to which the playhead moves differs according to the frames-per-second (fps) setting at which the video was exported. For example, suppose you have two video objects that represent the same video, one exported at 6 fps and the other at 30 fps. If you then use my_ns.seek(15) for both objects, the playhead moves to two different locations. ExampleThe following example illustrates some ways to use the NetStream.seek() command. You can return to the beginning of the stream, move to a location 30 seconds from the beginning of the stream, and move backward three minutes from the current location: // Return to the beginning of the streammy_ns.seek(0// Move to a location 30 seconds from the beginning of the streammy_ns.seek(30// Move backwards three minutes from current locationmy_ns.seek(my_ns.time - 180" />
   <page href="00005424.html" title="setBufferTime (NetStream.setBufferTime) method" text="setBufferTime (NetStream.setBufferTime) methodpublic setBufferTime(bufferTime:Number) : VoidSpecifies how long to buffer messages before starting to display the stream. For example, if you want to make sure that the first 15 seconds of the stream play without interruption, set bufferTime to 15; Flash begins playing the stream only after 15 seconds of data are buffered.AvailabilityActionScript 1.0; Flash Player 7: This method is also supported in Flash Player 6 when used with Flash Media Server. For more information, see the Flash Media Server documentation.ParametersbufferTime:Number - The time, in seconds, during which data is buffered before Flash begins displaying data. The default value is 0.1 (one-tenth of a second).ExampleSee the example for NetStream.bufferLength." />
   <page href="00005425.html" title="Number" text="ModifiersPropertyDescriptionstaticMAX_VALUE:NumberThe largest representable number (double-precision IEEE-754).staticMIN_VALUE:NumberThe smallest representable number (double-precision IEEE-754).staticNaN:NumberThe IEEE-754 value representing Not A Number (NaN).staticNEGATIVE_INFINITY:NumberSpecifies the IEEE-754 value representing negative infinity.staticPOSITIVE_INFINITY:NumberSpecifies the IEEE-754 value representing positive infinity.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)SignatureDescriptionNumber(num:Object)Creates a new Number object.ModifiersSignatureDescriptiontoString(radix:Number) : StringReturns the string representation of the specified Number object (myNumber).valueOf() : NumberReturns the primitive value type of the specified Number object.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)NumberObject | +-Numberpublic class Numberextends ObjectThe Number class is a simple wrapper object for the Number data type. You can manipulate primitive numeric values by using the methods and properties associated with the Number class. This class is identical to the JavaScript Number class. The properties of the Number class are static, which means you do not need an object to use them, so you do not need to use the constructor.The following example calls the toString() method of the Number class, which returns the string 1234: var myNumber:Number = new Number(1234myNumber.toString(The following example assigns the value of the MIN_VALUE property to a variable declared without the use of the constructor:var smallest:Number = Number.MIN_VALUE;Property summaryProperties inherited from class ObjectConstructor summaryMethod summaryMethods inherited from class Object" />
   <page href="00005426.html" title="MAX_VALUE (Number.MAX_VALUE property)" text="MAX_VALUE (Number.MAX_VALUE property)public static MAX_VALUE : NumberThe largest representable number (double-precision IEEE-754). This number is approximately 1.79e+308.ExampleThe following ActionScript displays the largest and smallest representable numbers to the Output panel. trace(&quot;Number.MIN_VALUE = &quot;+Number.MIN_VALUEtrace(&quot;Number.MAX_VALUE = &quot;+Number.MAX_VALUEThis code displays the following values:Number.MIN_VALUE = 4.94065645841247e-324Number.MAX_VALUE = 1.79769313486232e+308" />
   <page href="00005427.html" title="MIN_VALUE (Number.MIN_VALUE property)" text="MIN_VALUE (Number.MIN_VALUE property)public static MIN_VALUE : NumberThe smallest representable number (double-precision IEEE-754). This number is approximately 5e-324.ExampleThe following ActionScript displays the largest and smallest representable numbers to the Output panel to the log file. trace(&quot;Number.MIN_VALUE = &quot;+Number.MIN_VALUEtrace(&quot;Number.MAX_VALUE = &quot;+Number.MAX_VALUEThis code displays the following values:Number.MIN_VALUE = 4.94065645841247e-324Number.MAX_VALUE = 1.79769313486232e+308" />
   <page href="00005428.html" title="NaN (Number.NaN property)" text="NaN (Number.NaN property)public static NaN : NumberThe IEEE-754 value representing Not A Number (NaN).See alsoisNaN function" />
   <page href="00005429.html" title="NEGATIVE_INFINITY (Number.NEGATIVE_INFINITY property)" text="NEGATIVE_INFINITY (Number.NEGATIVE_INFINITY property)public static NEGATIVE_INFINITY : NumberSpecifies 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.ExampleThis example compares the result of dividing the following values. var posResult:Number = 1/0;if (posResult == Number.POSITIVE_INFINITY) { trace(&quot;posResult = &quot;+posResult // output: posResult = Infinity}var negResult:Number = -1/0;if (negResult == Number.NEGATIVE_INFINITY) { trace(&quot;negResult = &quot;+negResult // output: negResult = -Infinity" />
   <page href="00005430.html" title="Number constructor" text="Number constructorpublic Number(num:Object)Creates a new 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.Parametersnum:Object - The numeric value of the Number object being created or a value to be converted to a number. The default value is 0 if value is not provided.ExampleThe following code constructs new Number objects: var n1:Number = new Number(3.4var n2:Number = new Number(-10See alsotoString (Number.toString method), valueOf (Number.valueOf method)" />
   <page href="00005431.html" title="POSITIVE_INFINITY (Number.POSITIVE_INFINITY property)" text="POSITIVE_INFINITY (Number.POSITIVE_INFINITY property)public static POSITIVE_INFINITY : NumberSpecifies 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.ExampleThis example compares the result of dividing the following values. var posResult:Number = 1/0;if (posResult == Number.POSITIVE_INFINITY) { trace(&quot;posResult = &quot;+posResult // output: posResult = Infinity}var negResult:Number = -1/0;if (negResult == Number.NEGATIVE_INFINITY) { trace(&quot;negResult = &quot;+negResult // output: negResult = -Infinity" />
   <page href="00005432.html" title="toString (Number.toString method)" text="toString (Number.toString method)public toString(radix:Number) : StringReturns the string representation of the specified Number object (myNumber).Parametersradix:Number - 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.ReturnsString - A string.ExampleThe following example uses 2 and 8 for the radix parameter and returns a string that contains the corresponding representation of the number 9: var myNumber:Number = new Number(9trace(myNumber.toString(2) // output: 1001trace(myNumber.toString(8) // output: 11 The following example results in a hexadecimal value. var r:Number = new Number(250var g:Number = new Number(128var b:Number = new Number(114var rgb:String = &quot;0x&quot;+ r.toString(16)+g.toString(16)+b.toString(16trace(rgb // output: rgb:0xFA8072 (Hexadecimal equivalent of the color &#39;salmon&#39;)" />
   <page href="00005433.html" title="valueOf (Number.valueOf method)" text="valueOf (Number.valueOf method)public valueOf() : NumberReturns the primitive value type of the specified Number object.ReturnsNumber - A string.ExampleThe following example results in the primative value of the numSocks object. var numSocks = new Number(2trace(numSocks.valueOf() // output: 2" />
   <page href="00005434.html" title="Object" text="ModifiersPropertyDescriptionconstructor:ObjectReference to the constructor function for a given object instance.__proto__:ObjectRefers to the prototype property of the class (ActionScript 2.0) or constructor function (ActionScript 1.0) used to create the object.staticprototype:ObjectA reference to the superclass of a class or function object.__resolve:ObjectA reference to a user-defined function that is invoked if ActionScript code refers to an undefined property or method.SignatureDescriptionObject()Creates an Object object and stores a reference to the object&#39;s constructor method in the object&#39;s constructor property.ModifiersSignatureDescriptionaddProperty(name:String, getter:Function, setter:Function) : BooleanCreates a getter/setter property.hasOwnProperty(name:String) : BooleanIndicates whether an object has a specified property defined.isPropertyEnumerable(name:String) : BooleanIndicates whether the specified property exists and is enumerable.isPrototypeOf(theClass:Object) : BooleanIndicates whether an instance of the Object class is in the prototype chain of the object specified as an argument.staticregisterClass(name:String, theClass:Function) : BooleanAssociates a movie clip symbol with an ActionScript object class.toString() : StringConverts the specified object to a string and returns it.unwatch(name:String) : BooleanRemoves a watchpoint that Object.watch() created.valueOf() : ObjectReturns the primitive value of the specified object.watch(name:String, callback:Function, [userData:Object]) : BooleanRegisters an event handler to be invoked when a specified property of an ActionScript object changes.ObjectObjectpublic class ObjectThe Object class is at the root of the ActionScript class hierarchy. This class contains a small subset of the features provided by the JavaScript Object class.Property summaryConstructor summaryMethod summary" />
   <page href="00005435.html" title="addProperty (Object.addProperty method)" text="Error conditionWhat happensname is not a valid property name; for example, an empty string.Returns false and the property is not added.getter is not a valid function object.Returns false and the property is not added.setter is not a valid function object.Returns false and the property is not added.addProperty (Object.addProperty method)public addProperty(name:String, getter:Function, setter:Function) : BooleanCreates a getter/setter property. When Flash reads a getter/setter property, it invokes the get function, and the function&#39;s return value becomes the value of name. When Flash writes a getter/setter property, it invokes the set function and passes it the new value as a parameter. If a property with the given name already exists, the new property overwrites it. A &quot;get&quot; function is a function with no parameters. Its return value can be of any type. Its type can change between invocations. The return value is treated as the current value of the property.A &quot;set&quot; function is a function that takes one parameter, which is the new value of the property. For example, if property x is assigned by the statement x = 1, the set function is passed the parameter 1 of type number. The return value of the set function is ignored.You can add getter/setter properties to prototype objects. If you add a getter/setter property to a prototype object, all object instances that inherit the prototype object inherit the getter/setter property. This makes it possible to add a getter/setter property in one location, the prototype object, and have it propagate to all instances of a class (similar to adding methods to prototype objects). If a get/set function is invoked for a getter/setter property in an inherited prototype object, the reference passed to the get/set function is the originally referenced object--not the prototype object.If invoked incorrectly, Object.addProperty() can fail with an error. The following table describes errors that can occur:Parametersname:String - A string; the name of the object property to create.getter:Function - The function that is invoked to retrieve the value of the property; this parameter is a Function object.setter:Function - The function that is invoked to set the value of the property; this parameter is a Function object. If you pass the value null for this parameter, the property is read-only.ReturnsBoolean - A Boolean value: true if the property is successfully created; false otherwise.ExampleIn the following example, an object has two internal methods, setQuantity() and getQuantity(). A property, bookcount, can be used to invoke these methods when it is either set or retrieved. A third internal method, getTitle(), returns a read-only value that is associated with the property bookname. When a script retrieves the value of myBook.bookcount, the ActionScript interpreter automatically invokes myBook.getQuantity(). When a script modifies the value of myBook.bookcount, the interpreter invokes myObject.setQuantity(). The bookname property does not specify a set function, so attempts to modify bookname are ignored. function Book() { this.setQuantity = function(numBooks:Number):Void { this.books = numBooks; }; this.getQuantity = function():Number { return this.books; }; this.getTitle = function():String { return &quot;Catcher in the Rye&quot;; }; this.addProperty(&quot;bookcount&quot;, this.getQuantity, this.setQuantity this.addProperty(&quot;bookname&quot;, this.getTitle, null}var myBook = new Book(myBook.bookcount = 5;trace(&quot;You ordered &quot;+myBook.bookcount+&quot; copies of &quot;+myBook.bookname// output: You ordered 5 copies of Catcher in the RyeThe 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 property&#39;s 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 &quot;Catcher in the Rye&quot;;};Book.prototype.addProperty(&quot;bookcount&quot;, Book.prototype.getQuantity, Book.prototype.setQuantityBook.prototype.addProperty(&quot;bookname&quot;, Book.prototype.getTitle, nullvar myBook = new Book(myBook.bookcount = 5;trace(&quot;You ordered &quot;+myBook.bookcount+&quot; copies of &quot;+myBook.booknameThe following example shows how to use the implicit getter and setter functions available in ActionScript 2.0. Rather than defining the Book function and editing Book.prototype, you define the Book class in an external file named Book.as. The following code must be in a separate external file named Book.as that contains only this class definition and resides within the Flash application&#39;s classpath:class Book { var books:Number; function set bookcount(numBooks:Number):Void { this.books = numBooks; } function get bookcount():Number { return this.books; } function get bookname():String { return &quot;Catcher in the Rye&quot;; }}The following code can then be placed in a FLA file and will function the same way as it does in the previous examples:var myBook:Book = new Book( myBook.bookcount = 5; trace(&quot;You ordered &quot;+myBook.bookcount+&quot; copies of &quot;+myBook.booknameSee alsogetProperty function, setInterval function" />
   <page href="00005436.html" title="constructor (Object.constructor property)" text="constructor (Object.constructor property)public constructor : ObjectReference to the constructor function for a given object instance. The constructor property is automatically assigned to all objects when they are created using the constructor for the Object class.ExampleThe following example is a reference to the constructor function for the myObject object. var my_str:String = new String(&quot;sven&quot;trace(my_str.constructor == String //output: trueIf you use the instanceof operator, you can also determine if an object belongs to a specified class:var my_str:String = new String(&quot;sven&quot;trace(my_str instanceof String //output: trueHowever, in the following example the Object.constructor property converts primitive data types (such as the string literal seen here) into wrapper objects. The instanceof operator does not perform any conversion, as seen in the following example:var my_str:String = &quot;sven&quot;;trace(my_str.constructor == String //output: truetrace(my_str instanceof String //output: falseSee alsoinstanceof operator" />
   <page href="00005437.html" title="hasOwnProperty (Object.hasOwnProperty method)" text="hasOwnProperty (Object.hasOwnProperty method)public hasOwnProperty(name:String) : BooleanIndicates whether an object has a specified property defined. This method returns true if the target object has a property that matches the string specified by the name parameter, and false otherwise. This method does not check the object&#39;s prototype chain and returns true only if the property exists on the object itself.Parametersname:String - ReturnsBoolean - A Boolean value: true if the target object has the property specified by the name parameter, false otherwise." />
   <page href="00005438.html" title="isPropertyEnumerable (Object.isPropertyEnumerable method)" text="isPropertyEnumerable (Object.isPropertyEnumerable method)public isPropertyEnumerable(name:String) : BooleanIndicates whether the specified property exists and is enumerable. If true, then the property exists and can be enumerated in a for..in loop. The property must exist on the target object because this method does not check the target object&#39;s prototype chain. Properties that you create are enumerable, but built-in properties are generally not enumerable.Parametersname:String - ReturnsBoolean - A Boolean value: true if the property specified by the name parameter is enumerable.ExampleThe following example creates a generic object, adds a property to the object, then checks whether the object is enumerable. By way of contrast, the example also shows that a built-in property, the Array.length property, is not enumerable. var myObj:Object = new Object(myObj.prop1 = &quot;hello&quot;;trace(myObj.isPropertyEnumerable(&quot;prop1&quot;) // Output: truevar myArray = new Array(trace(myArray.isPropertyEnumerable(&quot;length&quot;) // Output: falseSee alsofor..in statement" />
   <page href="00005439.html" title="isPrototypeOf (Object.isPrototypeOf method)" text="isPrototypeOf (Object.isPrototypeOf method)public isPrototypeOf(theClass:Object) : BooleanIndicates whether an instance of the Object class is in the prototype chain of the object specified as an argument. This method returns true if the object is in the prototype chain of the object specified by the theClass parameter. The method returns false not only if the target object is absent from the prototype chain of the theClass object, but also if the theClass argument is not an object.ParameterstheClass:Object - ReturnsBoolean - A Boolean value: true if the object is in the prototype chain of the object specified by the theClass parameter; false otherwise." />
   <page href="00005440.html" title="Object constructor" text="Object constructorpublic Object()Creates an Object object and stores a reference to the object&#39;s constructor method in the object&#39;s constructor property.ExampleThe following example creates a generic object named myObject: var myObject:Object = new Object(" />
   <page href="00005441.html" title="__proto__ (Object.__proto__ property)" text="__proto__ (Object.__proto__ property)public __proto__ : ObjectRefers to the prototype property of the class (ActionScript 2.0) or constructor function (ActionScript 1.0) used to create the object. The __proto__ property is automatically assigned to all objects when they are created. The ActionScript interpreter uses the __proto__ property to access the prototype property of the object&#39;s class or constructor function to find out what properties and methods the object inherits from its superclass. ExampleThe following example creates a class named Shape and a subclass of Shape named Circle. // Shape class defined in external file named Shape.asclass Shape { function Shape() {}}// Circle class defined in external file named Circle.asclass Circle extends Shape{ function Circle() {}} The Circle class can be used to create two instances of Circle: var oneCircle:Circle = new Circle(var twoCircle:Circle = new Circle( The following trace statements show that the __proto_ property of both instances refers to the prototype property of the Circle class. trace(Circle.prototype == oneCircle.__proto__ // Output: truetrace(Circle.prototype == twoCircle.__proto__ // Output: trueSee alsoprototype (Object.prototype property)" />
   <page href="00005442.html" title="prototype (Object.prototype property)" text="prototype (Object.prototype property)public static prototype : ObjectA reference to the superclass of a class or function object. The prototype property is automatically created and attached to any class or function object you create. This property is static in that it is specific to the class or function you create. For example, if you create a custom class, the value of the prototype property is shared by all instances of the class, and is accessible only as a class property. Instances of your custom class cannot directly access the prototype property, but can access it through the __proto__ property.ExampleThe following example creates a class named Shape and a subclass of Shape named Circle. // Shape class defined in external file named Shape.asclass Shape { function Shape() {}}// Circle class defined in external file named Circle.asclass Circle extends Shape{ function Circle() {}} The Circle class can be used to create two instances of Circle: var oneCircle:Circle = new Circle(var twoCircle:Circle = new Circle( The following trace statement shows that the prototype property of the Circle class points to its superclass Shape. The identifier Shape refers to the constructor function of the Shape class. trace(Circle.prototype.constructor == Shape // Output: true The following trace statement shows how you can use the prototype property and the __proto__ property together to move two levels up the inheritance hierarchy (or prototype chain). The Circle.prototype.__proto__ property contains a reference to the superclass of the Shape class. trace(Circle.prototype.__proto__ == Shape.prototype // Output: trueSee also__proto__ (Object.__proto__ property)" />
   <page href="00005443.html" title="registerClass (Object.registerClass method)" text="registerClass (Object.registerClass method)public static registerClass(name:String, theClass:Function) : BooleanAssociates a movie clip symbol with an ActionScript object class. If a symbol doesn&#39;t exist, Flash creates an association between a string identifier and an object class. When an instance of the specified movie clip symbol is placed on the Timeline, it is registered to the class specified by the theClass parameter rather than to the class MovieClip. When an instance of the specified movie clip symbol is created by using MovieClip.attachMovie() or MovieClip.duplicateMovieClip(), it is registered to the class specified by theClass rather than to the MovieClip class. If theClass is null, this method removes any ActionScript class definition associated with the specified movie clip symbol or class identifier. For movie clip symbols, any existing instances of the movie clip remain unchanged, but new instances of the symbol are associated with the default class MovieClip.If a symbol is already registered to a class, this method replaces it with the new registration.When a movie clip instance is placed by the Timeline or created using attachMovie() or duplicateMovieClip(), ActionScript invokes the constructor for the appropriate class with the keyword this pointing to the object. The constructor function is invoked with no parameters. If you use this method to register a movie clip with an ActionScript class other than MovieClip, the movie clip symbol doesn&#39;t inherit the methods, properties, and events of the built-in MovieClip class unless you include the MovieClip class in the prototype chain of the new class. The following code creates a new ActionScript class called theClass that inherits the properties of the MovieClip class:theClass.prototype = new MovieClip(Parametersname:String - String; the linkage identifier of the movie clip symbol or the string identifier for the ActionScript class.theClass:Function - A reference to the constructor function of the ActionScript class or null to unregister the symbol.ReturnsBoolean - A Boolean value: if the class registration succeeds, a value of true is returned; false otherwise.See alsoattachMovie (MovieClip.attachMovie method), duplicateMovieClip (MovieClip.duplicateMovieClip method)" />
   <page href="00005444.html" title="__resolve (Object.__resolve property)" text="__resolve (Object.__resolve property)public __resolve : ObjectA reference to a user-defined function that is invoked if ActionScript code refers to an undefined property or method. If ActionScript code refers to an undefined property or method of an object, Flash Player determines whether the object&#39;s __resolve property is defined. If __resolve is defined, the function to which it refers is executed and passed the name of the undefined property or method. This lets you programmatically supply values for undefined properties and statements for undefined methods and make it seem as if the properties or methods are actually defined. This property is useful for enabling highly transparent client/server communication, and is the recommended way of invoking server-side methods.ExampleThe following examples progressively build upon the first example and illustrate five different usages of the __resolve property. To aid understanding, key statements that differ from the previous usage are in bold typeface. Usage 1: the following example uses __resolve to build an object where every undefined property returns the value &quot;Hello, world!&quot;.// instantiate a new objectvar myObject:Object = new Object(// define the __resolve functionmyObject.__resolve = function (name) { return &quot;Hello, world!&quot;;};trace (myObject.property1 // output: Hello, world!trace (myObject.property2 // output: Hello, world!Usage 2: the following example uses __resolve as a functor, which is a function that generates functions. Using __resolve redirects undefined method calls to a generic function named myFunction.// instantiate a new objectvar myObject:Object = new Object(// define a function for __resolve to callmyObject.myFunction = function (name) { trace(&quot;Method &quot; + name + &quot; was called&quot;};// define the __resolve functionmyObject.__resolve = function (name) { return function () { this.myFunction(name };};// test __resolve using undefined method namesmyObject.someMethod( // output: Method someMethod was calledmyObject.someOtherMethod( //output: Method someOtherMethod was calledUsage 3: The following example builds on the previous example by adding the ability to cache resolved methods. By caching methods, __resolve is called only once for each method of interest. This allows lazy construction of object methods. Lazy construction is an optimization technique that defers the creation, or construction, of methods until the time at which a method is first used.// instantiate a new objectvar myObject:Object = new Object(// define a function for __resolve to callmyObject.myFunction = function(name) { trace(&quot;Method &quot;+name+&quot; was called&quot;};// define the __resolve functionmyObject.__resolve = function(name) { trace(&quot;Resolve called for &quot;+name // to check when __resolve is called // Not only call the function, but also save a reference to it var f:Function = function () { this.myFunction(name }; // create a new object method and assign it the reference this[name] = f; // return the reference return f;};// test __resolve using undefined method names// __resolve will only be called once for each method namemyObject.someMethod( // calls __resolvemyObject.someMethod( // does not call __resolve because it is now definedmyObject.someOtherMethod( // calls __resolvemyObject.someOtherMethod( // does not call __resolve, no longer undefinedUsage 4: The following example builds on the previous example by reserving a method name, onStatus(), for local use so that it is not resolved in the same way as other undefined properties. Added code is in bold typeface.// instantiate a new objectvar myObject:Object = new Object(// define a function for __resolve to callmyObject.myFunction = function(name) { trace(&quot;Method &quot;+name+&quot; was called&quot;};// define the __resolve functionmyObject.__resolve = function(name) { // reserve the name &quot;onStatus&quot; for local use if (name == &quot;onStatus&quot;) { return undefined; } trace(&quot;Resolve called for &quot;+name // to check when __resolve is called // Not only call the function, but also save a reference to it var f:Function = function () { this.myFunction(name }; // create a new object method and assign it the reference this[name] = f; // return the reference return f;};// test __resolve using the method name &quot;onStatus&quot;trace(myObject.onStatus(&quot;hello&quot;)// output: undefinedUsage 5: The following example builds on the previous example by creating a functor that accepts parameters. This example makes extensive use of the arguments object, and uses several methods of the Array class.// instantiate a new objectvar myObject:Object = new Object(// define a generic function for __resolve to callmyObject.myFunction = function (name) { arguments.shift( trace(&quot;Method &quot; + name + &quot; was called with arguments: &quot; + arguments.join(&#39;,&#39;)};// define the __resolve functionmyObject.__resolve = function (name) { // reserve the name &quot;onStatus&quot; for local use if (name == &quot;onStatus&quot;) { return undefined; } var f:Function = function () {  arguments.unshift(name this.myFunction.apply(this, arguments  }; // create a new object method and assign it the reference this[name] = f; // return the reference to the function return f;};// test __resolve using undefined method names with parametersmyObject.someMethod(&quot;hello&quot;// output: Method someMethod was called with arguments: hellomyObject.someOtherMethod(&quot;hello&quot;,&quot;world&quot;// output: Method someOtherMethod was called with arguments: hello,worldSee alsoarguments, Array" />
   <page href="00005445.html" title="toString (Object.toString method)" text="toString (Object.toString method)public toString() : StringConverts the specified object to a string and returns it.ReturnsString - A string.ExampleThis example shows the return value for toString() on a generic object: var myObject:Object = new Object(trace(myObject.toString() // output: [object Object]This method can be overridden to return a more meaningful value. The following examples show that this method has been overridden for the built-in classes Date, Array, and Number:// Date.toString() returns the current date and timevar myDate:Date = new Date(trace(myDate.toString() // output: [current date and time]// Array.toString() returns the array contents as a comma-delimited stringvar myArray:Array = new Array(&quot;one&quot;, &quot;two&quot;trace(myArray.toString() // output: one,two// Number.toString() returns the number value as a string// Because trace() won&#39;t tell us whether the value is a string or number// we will also use typeof() to test whether toString() works.var myNumber:Number = 5;trace(typeof (myNumber) // output: numbertrace(myNumber.toString() // output: 5trace(typeof (myNumber.toString()) // output: stringThe following example shows how to override toString() in a custom class. First create a text file named Vehicle.as that contains only the Vehicle class definition and place it into your Classes folder inside your Configuration folder.// contents of Vehicle.asclass Vehicle { var numDoors:Number; var color:String; function Vehicle(param_numDoors:Number, param_color:String) { this.numDoors = param_numDoors; this.color = param_color; } function toString():String { var doors:String = &quot;door&quot;; if (this.numDoors &gt; 1) { doors += &quot;s&quot;; } return (&quot;A vehicle that is &quot; + this.color + &quot; and has &quot; + this.numDoors + &quot; &quot; + doors }}// code to place into a FLA filevar myVehicle:Vehicle = new Vehicle(2, &quot;red&quot;trace(myVehicle.toString()// output: A vehicle that is red and has 2 doors// for comparison purposes, this is a call to valueOf()// there is no primitive value of myVehicle, so the object is returned// giving the same output as toString().trace(myVehicle.valueOf()// output: A vehicle that is red and has 2 doors" />
   <page href="00005446.html" title="unwatch (Object.unwatch method)" text="unwatch (Object.unwatch method)public unwatch(name:String) : BooleanRemoves a watchpoint that Object.watch() created. This method returns a value of true if the watchpoint is successfully removed, false otherwise.Parametersname:String - A string; the name of the object property that should no longer be watched.ReturnsBoolean - A Boolean value: true if the watchpoint is successfully removed, false otherwise.ExampleSee the example for Object.watch().See alsowatch (Object.watch method), addProperty (Object.addProperty method)" />
   <page href="00005447.html" title="valueOf (Object.valueOf method)" text="valueOf (Object.valueOf method)public valueOf() : ObjectReturns the primitive value of the specified object. If the object does not have a primitive value, the object is returned.ReturnsObject - The primitive value of the specified object or the object itself.ExampleThe following example shows the return value of valueOf() for a generic object (which does not have a primitive value) and compares it to the return value of toString(). First, create a generic object. Second, create a new Date object set to February 1, 2004, 8:15 AM. The toString() method returns the current time in human-readable form. The valueOf() method returns the primitive value in milliseconds. Third, create a new Array object containing two simple elements. Both toString() and valueOf() return the same value: one,two: // Create a generic objectvar myObject:Object = new Object(trace(myObject.valueOf() // output: [object Object]trace(myObject.toString() // output: [object Object]The following examples show the return values for the built-in classes Date and Array, and compares them to the return values of Object.toString():// Create a new Date object set to February 1, 2004, 8:15 AM// The toString() method returns the current time in human-readable form// The valueOf() method returns the primitive value in millisecondsvar myDate:Date = new Date(2004,01,01,8,15trace(myDate.toString() // output: Sun Feb 1 08:15:00 GMT-0800 2004trace(myDate.valueOf() // output: 1075652100000// Create a new Array object containing two simple elements// In this case both toString() and valueOf() return the same value: one,twovar myArray:Array = new Array(&quot;one&quot;, &quot;two&quot;trace(myArray.toString() // output: one,twotrace(myArray.valueOf() // output: one,twoSee the example for Object.toString() for an example of the return value of Object.valueOf() for a custom class that overrides toString().See alsotoString (Object.toString method)" />
   <page href="00005448.html" title="watch (Object.watch method)" text="watch (Object.watch method)public watch(name:String, callback:Function, [userData:Object]) : BooleanRegisters an event handler to be invoked when a specified property of an ActionScript object changes. When the property changes, the event handler is invoked with myObject as the containing object. You can use the return statement in your callback method definition to affect the value of the property you are watching. The value returned by your callback method is assigned to the watched object property. The value you choose to return depends on whether you wish to monitor, modify or prevent changes to the property:If you are merely monitoring the property, return the newVal parameter.If you are modifying the value of the property, return your own value. If you want to prevent changes to the property, return the oldVal parameter.If the callback method you define does not have a return statement, then the watched object property is assigned a value of undefined.A watchpoint can filter (or nullify) the value assignment, by returning a modified newval (or oldval). If you delete a property for which a watchpoint has been set, that watchpoint does not disappear. If you later recreate the property, the watchpoint is still in effect. To remove a watchpoint, use the Object.unwatch method. Only a single watchpoint can be registered on a property. Subsequent calls to Object.watch() on the same property replace the original watchpoint.The Object.watch() method behaves similarly to the Object.watch() function in JavaScript 1.2 and later. The primary difference is the userData parameter, which is a Flash addition to Object.watch() that Netscape Navigator does not support. You can pass the userData parameter to the event handler and use it in the event handler.The Object.watch() method cannot watch getter/setter properties. Getter/setter properties operate through lazy evaluation-- the value of the property is not determined until the property is actually queried. Lazy evaluation is often efficient because the property is not constantly updated; it is, rather, evaluated when needed. However, Object.watch() needs to evaluate a property to determine whether to invoke the callback function. To work with a getter/setter property, Object.watch() needs to evaluate the property constantly, which is inefficient.Generally, predefined ActionScript properties, such as _x, _y, _width, and _height, are getter/setter properties and cannot be watched with Object.watch(). Parametersname:String - A string; the name of the object property to watch.callback:Function - The function to invoke when the watched property changes. This parameter is a function object, not a function name as a string. The form of callback is callback(prop, oldVal, newVal, userData).userData:Object [optional] - An arbitrary piece of ActionScript data that is passed to the callback method. If the userData parameter is omitted, undefined is passed to the callback method.ReturnsBoolean - A Boolean value: true if the watchpoint is created successfully, false otherwise.ExampleThe following example uses watch() to check whether the speed property exceeds the speed limit: // Create a new objectvar myObject:Object = new Object(// Add a property that tracks speedmyObject.speed = 0;// Write the callback function to be executed if the speed property changesvar speedWatcher:Function = function(prop, oldVal, newVal, speedLimit) { // Check whether speed is above the limit if (newVal &gt; speedLimit) { trace (&quot;You are speeding.&quot; } else { trace (&quot;You are not speeding.&quot; }  // Return the value of newVal. return newVal;}// Use watch() to register the event handler, passing as parameters:// - the name of the property to watch: &quot;speed&quot;// - a reference to the callback function speedWatcher// - the speedLimit of 55 as the userData parametermyObject.watch(&quot;speed&quot;, speedWatcher, 55// set the speed property to 54, then to 57myObject.speed = 54; // output: You are not speedingmyObject.speed = 57; // output: You are speeding// unwatch the objectmyObject.unwatch(&quot;speed&quot;myObject.speed = 54; // there should be no outputSee alsoaddProperty (Object.addProperty method), unwatch (Object.unwatch method)" />
   <page href="00005449.html" title="security (System.security)" text="constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)ModifiersSignatureDescriptionstaticallowDomain(domain1:String) : VoidLets SWF files and HTML files in the identified domains access objects and variables in the calling SWF file or in any other SWF file from the same domain as the calling SWF file.staticallowInsecureDomain(domain:String) : VoidLets SWF files and HTML files in the identified domains access objects and variables in the calling SWF file, which is hosted using the HTTPS protocol.staticloadPolicyFile(url:String) : VoidLoads a cross-domain policy file from a location specified by the url parameter.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)security (System.security)Object | +-System.securitypublic class securityextends ObjectThe System.security class contains methods that specify how SWF files in different domains can communicate with each other.Property summaryProperties inherited from class ObjectMethod summaryMethods inherited from class Object" />
   <page href="00005450.html" title="allowDomain (security.allowDomain method)" text="allowDomain (security.allowDomain method)public static allowDomain(domain1:String) : VoidLets SWF files and HTML files in the identified domains 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 in Flash Player 7 or later, the parameters 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(&quot;domain.com&quot; // Corresponding commands to allow access by SWF files // that are running in Flash Player 7 or later System.security.allowDomain(&quot;www.domain.com&quot;, &quot;store.domain.com&quot;Also, for files running in Flash Player 7 or later, you can&#39;t use this method to let SWF files hosted using a secure protocol (HTTPS) allow access from SWF files hosted in nonsecure protocols; you must use System.security.allowInsecureDomain() instead.Occasionally, you might encounter the following situation: You load a child SWF file from a different domain and want to allow the child SWF file to script the parent SWF file, but you don&#39;t know the final domain from which the child SWF file will originate. This can happen, for example, when you use load-balancing redirects or third-party servers.In this situation, you can use the MovieClip._url property as an argument to this method. For example, if you load a SWF file into my_mc, you can call System.security.allowDomain(my_mc._url).If you do this, be sure to wait until the SWF file in my_mc is loaded, because the _url property does not have its final, correct value until the file is completely loaded. The best way to determine when a child SWF finishes loading is to use MovieClipLoader.onLoadComplete.The opposite situation can also occur; that is, you might create a child SWF file that wants to allow its parent to script it, but doesn&#39;t know what the domain of its parent will be. In this situation, call System.security.allowDomain(_parent._url) from the child SWF. In this situation, you don&#39;t have to wait for the parent SWF file to load; the parent is already loaded by the time the child loads.Parametersdomain1:String - One or more strings that specify domains that can access objects and variables in the SWF file that contains the System.Security.allowDomain() call. The domains can be formatted in the following ways: &quot;domain.com&quot;&quot;http://domain.com&quot;&quot;http://IPaddress&quot;ExampleThe SWF file located at www.macromedia.com/MovieA.swf contains the following lines:  System.security.allowDomain(&quot;www.shockwave.com&quot; loadMovie(&quot;http://www.shockwave.com/MovieB.swf&quot;, my_mcBecause MovieA contains the allowDomain() call, MovieB can access the objects and variables in MovieA. If MovieA didn&#39;t contain this call, the Flash security implementation would prevent MovieB from accessing MovieA&#39;s objects and variables.See alsoonLoadComplete (MovieClipLoader.onLoadComplete event listener), _parent (MovieClip._parent property), _url (MovieClip._url property), allowInsecureDomain (security.allowInsecureDomain method)" />
   <page href="00005451.html" title="allowInsecureDomain (security.allowInsecureDomain method)" text="allowInsecureDomain (security.allowInsecureDomain method)public static allowInsecureDomain(domain:String) : VoidLets SWF files and HTML files in the identified domains access objects and variables in the calling SWF file, which is hosted using the HTTPS protocol. It also lets the SWF files in the identified domains access any other SWF files in the same domain as the calling SWF file. 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 might 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. Note: It is sometimes necessary to call System.security.allowInsecureDomain() with an argument that exactly matches the domain of the SWF file in which this call appears. This is different from System.security.allowDomain(), which is never necessary to call with a SWF file&#39;s own domain as an argument. The reason this is sometimes necessary with System.security.allowInsecureDomain() is that, by default, a SWF file at http://foo.com is not allowed to script a SWF file at https://foo.com, even though the domains are identical.Parametersdomain:String - An exact domain name, such as www.myDomainName.com or store.myDomainName.com.ExampleIn the following example, you host a math test on a secure domain so that only registered students can access it. You have also developed a number of SWF files that illustrate certain concepts, which you host on an insecure domain. You want students to access the test from the SWF file that contains information about a concept.  // This SWF file is at https://myEducationSite.somewhere.com/mathTest.swf // Concept files are at http://myEducationSite.somewhere.com System.security.allowInsecureDomain(&quot;myEducationSite.somewhere.com&quot;See alsoallowDomain (security.allowDomain method)" />
   <page href="00005452.html" title="loadPolicyFile (security.loadPolicyFile method)" text="loadPolicyFile (security.loadPolicyFile method)public static loadPolicyFile(url:String) : VoidLoads a cross-domain policy file from a location specified by the url parameter. Flash Player uses policy files as a permission mechanism to permit Flash movies to load data from servers other than their own. Flash Player 7.0.14.0 looked for policy files in only one location: /crossdomain.xml on the server to which a data-loading request was being made. For an XMLSocket connection attempt, Flash Player 7.0.14.0 looked for /crossdomain.xml on an HTTP server on port 80 in the subdomain to which the XMLSocket connection attempt was being made. Flash Player 7.0.14.0 (and all earlier players) also restricted XMLSocket connections to ports 1024 and later.With the addition of System.security.loadPolicyFile(), Flash Player 7.0.19.0 can load policy files from arbitrary locations, as shown in the following example: System.security.loadPolicyFile(&quot;http://foo.com/sub/dir/pf.xml&quot;This causes Flash Player to retrieve a policy file from the specified URL. Any permissions granted by the policy file at that location will apply to all content at the same level or lower in the virtual directory hierarchy of the server. The following code continues the previous example: loadVariables(&quot;http://foo.com/sub/dir/vars.txt&quot;) // allowed loadVariables(&quot;http://foo.com/sub/dir/deep/vars2.txt&quot;) // allowed loadVariables(&quot;http://foo.com/elsewhere/vars3.txt&quot;) // not allowedYou can use loadPolicyFile() to load any number of policy files. When considering a request that requires a policy file, Flash Player always waits for the completion of any policy file downloads before denying a request. As a final fallback, if no policy file specified with loadPolicyFile() authorizes a request, Flash Player consults the original default location, /crossdomain.xml.Using the xmlsocket protocol along with a specific port number, lets you retrieve policy files directly from an XMLSocket server, as shown in the following example: System.security.loadPolicyFile(&quot;xmlsocket://foo.com:414&quot;This causes Flash Player to attempt to retrieve a policy file from the specified host and port. Any port can be used, not only ports 1024 and higher. Upon establishing a connection with the specified port, Flash Player transmits &lt;policy-file-request /&gt;, terminated by a null byte. An XMLSocket server can be configured to serve both policy files and normal XMLSocket connections over the same port, in which case the server should wait for &lt;policy-file-request /&gt; before transmitting a policy file. A server can also be set up to serve policy files over a separate port from standard connections, in which case it can 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, and may thereafter close 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 XMLSocket server has the same syntax as any other policy file, except that it must also specify the ports to which access is granted. When a policy file comes from a port lower than 1024, it can grant access to any ports; when a policy file comes from port 1024 or higher, it can grant access only to other ports 1024 and higher. The allowed ports are specified in a &quot;to-ports&quot; attribute in the &lt;allow-access-from&gt; tag. Single port numbers, port ranges, and wildcards are all allowed. The following example shows an XMLSocket policy file: &lt;cross-domain-policy&gt; &lt;allow-access-from domain=&quot;*&quot; to-ports=&quot;507&quot; /&gt; &lt;allow-access-from domain=&quot;*.foo.com&quot; to-ports=&quot;507,516&quot; /&gt; &lt;allow-access-from domain=&quot;*.bar.com&quot; to-ports=&quot;516-523&quot; /&gt; &lt;allow-access-from domain=&quot;www.foo.com&quot; to-ports=&quot;507,516-523&quot; /&gt; &lt;allow-access-from domain=&quot;www.bar.com&quot; to-ports=&quot;*&quot; /&gt; &lt;/cross-domain-policy&gt;A policy file obtained from the old default location--/crossdomain.xml on an HTTP server on port 80--implicitly authorizes access to all ports 1024 and above. There is no way to retrieve a policy file to authorize XMLSocket operations from any other location on an HTTP server; any custom locations for XMLSocket policy files must be on an XMLSocket server.Because the ability to connect to ports lower than 1024 is new, a policy file loaded with loadPolicyFile() must always authorize this connection, even when a movie clip is connecting to its own subdomain. Parametersurl:String - A string; the URL where the cross-domain policy file to be loaded is located." />
   <page href="00005453.html" title="Selection" text="constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)EventDescriptiononSetFocus = function([oldfocus], [newfocus]) {}Notified when the input focus changes.ModifiersSignatureDescriptionstaticaddListener(listener:Object) : VoidRegisters an object to receive keyboard focus change notifications.staticgetFocus() : StringReturns a string specifying the target path of the object that has focus.staticremoveListener(listener:Object) : BooleanRemoves an object previously registered with the Selection.addListener() method.staticsetFocus(newFocus:Object) : BooleanGives focus to the selectable (editable) text field, button, or movie clip, that the newFocus parameter specifies.staticsetSelection(beginIndex:Number, endIndex:Number) : VoidSets the selection span of the currently focused text field.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)SelectionObject | +-Selectionpublic class Selectionextends ObjectThe Selection class lets you set and control the text field in which the insertion point is located (that is, the field that has focus). Selection-span indexes are zero-based (for example, the first position is 0, the second position is 1, and so on). There is no constructor function for the Selection class, because there can be only one currently focused field at a time.The Selection object is valid only when a device supports inline text entry. If a device does not support inline text entry, and instead relies on an FEP (front-end processor) to enter text, all calls to the Selection object are ignored.Property summaryProperties inherited from class ObjectEvent summaryMethod summaryMethods inherited from class Object" />
   <page href="00005454.html" title="addListener (Selection.addListener method)" text="addListener (Selection.addListener method)public static addListener(listener:Object) : VoidRegisters an object to receive keyboard focus change notifications. When the focus changes (for example, whenever the Selection.setFocus() method is invoked), all listening objects registered with addListener() have their onSetFocus() method invoked. Multiple objects can listen for focus change notifications. If the specified listener is already registered, no change occurs.Parameterslistener:Object - A new object with an onSetFocus method.ExampleIn the following example, you create two input text fields at runtime, setting the borders for each text field to true. This code creates a new (generic) ActionScript object named focusListener. This object defines for itself an onSetFocus property, to which it assigns a function. The function takes two parameters: a reference to the text field that lost focus, and one to the text field that gained focus. The function sets the border property of the text field that lost focus to false, and sets the border property of the text field that gained focus to true: this.createTextField(&quot;one_txt&quot;, 99, 10, 10, 200, 20this.createTextField(&quot;two_txt&quot;, 100, 10, 50, 200, 20one_txt.border = true;one_txt.type = &quot;input&quot;;two_txt.border = true;two_txt.type = &quot;input&quot;;var focusListener:Object = new Object(focusListener.onSetFocus = function(oldFocus_txt, newFocus_txt) { oldFocus_txt.border = false; newFocus_txt.border = true;};Selection.addListener(focusListenerSee alsosetFocus (Selection.setFocus method)" />
   <page href="00005455.html" title="getFocus (Selection.getFocus method)" text="getFocus (Selection.getFocus method)public static getFocus() : StringReturns a string specifying the target path of the object that has focus. If a TextField object has focus, and the object has an instance name, the getFocus() method returns the target path of the TextField object. Otherwise, it returns the TextFields variable name.If a Button object or button movie clip has focus, the getFocus() method returns the target path of the Button object or button movie clip.If neither a TextField object, Button object, Component instance, nor button movie clip has focus, the getFocus() method returns null.ReturnsString - A string or null.ExampleThe following example creates a text field to output the path of the currently focused object. It then uses an interval function to periodically update the field. To test this, add several button instances to the stage with different instance names, and then add the following ActionScript to your AS or FLA file. this.createTextField(&quot;status_txt&quot;, this.getNextHighestDepth(), 0, 0, 150, 25function FocusUpdate(){ s = Selection.getFocus( if ( s ) { status_txt.text = s; }}setInterval( FocusUpdate, 100 See alsoonSetFocus (Selection.onSetFocus event listener), setFocus (Selection.setFocus method)" />
   <page href="00005456.html" title="onSetFocus (Selection.onSetFocus event listener)" text="onSetFocus (Selection.onSetFocus event listener)onSetFocus = function([oldfocus], [newfocus]) {}Notified when the input focus changes. To use this listener, you must create a listener object. You can then define a function for this listener and use the Selection.addListener() method to register the listener with the Selection object, as in the following code: var someListener:Object = new Object(someListener.onSetFocus = function () { // statements}Selection.addListener(someListenerListeners enable different pieces of code to cooperate because multiple listeners can receive notification about a single event.Parametersoldfocus: [optional] - The object losing focus.newfocus: [optional] - The object receiving focus.ExampleThe following example demonstrates how to determine when input focus changes in a SWF file between several dynamically created text fields. Enter the following ActionScript into a FLA or AS file and then test the document: this.createTextField(&quot;one_txt&quot;, 1, 0, 0, 100, 22this.createTextField(&quot;two_txt&quot;, 2, 0, 25, 100, 22this.createTextField(&quot;three_txt&quot;, 3, 0, 50, 100, 22this.createTextField(&quot;four_txt&quot;, 4, 0, 75, 100, 22for (var i in this) { if (this[i] instanceof TextField) { this[i].border = true; this[i].type = &quot;input&quot;; }}this.createTextField(&quot;status_txt&quot;, this.getNextHighestDepth(), 200, 10, 300, 100status_txt.html = true;status_txt.multiline = true;var someListener:Object = new Object(someListener.onSetFocus = function(oldFocus, newFocus) { status_txt.htmlText = &quot;&lt;b&gt;setFocus triggered&lt;/b&gt;&quot;; status_txt.htmlText += &quot;&lt;textformat tabStops=&#39;[20,80]&#39;&gt;&quot;; status_txt.htmlText += &quot;&amp;nbsp; toldFocus: t&quot;+oldFocus; status_txt.htmlText += &quot;&amp;nbsp; tnewFocus: t&quot;+newFocus; status_txt.htmlText += &quot;&amp;nbsp; tgetFocus: t&quot;+Selection.getFocus( status_txt.htmlText += &quot;&lt;/textformat&gt;&quot;;};Selection.addListener(someListenerSee alsoaddListener (Selection.addListener method), setFocus (Selection.setFocus method)" />
   <page href="00005457.html" title="removeListener (Selection.removeListener method)" text="removeListener (Selection.removeListener method)public static removeListener(listener:Object) : BooleanRemoves an object previously registered with the Selection.addListener() method.Parameterslistener:Object - The object that no longer receives focus notifications.ReturnsBoolean - If the listener object was successfully removed, the method returns a true value. If the listener object was not successfully removed--for example, if listener was not on the Selection object&#39;s listener list--the method returns a value of false.ExampleThe following ActionScript dynamically creates several text field instances. When you select a text field, information appears in the Output panel. When you click the remove_btn instance, the listener is removed and information no longer appears in the Output panel. this.createTextField(&quot;one_txt&quot;, 1, 0, 0, 100, 22this.createTextField(&quot;two_txt&quot;, 2, 0, 25, 100, 22this.createTextField(&quot;three_txt&quot;, 3, 0, 50, 100, 22this.createTextField(&quot;four_txt&quot;, 4, 0, 75, 100, 22for (var i in this) { if (this[i] instanceof TextField) { this[i].border = true; this[i].type = &quot;input&quot;; }}var selectionListener:Object = new Object(selectionListener.onSetFocus = function(oldFocus, newFocus) { trace(&quot;Focus shifted from &quot;+oldFocus+&quot; to &quot;+newFocus};Selection.addListener(selectionListenerremove_btn.onRelease = function() { trace(&quot;removeListener invoked&quot; Selection.removeListener(selectionListener};See alsoaddListener (Selection.addListener method)" />
   <page href="00005458.html" title="setFocus (Selection.setFocus method)" text="setFocus (Selection.setFocus method)public static setFocus(newFocus:Object) : BooleanGives focus to the selectable (editable) text field, button, or movie clip, that the newFocus parameter specifies. You can use dot or slash notation to specify the path. You can also use a relative or absolute path. If you are using ActionScript 2.0, you must use dot notation. If null is passed, the current focus is removed. ParametersnewFocus:Object - An object such as a button, movie clip, or text field instance, or a string specifying the path to a button, movie clip, or text field instance.ReturnsBoolean - A Boolean value; true if the focus attempt is successful, false if it fails.ExampleIn the following example, the text field focuses on the username_txt text field when it is running in a browser window. If the user does not fill in one of the required text fields (username_txt and password_txt), the cursor automatically focuses in the text field thats missing data. For example, if the user does not type anything into the username_txt text field and clicks the submit button, an error message appears and the cursor focuses in the username_txt text field. this.createTextField(&quot;status_txt&quot;, this.getNextHighestDepth(), 100, 70, 100, 22this.createTextField(&quot;username_txt&quot;, this.getNextHighestDepth(), 100, 100, 100, 22this.createTextField(&quot;password_txt&quot;, this.getNextHighestDepth(), 100, 130, 100, 22this.createEmptyMovieClip(&quot;submit_mc&quot;, this.getNextHighestDepth()submit_mc.createTextField(&quot;submit_txt&quot;, this.getNextHighestDepth(), 100, 160, 100, 22submit_mc.submit_txt.autoSize = &quot;center&quot;;submit_mc.submit_txt.text = &quot;Submit&quot;;submit_mc.submit_txt.border = true;submit_mc.onRelease = checkForm;username_txt.border = true;password_txt.border = true;username_txt.type = &quot;input&quot;;password_txt.type = &quot;input&quot;;password_txt.password = true;Selection.setFocus(&quot;username_txt&quot;fscommand(&quot;activateTextField&quot;//function checkForm():Boolean { if (username_txt.text.length == 0) { status_txt.text = &quot;fill in username&quot;; Selection.setFocus(&quot;username_txt&quot; fscommand(&quot;activateTextField&quot; return false; } if (password_txt.text.length == 0) { status_txt.text = &quot;fill in password&quot;; Selection.setFocus(&quot;password_txt&quot; fscommand(&quot;activateTextField&quot; return false; } status_txt.text = &quot;success!&quot;; Selection.setFocus(null return true;}See alsogetFocus (Selection.getFocus method)" />
   <page href="00005459.html" title="setSelection (Selection.setSelection method)" text="setSelection (Selection.setSelection method)public static setSelection(beginIndex:Number, endIndex:Number) : VoidSets the selection span of the currently focused text field. The new selection span begins at the index specified in the beginIndex parameter, and ends at the index specified in the endIndex parameter. Selection span indexes are zero-based (for example, the first position is 0, the second position is 1, and so on). This method has no effect if no text field currently has focus. When you call the setSelection() method and a text control has focus, the selection highlight is drawn only when the text field is being actively edited. The setSelection() method can be invoked after Selection.setFocus() or from within an onSetFocus() event handler, but any selection is visible only following a call to the fscommand activateTextField command.ParametersbeginIndex:Number - The beginning index of the selection span.endIndex:Number - The ending index of the selection span.ExampleThe following ActionScript code creates a text field at runtime and adds a string to it. Then it assigns an event handler for the onSetFocus event that selects all the text in the text field and activates the editing session. Note: If the Selection.setSelection() method is called, the text is not drawn on screen until the text field is activated (following a call to the fscommand activateTextField command).this.createTextField(&quot;myText_txt&quot;, 99, 10, 10, 200, 30myText_txt.type = &quot;input&quot;;myText_txt.text = &quot;this is my text&quot;;myText_txt.onSetFocus = function(){ Selection.setSelection(0,myText_txt.text.length fscommand(&quot;activateTextField&quot;}The following example illustrates how the endIndex parameter is not inclusive. In order to select the first character, you must use an endIndex of 1, not 0. If you change the endIndex parameter to 0, nothing will be selected.this.createTextField(&quot;myText_txt&quot;, 99, 10, 10, 200, 30myText_txt.text = &quot;this is my text&quot;;this.onEnterFrame = function () { Selection.setFocus(&quot;myText_txt&quot; Selection.setSelection(0, 1 delete this.onEnterFrame;}" />
   <page href="00005460.html" title="SharedObject" text="ModifiersPropertyDescriptiondata:ObjectThe collection of attributes assigned to the data property of the object.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)EventDescriptiononStatus = function(infoObject:Object) {}Invoked every time an error, warning, or informational note is posted for a shared object.ModifiersSignatureDescriptionstaticaddListener(objectName:String, notifyFunction:Function) : VoidCreates an event listener that the Flash Lite player invokes when the player has loaded the shared object data from the device.clear() : VoidPurges all the data from the shared object and deletes the shared object from the disk.flush(minDiskSpace:Number) : ObjectWrites shared object to a local, persistent file.staticgetLocal(name:String) : SharedObjectReturns a reference to a locally persistent shared object that is available only to the current client.staticgetMaxSize() : NumberReturns the total number of bytes the SWF file can use to store mobile shared objects on the device.getSize() : NumberGets the current size of the shared object, in bytes.staticremoveListener(objectName:String)Removes any listeners that were added using the addListener() method.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)SharedObjectObject | +-SharedObjectpublic dynamic class SharedObjectextends ObjectThe Flash Lite version of the SharedObject class allows Flash SWF files to save data to the device when it is closed and load that data from the device when it is played again. Flash Lite shared objects store a set of name-value pairs to the device. Note: The name &quot;SharedObject&quot; is derived from the Flash SharedObject class. The Flash version of this class allows multiple Flash SWF files to share their saved data. However, the Flash Lite version of the SharedObject class does not support sharing data between different Flash SWF files.In Flash Lite, a SWF file is considered to be a different version if it was modified from the original version, even if it has the same name. This is different than in Flash Player, where a SWF file is considered to be the same if its URL and name are the same, even if the SWF file was modified. In Flash Lite, two different versions of a SWF file can&#39;t access each other&#39;s shared objects.To maintain consistency with the Flash platform, the same ActionScript construct and calling conventions are used for the Flash Lite player.The following examples describe the potential of using shared objects:A Flash application can be used as a user interface for a service that enables the user to search used car listings. The application connects to a server that provides listings of cars based on the search terms and preferences that the user enters. The Flash application can save the last search the user made and prefill the forms the next time the SWF file is played. To do this, you create a SharedObject instance that stores search parameters each time the user makes a new search. When the SWF file closes, the player saves the data in the shared object to the device. The next time the SWF file plays, the Flash Lite player loads the shared object and prefills the search form with the same search data the user entered the previous time.A Flash application can be used as a user interface for a service that allows users to search for music reviews. The application lets users store information about their favorite albums. The information can be stored on the remote server, but this causes problems if the application cannot connect to the service. Also, retrieving the data from a remote service can be slow and detract from the user experience. Shared objects enable the application to store information about the albums to the device and load it quickly when needed.Note: Because space is limited on mobile devices, the data is not completely persistent; in some situations, the platform could delete the oldest data from the device.To create a local shared object, use the following syntax:var so:shared object = shared object.getLocal(&quot;mySharedObject&quot;Reading and writing data on a handset can be slow. To ensure that data is immediately available when the application requests it from the device, Flash Lite 2.0 requires you to set up a listener. The player invokes the listener when the device has loaded the shared object&#39;s data. Methods that access the SharedObject instance returned by the call to getLocal() should wait until the listener is invoked before attempting any operations. ExampleIn the following example, a SWF file creates a listener function named Prefs and then creates a shared object. The player calls the loadCompletePrefs function when the data is available. function loadCompletePrefs (mySO:SharedObject) { if (0 == mySO.getSize() ) {  // If the size is 0, we need to initialize the data:  mySO.data.name = &quot;Sigismund&quot;; mySO.data.email = &quot;siggy@macromedia.com&quot;; } else {  // Trace all the data in mySO: trace( &quot;Prefs:&quot;  for (var idx in mySO.data) { trace( &quot; &quot; + idx +&quot;: &quot; + mySO.data[idx]  }  }}SharedObject.addListener( &quot;Prefs&quot;, loadCompletePrefs // We can now create the shared object:var Prefs:SharedObject = SharedObject.getLocal(&quot;Prefs&quot; When the player has notified the listener that the data is available, the application can use the shared object returned from the call to the getLocal() method in the same way a shared object is used in Flash. The application can add, modify, or remove properties while the content is playing. When the content is unloaded, the shared object might be written to the device; however, to guarantee that the shared object will be written to the device, the application must force a write operation by calling the flush() method. Flash Lite shared objects are available only to locally stored SWF files. SWF files playing back in a network-enabled browser cannot use Flash Lite shared objects.The total amount of storage for Flash Lite shared objects per SWF file is limited by the deviceto a predetermined size. You can determine this size by using the SharedObject.getMaxSize() method.Note: Remote shared objects are not supported in Flash Lite 2.0.See alsoflush (SharedObject.flush method), onStatus (SharedObject.onStatus handler)Property summaryProperties inherited from class ObjectEvent summaryMethod summaryMethods inherited from class Object" />
   <page href="00005461.html" title="addListener (SharedObject.addListener method)" text="addListener (SharedObject.addListener method)public static addListener(objectName:String, notifyFunction:Function) : VoidCreates an event listener that the Flash Lite player invokes when the player has loaded the shared object data from the device. Methods that access the SharedObject instance that the call returns to the getLocal() method should wait until this function is invoked before attempting any operations.ParametersobjectName:String - A string that represents the name of the shared object.notifyFunction:Function - The name of a function the player calls to notify the application that the getLocal() method has executed and the data is finished loading." />
   <page href="00005462.html" title="clear (SharedObject.clear method)" text="clear (SharedObject.clear method)public clear() : VoidPurges all the data from the shared object and deletes the shared object from the disk. The reference to my_so is still active, and my_so is now empty.ExampleThe following example sets data in the shared object, and then empties all of the data from the shared object: var my_so:SharedObject = SharedObject.getLocal(&quot;superfoo&quot;my_so.data.name = &quot;Hector&quot;;trace(&quot;before my_so.clear():&quot;for (var prop in my_so.data) { trace(&quot; t&quot;+prop}trace(&quot;&quot;my_so.clear(trace(&quot;after my_so.clear():&quot;for (var prop in my_so.data) { trace(&quot; t&quot;+prop}This ActionScript displays the following message in the Output panel:before my_so.clear(): nameafter my_so.clear():" />
   <page href="00005463.html" title="data (SharedObject.data property)" text="data (SharedObject.data property)public data : ObjectThe collection of attributes assigned to the data property of the object. Each attribute can be an object of any basic ActionScript or JavaScript type--Array, Number, Boolean, and so on. For example, the following lines assign values to various aspects of a shared object. Note: For Flash Lite, if the shared object listener has not been invoked, the data property could contain undefined values. For details, see the description of the addListener() method. var items_array:Array = new Array(101, 346, 483var currentUserIsAdmin:Boolean = true;var currentUserName:String = &quot;Ramona&quot;;var my_so:SharedObject = SharedObject.getLocal(&quot;superfoo&quot;my_so.data.itemNumbers = items_array;my_so.data.adminPrivileges = currentUserIsAdmin;my_so.data.userName = currentUserName;for (var prop in my_so.data) { trace(prop+&quot;: &quot;+my_so.data[prop]}soResult = &quot;&quot;;for (var prop in my_so.data) { soResult += prop+&quot;: &quot;+my_so.data[prop] +&quot; n&quot;;}result.text = soResult;All attributes of a shared object&#39;s data property are saved if the object is persistent and the shared object contains the following information:userName: RamonaadminPrivileges: trueitemNumbers: 101,346,483Note: Do not assign values directly to the data property of a shared object (for example, so.data = someValue). Flash ignores these assignments.To delete attributes for local shared objects, use code such as delete so.data.attributeName; setting an attribute to null or undefined for a local shared object does not delete the attribute.To create private values for a shared object--values that are available only to the client instance while the object is in use and are not stored with the object when it is closed--create properties that are not named data to store them, as shown in the following example:var my_so:SharedObject = SharedObject.getLocal(&quot;superfoo&quot;my_so.favoriteColor = &quot;blue&quot;;my_so.favoriteNightClub = &quot;The Bluenote Tavern&quot;;my_so.favoriteSong = &quot;My World is Blue&quot;;for (var prop in my_so) { trace(prop+&quot;: &quot;+my_so[prop]}The shared object contains the following data:favoriteSong: My World is BluefavoriteNightClub: The Bluenote TavernfavoriteColor: bluedata: [object Object]ExampleThe following example saves text to a shared object named my_so (for the complete example, see SharedObject.getLocal()): var my_so:SharedObject = SharedObject.getLocal(&quot;savedText&quot; // myText is an input text field and inputText is a dynamic text field.myText.text = my_so.data.myTextSaved;// Assign an empty string to myText_ti if the shared object is undefined// to prevent the text input box from displaying &quot;undefined&quot; when// this script is first run.if (myText.text == &quot;undefined&quot;) { myText.text = &quot;&quot;;}changedListener = new Object(changedListener.onChanged = function (changedField) { my_so.data.myTextSaved = changedField.text; inputText.text = &quot;&quot;; inputText.text = my_so.data.myTextSaved;}myText.addListener(changedListener" />
   <page href="00005464.html" title="flush (SharedObject.flush method)" text="flush (SharedObject.flush method)public flush(minDiskSpace:Number) : ObjectWrites shared object to a local, persistent file. To guarantee that the shared object will be written to the device, the application must force a write operation by calling the flush() method. Unlike in Flash Player, the write operation is asynchronous and the result is not immediately available.ParametersminDiskSpace:Number - An integer specifying the number of bytes that must be allotted for this object. The default value is 0.ReturnsObject - A Boolean value, true or false; or a string value of &quot;pending&quot;. The flush() method returns pending for most requests, with the following exceptions: If there is no need to write data (that is, the data has already been written), flush() returns true. If the minimumDiskSpace parameter exceeds the maximum space available for a SWF file, or the remaining space available for a SWF file, or if there was an error processing the request, flush() returns false.If the flush() method returns pending, the Flash Lite player can show a dialog box asking the user to free up space to increase the amount of disk space available to shared objects. To allow space for the shared object to expand when it is saved in the future, which avoids return values of pending , you can pass a value for minimumDiskSpace. When the Flash Lite player tries to write the file, it searches for the number of bytes passed to minimumDiskSpace, instead of searching for enough space to save the shared object at its current size. ExampleThe following example handles the possible return values for the flush() method: so_big = SharedObject.getLocal(&quot;large&quot;so_big.data.name = &quot;This is a long string of text.&quot;;so_big.flush(var flushResult = so_big.flush(switch (flushResult) {case &#39;pending&#39; : result.text += &quot;pending&quot;; break;case true : result.text += &quot;Data was flushed.&quot;; break;case false : result.text += &quot;Test failed. Data was not flushed.&quot;; break;}See alsoclear (SharedObject.clear method), onStatus (SharedObject.onStatus handler)" />
   <page href="00005465.html" title="getLocal (SharedObject.getLocal method)" text="getLocal (SharedObject.getLocal method)public static getLocal(name:String) : SharedObjectReturns a reference to a locally persistent shared object that is available only to the current client. If the shared object does not already exist, getLocal() creates one. This method is a static method of the SharedObject class. Note: In Flash Lite, a shared object cannot be shared between two SWF files.To assign the object to a variable, use syntax like the followingvar so:SharedObject = SharedObject.getLocal(&quot;savedData&quot;)Because the data may not be immediately available for reading on the device, the application must create and register a listener for the shared object identified by name. For details, see the description of the addListener() method.Parametersname:String - A string that represents the name of the object. The name can include forward slashes (/ for example, work/addresses is a valid name. Spaces are not allowed in a shared object name, nor are the following characters:  ~ % &amp; ; : &quot; &#39; , &lt; &gt; ? # ReturnsSharedObject - A reference to a shared object that is persistent locally and is available only to the current client. If Flash can&#39;t create or find the shared object, getLocal() returns null. This method fails and returns null if persistent shared object creation and storage by third-party Flash content is prohibited by the device.ExampleThe following example saves the last frame that a user entered to a local shared object named kookie: // Get the kookievar my_so:SharedObject = SharedObject.getLocal(&quot;kookie&quot;// Get the user of the kookie and go to the frame number saved for this user.if (my_so.data.user != undefined) { this.user = my_so.data.user; this.gotoAndStop(my_so.data.frame}The following code block is placed on each SWF file frame:// On each frame, call the rememberme function to save the frame number.function rememberme() { my_so.data.frame=this._currentframe; my_so.data.user=&quot;John&quot;;}" />
   <page href="00005466.html" title="getMaxSize (SharedObject.getMaxSize method)" text="getMaxSize (SharedObject.getMaxSize method)public static getMaxSize() : NumberReturns the total number of bytes the SWF file can use to store mobile shared objects on the device. For example, if this method returns 1K, the movie can save one shared object of 1K, or multiple smaller shared objects, as long as their combined size does not exceed 1K. This method is a static method of the SharedObject class.ReturnsNumber - A numeric value that specifies the total number of bytes the movie is allowed to store on the device. This is also the size available to all content that is loaded dynamically through loadMovie().ExampleThe following example checks whether more than 1KB of storage is reserved before creating a Flash Lite shared object. if (SharedObject.getMaxSize() &gt; 1024) { var my_so:SharedObject = SharedObject.getLocal(&quot;sharedObject1&quot;} else { trace(&quot;SharedObject&#39;s maximum size is less than 1 KB.&quot;}" />
   <page href="00005467.html" title="getSize (SharedObject.getSize method)" text="getSize (SharedObject.getSize method)public getSize() : NumberGets the current size of the shared object, in bytes. Flash calculates the size of a shared object by stepping through all of its data properties; the more data properties the object has, the longer it takes to estimate its size. Estimating object size can take significant processing time, so you may want to avoid using this method unless you have a specific need for it.If the shared object listener has not yet been called, getSize() returns 0. For details about using the listener, see the addListener() method.ReturnsNumber - A numeric value specifying the size of the shared object, in bytes.ExampleThe following example gets the size of the shared object my_so: var items_array:Array = new Array(101, 346, 483var currentUserIsAdmin:Boolean = true;var currentUserName:String = &quot;Ramona&quot;;var my_so:SharedObject = SharedObject.getLocal(&quot;superfoo&quot;my_so.data.itemNumbers = items_array;my_so.data.adminPrivileges = currentUserIsAdmin;my_so.data.userName = currentUserName;var soSize:Number = my_so.getSize(trace(soSize" />
   <page href="00005468.html" title="onStatus (SharedObject.onStatus handler)" text="Code propertyLevel propertyMeaningSharedObject.Flush.FailedErrorSharedObject.flush() method that returned &quot;pending&quot; has failed (the user did not allot additional disk space for the shared object when Flash Player showed the Local Storage Settings dialog box).SharedObject.Flush.SuccessStatusSharedObject.flush() method that returned &quot;pending&quot; was successfully completed (the user allotted additional disk space for the shared object).onStatus (SharedObject.onStatus handler)onStatus = function(infoObject:Object) {}Invoked every time an error, warning, or informational note is posted for a shared object. To respond to this event handler, you must create a function to process the information object that is generated by the shared object. The information object has a code property that contsins a string that describes the result of the onStatus handler, and a level property that contains a string that is either &quot;Status&quot; or &quot;Error&quot;.In addition to this handler, Flash Lite also provides a super function called System.onStatus. If onStatus is invoked for a particular object and no function is assigned to respond to it, Flash Lite processes a function assigned to System.onStatus, if it exists.The following events notify you when certain SharedObject activities occur:ParametersinfoObject:Object - A parameter defined according to the status message.ExampleThe following example displays different messages based on whether the user chooses to allow or deny the SharedObject instance to write to the disk. this.createTextField(&quot;message_txt&quot;, this.getNextHighestDepth(), 0, 30, 120, 50this.message_txt.wordWrap = true;this.createTextField(&quot;status_txt&quot;, this.getNextHighestDepth(), 0, 90, 120, 100this.status_txt.wordWrap = true;var items_array:Array = new Array(101, 346, 483var currentUserIsAdmin:Boolean = true;var currentUserName:String = &quot;Ramona&quot;;var my_so:SharedObject = SharedObject.getLocal(&quot;superfoo&quot;my_so.data.itemNumbers = items_array;my_so.data.adminPrivileges = currentUserIsAdmin;my_so.data.userName = currentUserName;my_so.onStatus = function(infoObject:Object) { for (var i in infoObject) { status_txt.text += i+&quot;-&quot;+infoObject[i] +&quot; n&quot;; }};var flushResult = my_so.flush(1000001switch (flushResult) { case &#39;pending&#39; : message_txt.text = &quot;flush is pending, waiting on user interaction.&quot;; break; case true : message_txt.text = &quot;flush was successful. Requested storage space approved.&quot;; break; case false : message_txt.text = &quot;flush failed. User denied request for additional storage.&quot;; break;}See alsoonStatus (System.onStatus handler)" />
   <page href="00005469.html" title="removeListener (SharedObject.removeListener method)" text="removeListener (SharedObject.removeListener method)public static removeListener(objectName:String)Removes any listeners that were added using the addListener() method.ParametersobjectName:String - A string that represents the name of the shared object.Returns" />
   <page href="00005470.html" title="Sound" text="ModifiersPropertyDescriptionduration:Number [read-only]The duration of a sound, in milliseconds.id3:Object [read-only]Provides access to the metadata that is part of an MP3 file.position:Number [read-only]The number of milliseconds a sound has been playing.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)EventDescriptiononID3 = function() {}Invoked each time new ID3 data is available for an MP3 file that you load using Sound.attachSound() or Sound.loadSound().onLoad = function(success:Boolean) {}Invoked automatically when a sound loads.onSoundComplete = function() {}Invoked automatically when a sound finishes playing.SignatureDescriptionSound([target:Object])Creates a new Sound object for a specified movie clip.ModifiersSignatureDescriptionattachSound(id:String) : VoidAttaches the sound specified in the id parameter to the specified Sound object.getBytesLoaded() : NumberReturns the number of bytes loaded (streamed) for the specified Sound object.getBytesTotal() : NumberReturns the size, in bytes, of the specified Sound object.getPan() : NumberReturns the pan level set in the last setPan() call as an integer from -100 (left) to +100 (right).getTransform() : ObjectReturns the sound transform information for the specified Sound object set with the last Sound.setTransform() call.getVolume() : NumberReturns the sound volume level as an integer from 0 to 100, where 0 is off and 100 is full volume.loadSound(url:String, isStreaming:Boolean) : VoidLoads an MP3 file into a Sound object.setPan(value:Number) : VoidDetermines how the sound is played in the left and right channels (speakers).setTransform(transformObject:Object) : VoidSets the sound transform (or balance) information, for a Sound object.setVolume(value:Number) : VoidSets the volume for the Sound object.start([secondOffset:Number], [loops:Number]) : VoidStarts playing the last attached sound from the beginning if no parameter is specified, or starting at the point in the sound specified by the secondOffset parameter.stop([linkageID:String]) : VoidStops all sounds currently playing if no parameter is specified, or just the sound specified in the idName parameter.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)SoundObject | +-Soundpublic class Soundextends ObjectThe Sound class lets you control sound in a movie. You can add sounds to a movie clip from the library while the movie is playing and control those sounds. If you do not specify a target when you create a new Sound object, you can use the methods to control sound for the whole movie. You must use the constructor new Sound to create a Sound object before calling the methods of the Sound class.Property summaryProperties inherited from class ObjectEvent summaryConstructor summaryMethod summaryMethods inherited from class Object" />
   <page href="00005471.html" title="attachSound (Sound.attachSound method)" text="attachSound (Sound.attachSound method)public attachSound(id:String) : VoidAttaches the sound specified in the id parameter to the specified Sound object. The sound must be in the library of the current SWF file and specified for export in the Linkage Properties dialog box. You must call Sound.start() to start playing the sound. To make sure that the sound can be controlled from any scene in the SWF file, place the sound on the main Timeline of the SWF file. Parametersid:String - The identifier of an exported sound in the library. The identifier is located in the Linkage Properties dialog box.ExampleThe following example attaches the sound logoff_id to my_sound. A sound in the library has the linkage identifier logoff_id. var my_sound:Sound = new Sound(my_sound.attachSound(&quot;logoff_id&quot;my_sound.start(" />
   <page href="00005472.html" title="duration (Sound.duration property)" text="duration (Sound.duration property)public duration : Number [read-only]The duration of a sound, in milliseconds. Note: Flash Lite 2.0 supports this property for native Flash sound only. The sound formats that are specific to a host device are not supported.ExampleThe following example loads a sound and displays the duration of the sound file in the Output panel. Add the following ActionScript to your FLA or AS file. var my_sound:Sound = new Sound(my_sound.onLoad = function(success:Boolean) { var totalSeconds:Number = this.duration/1000; trace(this.duration+&quot; ms (&quot;+Math.round(totalSeconds)+&quot; seconds)&quot; var minutes:Number = Math.floor(totalSeconds/60 var seconds = Math.floor(totalSeconds)%60; if (seconds&lt;10) { seconds = &quot;0&quot;+seconds; } trace(minutes+&quot;:&quot;+seconds};my_sound.loadSound(&quot;song1.mp3&quot;, trueThe following example loads several songs into a SWF file. A progress bar, created using the Drawing API, displays the loading progress. When the music starts and completes loading, information displays in the Output panel. When the music starts and completes loading, information writes to the log file. Add the following ActionScript to your FLA or AS file.var pb_height:Number = 10;var pb_width:Number = 100;var pb:MovieClip = this.createEmptyMovieClip(&quot;progressBar_mc&quot;, this.getNextHighestDepth()pb.createEmptyMovieClip(&quot;bar_mc&quot;, pb.getNextHighestDepth()pb.createEmptyMovieClip(&quot;vBar_mc&quot;, pb.getNextHighestDepth()pb.createEmptyMovieClip(&quot;stroke_mc&quot;, pb.getNextHighestDepth()pb.createTextField(&quot;pos_txt&quot;, pb.getNextHighestDepth(), 0, pb_height, pb_width, 22pb._x = 100;pb._y = 100;with (pb.bar_mc) { beginFill(0x00FF00 moveTo(0, 0 lineTo(pb_width, 0 lineTo(pb_width, pb_height lineTo(0, pb_height lineTo(0, 0 endFill( _xscale = 0;}with (pb.vBar_mc) { lineStyle(1, 0x000000 moveTo(0, 0 lineTo(0, pb_height}with (pb.stroke_mc) { lineStyle(3, 0x000000 moveTo(0, 0 lineTo(pb_width, 0 lineTo(pb_width, pb_height lineTo(0, pb_height lineTo(0, 0}var my_interval:Number;var my_sound:Sound = new Sound(my_sound.onLoad = function(success:Boolean) { if (success) { trace(&quot;sound loaded&quot; }};my_sound.onSoundComplete = function() { clearInterval(my_interval trace(&quot;Cleared interval&quot;}my_sound.loadSound(&quot;song3.mp3&quot;, truemy_interval = setInterval(updateProgressBar, 100, my_soundfunction updateProgressBar(the_sound:Sound):Void { var pos:Number = Math.round(the_sound.position/the_sound.duration 100 pb.bar_mc._xscale = pos; pb.vBar_mc._x = pb.bar_mc._width; pb.pos_txt.text = pos+&quot;%&quot;;}See alsoposition (Sound.position property)" />
   <page href="00005473.html" title="getBytesLoaded (Sound.getBytesLoaded method)" text="getBytesLoaded (Sound.getBytesLoaded method)public getBytesLoaded() : NumberReturns the number of bytes loaded (streamed) for the specified Sound object. You can compare the value of getBytesLoaded() with the value of getBytesTotal() to determine what percentage of a sound has loaded.ReturnsNumber - An integer indicating the number of bytes loaded.ExampleThe following example dynamically creates two text fields that display the bytes that are loaded and the total number of bytes for a sound file that loads into the SWF file. A text field also displays a message when the file finishes loading. Add the following ActionScript to your FLA or AS file: this.createTextField(&quot;message_txt&quot;, this.getNextHighestDepth(), 10,10,300,22)this.createTextField(&quot;status_txt&quot;, this.getNextHighestDepth(), 10, 50, 300, 40status_txt.autoSize = true;status_txt.multiline = true;status_txt.border = false;var my_sound:Sound = new Sound(my_sound.onLoad = function(success:Boolean) { if (success) { this.start( message_txt.text = &quot;Finished loading&quot;; }};my_sound.onSoundComplete = function() { message_txt.text = &quot;Clearing interval&quot;; clearInterval(my_interval};my_sound.loadSound(&quot;song2.mp3&quot;, truevar my_interval:Number;my_interval = setInterval(checkProgress, 100, my_soundfunction checkProgress(the_sound:Sound):Void { var pct:Number = Math.round(the_sound.getBytesLoaded()/the_sound.getBytesTotal() 100 var pos:Number = Math.round(the_sound.position/the_sound.duration 100 status_txt.text = the_sound.getBytesLoaded()+&quot; of &quot;+the_sound.getBytesTotal()+&quot; bytes (&quot;+pct+&quot;%)&quot;+newline; status_txt.text += the_sound.position+&quot; of &quot;+the_sound.duration+&quot; milliseconds (&quot;+pos+&quot;%)&quot;+newline;}See alsogetBytesTotal (Sound.getBytesTotal method)" />
   <page href="00005474.html" title="getBytesTotal (Sound.getBytesTotal method)" text="getBytesTotal (Sound.getBytesTotal method)public getBytesTotal() : NumberReturns the size, in bytes, of the specified Sound object.ReturnsNumber - An integer indicating the total size, in bytes, of the specified Sound object.ExampleFor a sample usage of this method, see Sound.getBytesLoaded().See alsogetBytesLoaded (Sound.getBytesLoaded method)" />
   <page href="00005475.html" title="getPan (Sound.getPan method)" text="getPan (Sound.getPan method)public getPan() : NumberReturns the pan level set in the last setPan() call as an integer from -100 (left) to +100 (right). (0 sets the left and right channels equally.) The pan setting controls the left-right balance of the current and future sounds in a SWF file. This method is cumulative with setVolume() or setTransform().Note: Flash Lite 2.0 supports this method for native Flash sound only. The sound formats that are specific to a host device are not supported.ReturnsNumber - An integer.ExampleThe following example creates a text field to display the value of the pan level for native Flash sound. The linkage identifier for the sound is &quot;combo&quot;. Add the following ActionScript to your FLA or AS file: this.createTextField(&quot;pan_txt&quot;, 1, 0, 100, 100, 100mix=new Sound(mix.attachSound(&quot;combo&quot;mix.start(mix.setPan(-100pan_txt.text = mix.getPan(thisYou can use the following example to start the device sound. Because Flash Lite does not support streaming sound, it is a good practice to load the sound before playing it.var my_sound:Sound = new Sound( my_sound.onLoad = function(success) { if (success) { my_sound.start( } else { output.text = &quot;loading failure&quot;; } }; my_sound.loadSound(&quot;song1.mp3&quot;,falseSee alsosetPan (Sound.setPan method)" />
   <page href="00005476.html" title="getTransform (Sound.getTransform method)" text="getTransform (Sound.getTransform method)public getTransform() : ObjectReturns the sound transform information for the specified Sound object set with the last Sound.setTransform() call. Note: Flash Lite 2.0 supports this method for native Flash sound only. The sound formats that are specific to a host device are not supported.ReturnsObject - An object with properties that contain the channel percentage values for the specified sound object.ExampleThe following example attaches four movie clips from a symbol in the library (linkage identifier: knob_id) that are used as sliders (or knobs) to control the sound file that loads into the SWF file. These sliders control the transform object, or balance, of the sound file. For more information, see the entry for Sound.setTransform(). Add the following ActionScript to your FLA or AS file: var my_sound:Sound = new Sound(my_sound.loadSound(&quot;song1.mp3&quot;, truevar transform_obj:Object = my_sound.getTransform(this.createEmptyMovieClip(&quot;transform_mc&quot;, this.getNextHighestDepth()transform_mc.createTextField(&quot;transform_txt&quot;, transform_mc.getNextHighestDepth, 0, 8, 120, 22transform_mc.transform_txt.html = true;var knob_ll:MovieClip = transform_mc.attachMovie(&quot;knob_id&quot;, &quot;ll_mc&quot;, transform_mc.getNextHighestDepth(), {_x:0, _y:30}var knob_lr:MovieClip = transform_mc.attachMovie(&quot;knob_id&quot;, &quot;lr_mc&quot;, transform_mc.getNextHighestDepth(), {_x:30, _y:30}var knob_rl:MovieClip = transform_mc.attachMovie(&quot;knob_id&quot;, &quot;rl_mc&quot;, transform_mc.getNextHighestDepth(), {_x:60, _y:30}var knob_rr:MovieClip = transform_mc.attachMovie(&quot;knob_id&quot;, &quot;rr_mc&quot;, transform_mc.getNextHighestDepth(), {_x:90, _y:30}knob_ll.top = knob_ll._y;knob_ll.bottom = knob_ll._y+100;knob_ll.left = knob_ll._x;knob_ll.right = knob_ll._x;knob_ll._y = knob_ll._y+(100-transform_obj[&#39;ll&#39;]knob_ll.onPress = pressKnob;knob_ll.onRelease = releaseKnob;knob_ll.onReleaseOutside = releaseKnob;knob_lr.top = knob_lr._y;knob_lr.bottom = knob_lr._y+100;knob_lr.left = knob_lr._x;knob_lr.right = knob_lr._x;knob_lr._y = knob_lr._y+(100-transform_obj[&#39;lr&#39;]knob_lr.onPress = pressKnob;knob_lr.onRelease = releaseKnob;knob_lr.onReleaseOutside = releaseKnob;knob_rl.top = knob_rl._y;knob_rl.bottom = knob_rl._y+100;knob_rl.left = knob_rl._x;knob_rl.right = knob_rl._x;knob_rl._y = knob_rl._y+(100-transform_obj[&#39;rl&#39;]knob_rl.onPress = pressKnob;knob_rl.onRelease = releaseKnob;knob_rl.onReleaseOutside = releaseKnob;knob_rr.top = knob_rr._y;knob_rr.bottom = knob_rr._y+100;knob_rr.left = knob_rr._x;knob_rr.right = knob_rr._x;knob_rr._y = knob_rr._y+(100-transform_obj[&#39;rr&#39;]knob_rr.onPress = pressKnob;knob_rr.onRelease = releaseKnob;knob_rr.onReleaseOutside = releaseKnob;updateTransformTxt(function pressKnob() { this.startDrag(false, this.left, this.top, this.right, this.bottom}function releaseKnob() { this.stopDrag( updateTransformTxt(}function updateTransformTxt() { var ll_num:Number = 30+100-knob_ll._y; var lr_num:Number = 30+100-knob_lr._y; var rl_num:Number = 30+100-knob_rl._y; var rr_num:Number = 30+100-knob_rr._y; my_sound.setTransform({ll:ll_num, lr:lr_num, rl:rl_num, rr:rr_num} transform_mc.transform_txt.htmlText = &quot;&lt;textformat tabStops=&#39;[0,30,60,90]&#39;&gt;&quot;; transform_mc.transform_txt.htmlText += ll_num+&quot; t&quot;+lr_num+&quot; t&quot;+rl_num+&quot; t&quot;+rr_num; transform_mc.transform_txt.htmlText += &quot;&lt;/textformat&gt;&quot;;}See alsosetTransform (Sound.setTransform method)" />
   <page href="00005477.html" title="getVolume (Sound.getVolume method)" text="getVolume (Sound.getVolume method)public getVolume() : NumberReturns the sound volume level as an integer from 0 to 100, where 0 is off and 100 is full volume. The default setting is 100.ReturnsNumber - An integer.ExampleThe following example creates a slider using the Drawing API and a movie clip that is created at runtime. A dynamically created text field displays the current volume level of the sound playing in the SWF file. Add the following ActionScript to your ActionScript or FLA file: var my_sound:Sound = new Sound(my_sound.loadSound(&quot;song3.mp3&quot;, truethis.createEmptyMovieClip(&quot;knob_mc&quot;, this.getNextHighestDepth()knob_mc.left = knob_mc._x;knob_mc.right = knob_mc.left+100;knob_mc.top = knob_mc._y;knob_mc.bottom = knob_mc._y;knob_mc._x = my_sound.getVolume(with (knob_mc) { lineStyle(0, 0x000000 beginFill(0xCCCCCC moveTo(0, 0 lineTo(4, 0 lineTo(4, 18 lineTo(0, 18 lineTo(0, 0 endFill(}knob_mc.createTextField(&quot;volume_txt&quot;, knob_mc.getNextHighestDepth(), knob_mc._width+4, 0, 30, 22knob_mc.volume_txt.text = my_sound.getVolume(knob_mc.onPress = function() { this.startDrag(false, this.left, this.top, this.right, this.bottom this.isDragging = true;};knob_mc.onMouseMove = function() { if (this.isDragging) { this.volume_txt.text = this._x; }}knob_mc.onRelease = function() { this.stopDrag( this.isDragging = false; my_sound.setVolume(this._x };See alsosetVolume (Sound.setVolume method)" />
   <page href="00005478.html" title="id3 (Sound.id3 property)" text="PropertyDescriptionTFLTFile typeTIMETimeTIT1Content group descriptionTIT2Title/song name/content descriptionTIT3Subtitle/description refinementTKEYInitial keyTLANLanguagesTLENLengthTMEDMedia typeTOALOriginal album/movie/show titleTOFNOriginal filenameTOLYOriginal lyricists/text writersTOPEOriginal artists/performersTORYOriginal release yearTOWNFile owner/licenseeTPE1Lead performers/soloistsTPE2Band/orchestra/accompanimentTPE3Conductor/performer refinementTPE4Interpreted, remixed, or otherwise modified byTPOSPart of a setTPUBPublisherTRCKTrack number/position in setTRDARecording datesTRSNInternet radio station nameTRSOInternet radio station ownerTSIZSizeTSRCISRC (international standard recording code)TSSESoftware/hardware and settings used for encodingTYERYearWXXXURL link frameID3 2.0 tagCorresponding ID3 1.0 propertyCOMMSound.id3.commentTALBSound.id3.album TCONSound.id3.genreTIT2Sound.id3.songname TPE1Sound.id3.artistTRCKSound.id3.track TYERSound.id3.year id3 (Sound.id3 property)public id3 : Object [read-only]Provides access to the metadata that is part of an MP3 file. MP3 sound files can contain ID3 tags, which provide metadata about the file. If an MP3 sound that you load using Sound.attachSound() or Sound.loadSound() contains ID3 tags, you can query these properties. Only ID3 tags that use the UTF-8 character set are supported.Flash Player 6 (6.0.40.0) and later use the Sound.id3 property to support ID3 1.0 and ID3 1.1 tags. Flash Player 7 adds support for ID3 2.0 tags, specifically 2.3 and 2.4. The following table lists the standard ID3 2.0 tags and the type of content the tags represent; you query them in the format my_sound.id3.COMM, my_sound.id3.TIME, and so on. MP3 files can contain tags other than those in this table; Sound.id3 provides access to those tags as well.Flash Player 6 supported several ID31.0 tags. If these tags are in not in the MP3 file, but corresponding ID3 2.0 tags are, the ID3 2.0 tags are copied into the ID3 1.0 properties, as shown in the following table. This process provides backward compatibility with scripts that you may have written already that read ID3 1.0 properties.ExampleThe following example traces the ID3 properties of song.mp3 to the Output panel: var my_sound:Sound = new Sound(my_sound.onID3 = function(){ for( var prop in my_sound.id3 ){ trace( prop + &quot; : &quot;+ my_sound.id3[prop]  }}my_sound.loadSound(&quot;song.mp3&quot;, falseSee alsoattachSound (Sound.attachSound method), loadSound (Sound.loadSound method)" />
   <page href="00005479.html" title="loadSound (Sound.loadSound method)" text="loadSound (Sound.loadSound method)public loadSound(url:String, isStreaming:Boolean) : VoidLoads an MP3 file into a Sound object. You can use the isStreaming parameter to indicate whether the sound is an event or a streaming sound. Event sounds are completely loaded before they play. They are managed by the ActionScript Sound class and respond to all methods and properties of this class.Streaming sounds play while they are downloading. Playback begins when sufficient data is received to start the decompressor. All MP3s (event or streaming) loaded with this method are saved in the browser&#39;s file cache on the user&#39;s system.Note: For Flash Lite 2.0, you can ignore the isStreaming parameter because Flash Lite 2.0 treats every sound as an event sound.Parametersurl:String - The location on a server of an MP3 sound file.isStreaming:Boolean - A Boolean value that indicates whether the sound is a streaming sound (true) or an event sound (false).ExampleThe following example loads an event sound, which cannot play until it is fully loaded: var my_sound:Sound = new Sound(my_sound.loadSound(&quot;song1.mp3&quot;, falseThe following example loads a streaming sound:var my_sound:Sound = new Sound(my_sound.loadSound(&quot;song1.mp3&quot;, trueSee alsoonLoad (Sound.onLoad handler)" />
   <page href="00005480.html" title="onID3 (Sound.onID3 handler)" text="onID3 (Sound.onID3 handler)onID3 = function() {}Invoked each time new ID3 data is available for an MP3 file that you load using Sound.attachSound() or Sound.loadSound(). This handler provides access to ID3 data without polling. If both ID3 1.0 and ID3 2.0 tags are present in a file, this handler is called twice.ExampleThe following example displays the ID3 properties of song1.mp3 to an instance of the DataGrid component. Add a DataGrid with the instance name id3_dg to your document, and add the following ActionScript to your FLA or AS file: import mx.controls.gridclasses.DataGridColumn;var id3_dg:mx.controls.DataGrid;id3_dg.move(0, 0id3_dg.setSize(Stage.width, Stage.heightvar property_dgc:DataGridColumn = id3_dg.addColumn(new DataGridColumn(&quot;property&quot;)property_dgc.width = 100;property_dgc.headerText = &quot;ID3 Property&quot;;var value_dgc:DataGridColumn = id3_dg.addColumn(new DataGridColumn(&quot;value&quot;)value_dgc.width = id3_dg._width-property_dgc.width;value_dgc.headerText = &quot;ID3 Value&quot;;var my_sound:Sound = new Sound(my_sound.onID3 = function() {trace(&quot;onID3 called at &quot;+getTimer()+&quot; ms.&quot;for (var prop in this.id3) {id3_dg.addItem({property:prop, value:this.id3[prop]}}};my_sound.loadSound(&quot;song1.mp3&quot;, trueSee alsoattachSound (Sound.attachSound method), id3 (Sound.id3 property), loadSound (Sound.loadSound method)" />
   <page href="00005481.html" title="onLoad (Sound.onLoad handler)" text="onLoad (Sound.onLoad handler)onLoad = function(success:Boolean) {}Invoked automatically when a sound loads. You must create a function that executes when the this handler is invoked. You can use either an anonymous function or a named function (for an example of each, see Sound.onSoundComplete). You should define this handler before you call mySound.loadSound().Parameterssuccess:Boolean - A Boolean value of true if my_sound is loaded successfully, false otherwise.ExampleThe following example creates a new Sound object, and loads a sound. Loading the sound is handled by the onLoad handler, which allows you to start the song after it is successfully loaded. Create a new FLA file, and add the following ActionScript to your FLA or AS file. For this example to work, you must have an MP3 called song1.mp3 in the same directory as your FLA or AS file. this.createTextField(&quot;status_txt&quot;, this.getNextHighestDepth(), 0,0,100,22// create a new Sound objectvar my_sound:Sound = new Sound(// If the sound loads, play it; if not, trace failure loading.my_sound.onLoad = function(success:Boolean) {if (success) {my_sound.start(status_txt.text = &quot;Sound loaded&quot;;} else {status_txt.text = &quot;Sound failed&quot;;}};// Load the sound.my_sound.loadSound(&quot;song1.mp3&quot;, trueSee alsoloadSound (Sound.loadSound method)" />
   <page href="00005482.html" title="onSoundComplete (Sound.onSoundComplete handler)" text="onSoundComplete (Sound.onSoundComplete handler)onSoundComplete = function() {}Invoked automatically when a sound finishes playing. You can use this handler to trigger events in a SWF file when a sound finishes playing. You must create a function that executes when this handler is invoked. You can use either an anonymous function or a named function.ExampleUsage 1: The following example uses an anonymous function: var my_sound:Sound = new Sound(my_sound.attachSound(&quot;mySoundID&quot;my_sound.onSoundComplete = function() {trace(&quot;mySoundID completed&quot;};my_sound.start( Usage 2: The following example uses a named function: function callback1() {trace(&quot;mySoundID completed&quot;}var my_sound:Sound = new Sound(my_sound.attachSound(&quot;mySoundID&quot;my_sound.onSoundComplete = callback1;my_sound.start(See alsoonLoad (Sound.onLoad handler)" />
   <page href="00005483.html" title="position (Sound.position property)" text="position (Sound.position property)public position : Number [read-only]The number of milliseconds a sound has been playing. If the sound is looped, the position is reset to 0 at the beginning of each loop. Note: Flash Lite 2.0 supports this property for native Flash sound only. The sound formats that are specific to a host device are not supported.ExampleFor a sample usage of this property, see Sound.duration.See alsoduration (Sound.duration property)" />
   <page href="00005484.html" title="setPan (Sound.setPan method)" text="setPan (Sound.setPan method)public setPan(value:Number) : VoidDetermines how the sound is played in the left and right channels (speakers). For mono sounds, pan determines which speaker (left or right) the sound plays through. Note: Flash Lite 2.0 supports this method for native Flash sound only. The sound formats that are specific to a host device are not supported.Parametersvalue:Number - An integer specifying the left-right balance for a sound. The range of valid values is -100 to 100, where -100 uses only the left channel, 100 uses only the right channel, and 0 balances the sound evenly between the two channels.ExampleFor a sample usage of this method, see Sound.getPan().See alsoattachSound (Sound.attachSound method), getPan (Sound.getPan method), setTransform (Sound.setTransform method), setVolume (Sound.setVolume method), start (Sound.start method)" />
   <page href="00005485.html" title="setTransform (Sound.setTransform method)" text="setTransform (Sound.setTransform method)public setTransform(transformObject:Object) : VoidSets the sound transform (or balance) information, for a Sound object. The soundTransformObject parameter is an object that you create using the constructor method of the generic Object class with parameters specifying how the sound is distributed to the left and right channels (speakers). Sounds use a considerable amount of disk space and memory. Because stereo sounds use twice as much data as mono sounds, it is generally best to use 22-KHz 6-bit mono sounds. You can use setTransform() to play mono sounds as stereo, play stereo sounds as mono, and to add interesting effects to sounds.Note: Flash Lite 2.0 supports this method for native Flash sound only. The sound formats that are specific to a host device are not supported.The properties for the soundTransformObject are as follows:11 - A percentage value that specifies how much of the left input to play in the left speaker (0-100).1r - A percentage value that specifies how much of the right input to play in the left speaker (0-100).rr - A percentage value that specifies how much of the right input to play in the right speaker (0-100).rl - A percentage value that specifies how much of the left input to play in the right speaker (0-100).The net result of the parameters is represented by the following formula:leftOutput = left_input ~ ll + right_input ~ lrrightOutput = right_input ~ rr + left_input ~ rlThe values for left_input or right_input are determined by the type (stereo or mono) of sound in your SWF file. Stereo sounds divide the sound input evenly between the left and right speakers and have the following transform settings by default:ll = 100lr = 0rr = 100rl = 0Mono sounds play all sound input in the left speaker and have the following transform settings by default:ll = 100lr = 100rr = 0rl = 0ParameterstransformObject:Object - An object created with the constructor for the generic Object class.ExampleThe following example illustrates a setting that can be achieved by using setTransform(), but cannot be achieved by using setVolume() or setPan(), even if they are combined. The following code creates a new soundTransformObject object and sets its properties so that sound from both channels plays in the left channel only .var mySoundTransformObject:Object = new Object(mySoundTransformObject.ll = 100;mySoundTransformObject.lr = 100;mySoundTransformObject.rr = 0;mySoundTransformObject.rl = 0;To apply the soundTransformObject object to a Sound object, you then need to pass the object to the Sound object using setTransform() as follows:my_sound.setTransform(mySoundTransformObjectThe following example plays a stereo sound as mono; the soundTransformObjectMono object has the following parameters:var mySoundTransformObjectMono:Object = new Object(mySoundTransformObjectMono.ll = 50;mySoundTransformObjectMono.lr = 50;mySoundTransformObjectMono.rr = 50;mySoundTransformObjectMono.rl = 50;my_sound.setTransform(mySoundTransformObjectMonoThis example plays the left channel at half capacity and adds the rest of the left channel to the right channel; the soundTransformObjectHalf object has the following parameters:var mySoundTransformObjectHalf:Object = new Object(mySoundTransformObjectHalf.ll = 50;mySoundTransformObjectHalf.lr = 0;mySoundTransformObjectHalf.rr = 100;mySoundTransformObjectHalf.rl = 50;my_sound.setTransform(mySoundTransformObjectHalfvar mySoundTransformObjectHalf:Object = {ll:50, lr:0, rr:100, rl:50};See alsoObject, getTransform (Sound.getTransform method)" />
   <page href="00005486.html" title="setVolume (Sound.setVolume method)" text="setVolume (Sound.setVolume method)public setVolume(value:Number) : VoidSets the volume for the Sound object.Parametersvalue:Number - A number from 0 to 100 representing a volume level. 100 is full volume and 0 is no volume. The default setting is 100.ExampleFor a sample usage of this method, see Sound.getVolume().See alsosetPan (Sound.setPan method), setTransform (Sound.setTransform method)" />
   <page href="00005487.html" title="Sound constructor" text="Sound constructorpublic Sound([target:Object])Creates a new Sound object for a specified movie clip. If you do not specify a target instance, the Sound object controls all of the sounds in the movie.Parameterstarget:Object [optional] - The movie clip instance on which the Sound object operates.ExampleThe following example creates a new Sound object called global_sound. The second line calls setVolume() and adjusts the volume on all sounds in the movie to 50%. var global_sound:Sound = new Sound(global_sound.setVolume(50The following example creates a new Sound object, passes it the target movie clip my_mc, and calls the start method, which starts any sound in my_mc.var movie_sound:Sound = new Sound(my_mcmovie_sound.start(" />
   <page href="00005488.html" title="start (Sound.start method)" text="start (Sound.start method)public start([secondOffset:Number], [loops:Number]) : VoidStarts playing the last attached sound from the beginning if no parameter is specified, or starting at the point in the sound specified by the secondOffset parameter.ParameterssecondOffset:Number [optional] - A parameter that lets you start playing the sound at a specific point. For example, if you have a 30-second sound and want the sound to start playing in the middle, specify 15 for the secondOffset parameter. The sound is not delayed 15 seconds, but rather starts playing at the 15-second mark.loops:Number [optional] - A parameter that lets you specify the number of times the sound should play consecutively. This parameter is not available if the sound is a streaming sound.ExampleThe following example creates a new Sound object, and loads a sound. The onLoad handler loads the sound, which allows you to start the song after it is successfully loaded. Then the sound uses the start() method to start playing. Create a new FLA file, and add the following ActionScript to your FLA or ActionScript file. For this example to work, you must have an MP3 called song1.mp3 in the same directory as your FLA or AS file. this.createTextField(&quot;status_txt&quot;, this.getNextHighestDepth(), 0,0,100,22// create a new Sound objectvar my_sound:Sound = new Sound(// If the sound loads, play it; if not, trace failure loading.my_sound.onLoad = function(success:Boolean) { if (success) { my_sound.start( status_txt.text = &quot;Sound loaded&quot;; } else { status_txt.text = &quot;Sound failed&quot;; }};// Load the sound.my_sound.loadSound(&quot;song1.mp3&quot;, trueSee alsostop (Sound.stop method)" />
   <page href="00005489.html" title="stop (Sound.stop method)" text="stop (Sound.stop method)public stop([linkageID:String]) : VoidStops all sounds currently playing if no parameter is specified, or just the sound specified in the idName parameter.ParameterslinkageID:String [optional] - A parameter specifying a specific sound to stop playing. The idName parameter must be enclosed in quotation marks (&quot; &quot;).ExampleThe following example uses two buttons, stop_btn and play_btn, to control the playback of a sound that loads into a SWF file. Add two buttons to your document and add the following ActionScript to your FLA or AS file: var my_sound:Sound = new Sound(my_sound.loadSound(&quot;song1.mp3&quot;, truestop_btn.onRelease = function() { trace(&quot;sound stopped&quot; my_sound.stop(};play_btn.onRelease = function() { trace(&quot;sound started&quot; my_sound.start(};See alsostart (Sound.start method)" />
   <page href="00005490.html" title="Stage" text="ModifiersPropertyDescriptionstaticalign:StringIndicates the current alignment of the SWF file in the player or browser.staticheight:NumberProperty (read-only indicates the current height, in pixels, of the Stage.staticscaleMode:StringIndicates the current scaling of the SWF file within Flash Player.staticwidth:NumberProperty (read-only indicates the current width, in pixels, of the Stage.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)EventDescriptiononResize = function() {}Invoked when Stage.scaleMode is set to noScale and the SWF file is resized.ModifiersSignatureDescriptionstaticaddListener(listener:Object) : VoidDetects when a SWF file is resized (but only if Stage.scaleMode = &quot;noScale&quot;).staticremoveListener(listener:Object) : BooleanRemoves a listener object created with addListener().addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)StageObject | +-Stagepublic class Stageextends ObjectThe Stage class is a top-level class whose methods, properties, and handlers you can access without using a constructor. Use the methods and properties of this class to access and manipulate information about the boundaries of a SWF file. Property summaryProperties inherited from class ObjectEvent summaryMethod summaryMethods inherited from class Object" />
   <page href="00005491.html" title="addListener (Stage.addListener method)" text="addListener (Stage.addListener method)public static addListener(listener:Object) : VoidDetects when a SWF file is resized (but only if Stage.scaleMode = &quot;noScale&quot;). The addListener() method doesn&#39;t work with the default movie clip scaling setting (showAll) or other scaling settings (exactFit and noBorder). To use addListener(), you must first create a listener object. Stage listener objects receive notification from Stage.onResize.Parameterslistener:Object - An object that listens for a callback notification from the Stage.onResize event.ExampleThis example creates a new listener object called stageListener. It then uses stageListener to call onResize and define a function that will be called when onResize is triggered. Finally, the code adds the stageListener object to the callback list of the Stage object. Listener objects allow multiple objects to listen for resize notifications. this.createTextField(&quot;stageSize_txt&quot;, this.getNextHighestDepth(), 10, 10, 100, 22var stageListener:Object = new Object(stageListener.onResize = function() { stageSize_txt.text = &quot;w:&quot;+Stage.width+&quot;, h:&quot;+Stage.height;};Stage.scaleMode = &quot;noScale&quot;;Stage.addListener(stageListenerSee alsoonResize (Stage.onResize event listener), removeListener (Stage.removeListener method)" />
   <page href="00005492.html" title="align (Stage.align property)" text="ValueVerticalHorizontal&quot;T&quot;topcenter&quot;B&quot;bottomcenter&quot;L&quot;centerleft&quot;R&quot;centerright&quot;TL&quot;topleft&quot;TR&quot;topright&quot;BL&quot;bottomleft&quot;BR&quot;bottomrightalign (Stage.align property)public static align : StringIndicates the current alignment of the SWF file in the player or browser. The following table lists the values for the align property. Any value not listed here centers the SWF file in Flash player or browser area, which is the default setting.ExampleThe following example demonstrates different alignments of the SWF file. Add a ComboBox instance to your document with the instance name stageAlign_cb. Add the following ActionScript to your FLA or AS file: var stageAlign_cb:mx.controls.ComboBox;stageAlign_cb.dataProvider = [&#39;T&#39;, &#39;B&#39;, &#39;L&#39;, &#39;R&#39;, &#39;TL&#39;, &#39;TR&#39;, &#39;BL&#39;, &#39;BR&#39;];var cbListener:Object = new Object(cbListener.change = function(evt:Object) { var align:String = evt.target.selectedItem; Stage.align = align;};stageAlign_cb.addEventListener(&quot;change&quot;, cbListenerStage.scaleMode = &quot;noScale&quot;;Select different alignment settings from the ComboBox." />
   <page href="00005493.html" title="height (Stage.height property)" text="height (Stage.height property)public static height : NumberProperty (read-only indicates the current height, in pixels, of the Stage. When the value of Stage.scaleMode is noScale, the height property represents the height of Flash Player. When the value of Stage.scaleMode is not noScale, height represents the height of the SWF file.ExampleThis example creates a new listener object called stageListener. It then uses myListener to call onResize and define a function that will be called when onResize is triggered. Finally, the code adds the myListener object to the callback list of the Stage object. Listener objects allow multiple objects to listen for resize notifications. this.createTextField(&quot;stageSize_txt&quot;, this.getNextHighestDepth(), 10, 10, 100, 22var stageListener:Object = new Object(stageListener.onResize = function() { stageSize_txt.text = &quot;w:&quot;+Stage.width+&quot;, h:&quot;+Stage.height;};Stage.scaleMode = &quot;noScale&quot;;Stage.addListener(stageListenerSee alsoalign (Stage.align property), scaleMode (Stage.scaleMode property), width (Stage.width property)" />
   <page href="00005494.html" title="onResize (Stage.onResize event listener)" text="onResize (Stage.onResize event listener)onResize = function() {}Invoked when Stage.scaleMode is set to noScale and the SWF file is resized. You can use this event handler to write a function that lays out the objects on the Stage when a SWF file is resized.ExampleThe following example displays a message in the Output panel when the Stage is resized: Stage.scaleMode = &quot;noScale&quot;var myListener:Object = new Object(myListener.onResize = function () { trace(&quot;Stage size is now &quot; + Stage.width + &quot; by &quot; + Stage.height}Stage.addListener(myListener// later, call Stage.removeListener(myListener)See alsoscaleMode (Stage.scaleMode property), addListener (Stage.addListener method), removeListener (Stage.removeListener method)" />
   <page href="00005495.html" title="removeListener (Stage.removeListener method)" text="removeListener (Stage.removeListener method)public static removeListener(listener:Object) : BooleanRemoves a listener object created with addListener().Parameterslistener:Object - An object added to an object&#39;s callback list with addListener().ReturnsBoolean - A Boolean value.ExampleThe following example displays the Stage dimensions in a dynamically created text field. When you resize the Stage, the values in the text field update. Create a button with an instance name remove_btn. Add the following ActionScript to Frame 1 of the Timeline. this.createTextField(&quot;stageSize_txt&quot;, this.getNextHighestDepth(), 10, 10, 100, 22stageSize_txt.autoSize = true;stageSize_txt.border = true;var stageListener:Object = new Object(stageListener.onResize = function() { stageSize_txt.text = &quot;w:&quot;+Stage.width+&quot;, h:&quot;+Stage.height;};Stage.addListener(stageListenerremove_btn.onRelease = function() { stageSize_txt.text = &quot;Removing Stage listener...&quot;; Stage.removeListener(stageListener}Select Control &gt; Test Movie to test this example. The values you see in the text field are updated when you resize the testing environment. When you click remove_btn, the listener is removed and the values are no longer updated in the text field.See alsoaddListener (Stage.addListener method)" />
   <page href="00005496.html" title="scaleMode (Stage.scaleMode property)" text="scaleMode (Stage.scaleMode property)public static scaleMode : StringIndicates the current scaling of the SWF file within Flash Player. The scaleMode property forces the SWF file into a specific scaling mode. By default, the SWF file uses the HTML parameters set in the Publish Settings dialog box. The scaleMode property can use the values &quot;exactFit&quot;, &quot;showAll&quot;, &quot;noBorder&quot;, and &quot;noScale&quot;. Any other value sets the scaleMode property to the default &quot;showAll&quot;.showAll (Default) makes the entire Flash content visible in the specified area without distortion while maintaining the original aspect ratio. Borders can appear on two sides of the application.noBorder scales the Flash content to fill the specified area, without distortion but possibly with some cropping, while maintaining the original aspect ratio of the application. exactFit makes the entire Flash content visible in the specified area without trying to preserve the original aspect ratio. Distortion can occur.noScale makes the size of the Flash content fixed, so that it remains unchanged even as the size of the player window changes. Cropping may occur if the player window is smaller than the Flash content.Note: the default setting is showAll, except when in test movie mode, where the default setting is noScaleExampleThe following example demonstrates various scale settings for the SWF file. Add a ComboBox instance to your document with the instance name scaleMode_cb. Add the following ActionScript to your FLA or AS file: var scaleMode_cb:mx.controls.ComboBox;scaleMode_cb.dataProvider = [&quot;showAll&quot;, &quot;exactFit&quot;, &quot;noBorder&quot;, &quot;noScale&quot;];var cbListener:Object = new Object(cbListener.change = function(evt:Object) { var scaleMode_str:String = evt.target.selectedItem; Stage.scaleMode = scaleMode_str;};scaleMode_cb.addEventListener(&quot;change&quot;, cbListenerTo view another example, see the stagesize.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples_and_tutorials. Download and decompress the Samples_and_Tutorials .zip file for your Flash Lite version and navigate to the ActionScript folder to access the sample file." />
   <page href="00005497.html" title="width (Stage.width property)" text="width (Stage.width property)public static width : NumberProperty (read-only indicates the current width, in pixels, of the Stage. When the value of Stage.scaleMode is &quot;noScale&quot;, the width property represents the width of Flash Player. This means that Stage.width will vary as you resize the player window. When the value of Stage.scaleMode is not &quot;noScale&quot;, width represents the width of the SWF file as set at author-time in the Document Properties dialog box. This means that the value of width will stay constant as you resize the player window.ExampleThis example creates a new listener object called stageListener. It then uses stageListener to call onResize and define a function that will be called when onResize is triggered. Finally, the code adds the stageListener object to the callback list of the Stage object. Listener objects allow multiple objects to listen for resize notifications. this.createTextField(&quot;stageSize_txt&quot;, this.getNextHighestDepth(), 10, 10, 100, 22var stageListener:Object = new Object(stageListener.onResize = function() { stageSize_txt.text = &quot;w:&quot;+Stage.width+&quot;, h:&quot;+Stage.height;};Stage.scaleMode = &quot;noScale&quot;;Stage.addListener(stageListenerSee alsoalign (Stage.align property), height (Stage.height property), scaleMode (Stage.scaleMode property)" />
   <page href="00005498.html" title="String" text="ModifiersPropertyDescriptionlength:NumberAn integer specifying the number of characters in the specified String object.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)SignatureDescriptionString(value:String)Creates a new String object.ModifiersSignatureDescriptioncharAt(index:Number) : StringReturns the character in the position specified by the parameter index.charCodeAt(index:Number) : NumberReturns a 16-bit integer from 0 to 65535 that represents the character specified by index.concat(value:Object) : StringCombines the value of the String object with the parameters and returns the newly formed string; the original value, my_str, is unchanged.staticfromCharCode() : StringReturns a string comprising the characters represented by the Unicode values in the parameters.indexOf(value:String, [startIndex:Number]) : NumberSearches the string and returns the position of the first occurrence of value found at or after startIndex within the calling string.lastIndexOf(value:String, [startIndex:Number]) : NumberSearches the string from right to left and returns the index of the last occurrence of value found before startIndex within the calling string.slice(start:Number, end:Number) : StringReturns a string that includes the start character and all characters up to, but not including, the end character.split(delimiter:String, [limit:Number]) : ArraySplits a String object into substrings by breaking it wherever the specified delimiter parameter occurs and returns the substrings in an array.substr(start:Number, length:Number) : StringReturns the characters in a string from the index specified in the start parameter through the number of characters specified in the length parameter.substring(start:Number, end:Number) : StringReturns a string comprising the characters between the points specified by the start and end parameters.toLowerCase() : StringReturns a copy of the String object, with all uppercase characters converted to lowercase.toString() : StringReturns an object&#39;s properties as strings regardless of whether the properties are strings.toUpperCase() : StringReturns a copy of the String object, with all lowercase characters converted to uppercase.valueOf() : StringReturns the string.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)StringObject | +-Stringpublic class Stringextends ObjectThe String class is a wrapper for the string primitive data type, and provides methods and properties that let you manipulate primitive string value types. You can convert the value of any object into a string using the String() function. All the methods of the String class, except for concat(), fromCharCode(), slice(), and substr(), are generic, which means the methods call toString() before performing their operations, and you can use these methods with other non-String objects. Because all string indexes are zero-based, the index of the last character for any string x is x.length - 1.You can call any of the methods of the String class using the constructor method new String or using a string literal value. If you specify a string literal, the ActionScript interpreter automatically converts it to a temporary String object, calls the method, and then discards the temporary String object. You can also use the String.length property with a string literal.Do not confuse a string literal with a String object. In the following example, the first line of code creates the string literal first_string, and the second line of code creates the String object second_string:var first_string:String = &quot;foo&quot; var second_string:String = new String(&quot;foo&quot;) Use string literals unless you specifically need to use a String object.Property summaryProperties inherited from class ObjectConstructor summaryMethod summaryMethods inherited from class Object" />
   <page href="00005499.html" title="charAt (String.charAt method)" text="charAt (String.charAt method)public charAt(index:Number) : StringReturns the character in the position specified by the parameter index. If index is not a number from 0 to string.length - 1, an empty string is returned. This method is similar to String.charCodeAt() except that the returned value is a character, not a 16-bit integer character code.Parametersindex:Number - An integer specifying the position of a character in the string. The first character is indicated by 0, and the last character is indicated by my_str.length-1.ReturnsString - The character at the specified index. Or an empty String if the specified index is outside the range of this String&#39;s indeces.ExampleIn the following example, this method is called on the first letter of the string &quot;Chris&quot;: var my_str:String = &quot;Chris&quot;;var firstChar_str:String = my_str.charAt(0trace(firstChar_str // output: CSee alsocharCodeAt (String.charCodeAt method)" />
   <page href="00005500.html" title="charCodeAt (String.charCodeAt method)" text="charCodeAt (String.charCodeAt method)public charCodeAt(index:Number) : NumberReturns a 16-bit integer from 0 to 65535 that represents the character specified by index. If index is not a number from 0 to string.length - 1, NaN is returned. This method is similar to String.charAt() except that the returned value is a 16-bit integer character code, not a character.Parametersindex:Number - An integer that specifies the position of a character in the string. The first character is indicated by 0, and the last character is indicated by my_str.length - 1.ReturnsNumber - An integer that represents the character specified by index.ExampleIn the following example, this method is called on the first letter of the string &quot;Chris&quot;: var my_str:String = &quot;Chris&quot;;var firstChar_num:Number = my_str.charCodeAt(0trace(firstChar_num // output: 67See alsocharAt (String.charAt method)" />
   <page href="00005501.html" title="concat (String.concat method)" text="concat (String.concat method)public concat(value:Object) : StringCombines the value of the String object with the parameters and returns the newly formed string; the original value, my_str, is unchanged.Parametersvalue:Object - value1[,...valueN] Zero or more values to be concatenated.ReturnsString - A string.ExampleThe following example creates two strings and combines them using String.concat(): var stringA:String = &quot;Hello&quot;;var stringB:String = &quot;World&quot;;var combinedAB:String = stringA.concat(&quot; &quot;, stringBtrace(combinedAB // output: Hello World" />
   <page href="00005502.html" title="fromCharCode (String.fromCharCode method)" text="fromCharCode (String.fromCharCode method)public static fromCharCode() : StringReturns a string comprising the characters represented by the Unicode values in the parameters.ReturnsString - A string value of the specified Unicode character codes.ExampleThe following example uses fromCharCode() to insert an @ character in the e-mail address: var address_str:String = &quot;dog&quot;+String.fromCharCode(64)+&quot;house.net&quot;;trace(address_str // output: dog@house.net " />
   <page href="00005503.html" title="indexOf (String.indexOf method)" text="indexOf (String.indexOf method)public indexOf(value:String, [startIndex:Number]) : NumberSearches the string and returns the position of the first occurrence of value found at or after startIndex within the calling string. This index is zero-based, meaning that the first character in a string is considered to be at index 0--not index 1. If value is not found, the method returns -1.Parametersvalue:String - A string; the substring to search for.startIndex:Number [optional] - An integer specifying the starting index of the search.ReturnsNumber - The position of the first occurrence of the specified substring or -1.ExampleThe following examples use indexOf() to return the index of characters and substrings: var searchString:String = &quot;Lorem ipsum dolor sit amet.&quot;;var index:Number;index = searchString.indexOf(&quot;L&quot;trace(index // output: 0index = searchString.indexOf(&quot;l&quot;trace(index // output: 14index = searchString.indexOf(&quot;i&quot;trace(index // output: 6index = searchString.indexOf(&quot;ipsum&quot;trace(index // output: 6index = searchString.indexOf(&quot;i&quot;, 7trace(index // output: 19index = searchString.indexOf(&quot;z&quot;trace(index // output: -1See alsolastIndexOf (String.lastIndexOf method)" />
   <page href="00005504.html" title="lastIndexOf (String.lastIndexOf method)" text="lastIndexOf (String.lastIndexOf method)public lastIndexOf(value:String, [startIndex:Number]) : NumberSearches the string from right to left and returns the index of the last occurrence of value 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 0--not index 1. If value is not found, the method returns -1.Parametersvalue:String - The string for which to search.startIndex:Number [optional] - An integer specifying the starting point from which to search for value.ReturnsNumber - The position of the last occurrence of the specified substring or -1.ExampleThe following example shows how to use lastIndexOf() to return the index of a certain character: var searchString:String = &quot;Lorem ipsum dolor sit amet.&quot;;var index:Number;index = searchString.lastIndexOf(&quot;L&quot;trace(index // output: 0index = searchString.lastIndexOf(&quot;l&quot;trace(index // output: 14index = searchString.lastIndexOf(&quot;i&quot;trace(index // output: 19index = searchString.lastIndexOf(&quot;ipsum&quot;trace(index // output: 6index = searchString.lastIndexOf(&quot;i&quot;, 18trace(index // output: 6index = searchString.lastIndexOf(&quot;z&quot;trace(index // output: -1See alsoindexOf (String.indexOf method)" />
   <page href="00005505.html" title="length (String.length property)" text="length (String.length property)public length : NumberAn 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.ExampleThe following example creates a new String object and uses String.length to count the number of characters: var my_str:String = &quot;Hello world!&quot;;trace(my_str.length // output: 12The 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&lt;my_str.length; i++) { if (my_str.charAt(i) == &quot;@&quot;) { return true; } } return false;}trace(checkAtSymbol(&quot;dog@house.net&quot;) // output: truetrace(checkAtSymbol(&quot;Chris&quot;) // output: falseAn example is also in the Strings.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample." />
   <page href="00005506.html" title="slice (String.slice method)" text="slice (String.slice method)public slice(start:Number, end:Number) : StringReturns a string that includes the start character and all characters up to, but not including, the end character. The original String object is not modified. If the end parameter is not specified, the end of the substring is the end of the string. If the character indexed by start is the same as or to the right of the character indexed by end, the method returns an empty string.Parametersstart:Number - The zero-based index of the starting point for the slice. If start is a negative number, the starting point is determined from the end of the string, where -1 is the last character.end:Number - An integer that is one greater than the index of the ending point for the slice. The character indexed by the end parameter is not included in the extracted string. If this parameter is omitted, String.length is used. If end is a negative number, the ending point is determined by counting back from the end of the string, where -1 is the last character.ReturnsString - A substring of the specified string.ExampleThe following example creates a variable, my_str, assigns it a String value, and then calls the slice() method using a variety of values for both the start and end parameters. Each call to slice() is wrapped in a trace() statement that displays the output in the Output panel. // Index values for the string literal// positive index: 0 1 2 3 4// string: L o r e m// negative index: -5 -4 -3 -2 -1var my_str:String = &quot;Lorem&quot;;// slice the first charactertrace(&quot;slice(0,1): &quot;+my_str.slice(0, 1) // output: slice(0,1): Ltrace(&quot;slice(-5,1): &quot;+my_str.slice(-5, 1) // output: slice(-5,1): L// slice the middle three characterstrace(&quot;slice(1,4): &quot;+my_str.slice(1, 4) // slice(1,4): oretrace(&quot;slice(1,-1): &quot;+my_str.slice(1, -1) // slice(1,-1): ore// slices that return empty strings because start is not to the left of endtrace(&quot;slice(1,1): &quot;+my_str.slice(1, 1) // slice(1,1):trace(&quot;slice(3,2): &quot;+my_str.slice(3, 2) // slice(3,2):trace(&quot;slice(-2,2): &quot;+my_str.slice(-2, 2) // slice(-2,2):// slices that omit the end parameter use String.length, which equals 5trace(&quot;slice(0): &quot;+my_str.slice(0) // slice(0): Loremtrace(&quot;slice(3): &quot;+my_str.slice(3) // slice(3): emAn example is also in the Strings.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample.See alsosubstr (String.substr method), substring (String.substring method)" />
   <page href="00005507.html" title="split (String.split method)" text="split (String.split method)public split(delimiter:String, [limit:Number]) : ArraySplits a String object into substrings by breaking it wherever the specified delimiter parameter occurs and returns the substrings in an array. If you use an empty string (&quot;&quot;) as a delimiter, each character in the string is placed as an element in the array. If the delimiter parameter is undefined, the entire string is placed into the first element of the returned array.Parametersdelimiter:String - A string; the character or string at which my_str splits.limit:Number [optional] - The number of items to place into the array.ReturnsArray - An array containing the substrings of my_str.ExampleThe following example returns an array with five elements: var my_str:String = &quot;P,A,T,S,Y&quot;;var my_array:Array = my_str.split(&quot;,&quot;for (var i = 0; i&lt;my_array.length; i++) { trace(my_array[i]}// output: P A T S YThe following example returns an array with two elements, &quot;P&quot; and &quot;A&quot;:var my_str:String = &quot;P,A,T,S,Y&quot;;var my_array:Array = my_str.split(&quot;,&quot;, 2trace(my_array // output: P,AThe following example shows that if you use an empty string (&quot;&quot;) for the delimiter parameter, each character in the string is placed as an element in the array:var my_str:String = new String(&quot;Joe&quot;var my_array:Array = my_str.split(&quot;&quot;for (var i = 0; i&lt;my_array.length; i++) { trace(my_array[i]}// output: J o eAn example is also in the Strings.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample.See alsojoin (Array.join method)" />
   <page href="00005508.html" title="String constructor" text="String constructorpublic String(value:String)Creates a new String object. Note: Because string literals use less overhead than String objects and are generally easier to use, you should use string literals instead of the constructor for the String class unless you have a good reason to use a String object rather than a string literal.Parametersvalue:String - The initial value of the new String object." />
   <page href="00005509.html" title="substr (String.substr method)" text="substr (String.substr method)public substr(start:Number, length:Number) : StringReturns the characters in a string from the index specified in the start parameter through the number of characters specified in the length parameter. The substr method does not change the string specified by my_str; it returns a new string.Parametersstart:Number - An integer that indicates the position of the first character in my_str to be used to create the substring. If start is a negative number, the starting position is determined from the end of the string, where the -1 is the last character.length:Number - The number of characters in the substring being created. If length is not specified, the substring includes all the characters from the start to the end of the string.ReturnsString - A substring of the specified string.ExampleThe following example creates a new string, my_str and uses substr() to return the second word in the string; first, using a positive start parameter, and then using a negative start parameter: var my_str:String = new String(&quot;Hello world&quot;var mySubstring:String = new String(mySubstring = my_str.substr(6,5trace(mySubstring // output: worldmySubstring = my_str.substr(-5,5trace(mySubstring // output: worldAn example is also in the Strings.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample." />
   <page href="00005510.html" title="substring (String.substring method)" text="substring (String.substring method)public substring(start:Number, end:Number) : StringReturns a string comprising the characters between the points specified by the start and end parameters. If the end parameter is not specified, the end of the substring is the end of the string. If the value of start equals the value of end, the method returns an empty string. If the value of start is greater than the value of end, the parameters are automatically swapped before the function executes and the original value is unchanged.Parametersstart:Number - An integer that indicates the position of the first character of my_str used to create the substring. Valid values for start are 0 through String.length - 1. If start is a negative value, 0 is used.end:Number - An integer that is 1+ the index of the last character in my_str to be extracted. Valid values for end are 1 through String.length. The character indexed by the end parameter is not included in the extracted string. If this parameter is omitted, String.length is used. If this parameter is a negative value, 0 is used.ReturnsString - A substring of the specified string.ExampleThe following example shows how to use substring(): var my_str:String = &quot;Hello world&quot;;var mySubstring:String = my_str.substring(6,11trace(mySubstring // output: worldThe following example shows what happens if a negative start parameter is used:var my_str:String = &quot;Hello world&quot;;var mySubstring:String = my_str.substring(-5,5trace(mySubstring // output: HelloAn example is also in the Strings.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample." />
   <page href="00005511.html" title="toLowerCase (String.toLowerCase method)" text="toLowerCase (String.toLowerCase method)public toLowerCase() : StringReturns a copy of the String object, with all uppercase characters converted to lowercase. The original value is unchanged.ReturnsString - A string.ExampleThe following example creates a string with all uppercase characters and then creates a copy of that string using toLowerCase() to convert all uppercase characters to lowercase characters: var upperCase:String = &quot;LOREM IPSUM DOLOR&quot;;var lowerCase:String = upperCase.toLowerCase(trace(&quot;upperCase: &quot; + upperCase // output: upperCase: LOREM IPSUM DOLORtrace(&quot;lowerCase: &quot; + lowerCase // output: lowerCase: lorem ipsum dolorAn example is also in the Strings.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample.See alsotoUpperCase (String.toUpperCase method)" />
   <page href="00005512.html" title="toString (String.toString method)" text="toString (String.toString method)public toString() : StringReturns an object&#39;s properties as strings regardless of whether the properties are strings.ReturnsString - The string.ExampleThe following example outputs an uppercase string that lists all of an object&#39;s properties (regardless of whether the properties are strings): var employee:Object = new Object(employee.name = &quot;bob&quot;;employee.salary = 60000;employee.id = 284759021;var employeeData:String = new String(for (prop in employee) { employeeData += employee[prop].toString().toUpperCase() + &quot; &quot;;}trace(employeeData If the toString() method were not included in this code (and the line within the for loop used employee[prop].toUpperCase()), the output would be &quot;undefined undefined BOB&quot;. By including the toString() method, the desired output is produced: &quot;284759021 60000 BOB&quot;." />
   <page href="00005513.html" title="toUpperCase (String.toUpperCase method)" text="toUpperCase (String.toUpperCase method)public toUpperCase() : StringReturns a copy of the String object, with all lowercase characters converted to uppercase. The original value is unchanged.ReturnsString - A string.ExampleThe following example creates a string with all lowercase characters and then creates a copy of that string using toUpperCase(): var lowerCase:String = &quot;lorem ipsum dolor&quot;;var upperCase:String = lowerCase.toUpperCase(trace(&quot;lowerCase: &quot; + lowerCase // output: lowerCase: lorem ipsum dolortrace(&quot;upperCase: &quot; + upperCase // output: upperCase: LOREM IPSUM DOLORAn example is also in the Strings.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample.See alsotoLowerCase (String.toLowerCase method)" />
   <page href="00005514.html" title="valueOf (String.valueOf method)" text="valueOf (String.valueOf method)public valueOf() : StringReturns the string.ReturnsString - The value of the string.ExampleThe following example creates a new instance of the String object and then shows that the valueOf method returns a reference to the primitive value, rather than an instance of the object. var str:String = new String(&quot;Hello World&quot;var value:String = str.valueOf(trace(str instanceof String // truetrace(value instanceof String // falsetrace(str === value // false" />
   <page href="00005515.html" title="System" text="ModifiersPropertyDescriptionstaticuseCodepage:BooleanA Boolean value that tells Flash Player whether to use Unicode or the traditional code page of the operating system running the player to interpret external text files.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)EventDescriptiononStatus = function(infoObject:Object) {}Event handler: provides a super event handler for certain objects.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)SystemObject | +-Systempublic class Systemextends ObjectThe System class contains properties related to certain operations that take place on the user&#39;s computer, such as operations with shared objects and the clipboard. Additional properties and methods are in specific classes within the System package: the capabilities class (see System.capabilities) and the security class (see System.security).See alsocapabilities (System.capabilities), security (System.security)Property summaryProperties inherited from class ObjectEvent summaryMethod summaryMethods inherited from class Object" />
   <page href="00005516.html" title="onStatus (System.onStatus handler)" text="onStatus (System.onStatus handler)onStatus = function(infoObject:Object) {}Event handler: provides a super event handler for certain objects. The SharedObject class provides an onStatus() event handler that uses an information object for providing information, status, or error messages. To respond to this event handler, you must create a function to process the information object, and you must know the format and contents of the returned information object.In addition to the SharedObject.onStatus() method, Flash also provides a super function called System.onStatus(), which serves as a secondary error message handler. If an instance of the SharedObject class passes an information object with a level property of &quot;error&quot;, but you did not define an onStatus() function for that particular instance, then Flash uses the function you define for System.onStatus() instead.ParametersinfoObject:Object - A parameter defined according to the status message.ExampleThe following example shows how to create a System.onStatus() function to process information objects when a class-specific onStatus() function does not exist: // Create generic functionSystem.onStatus = function(genericError:Object){ // Your script would do something more meaningful here trace(&quot;An error has occurred. Please try again.&quot;}See alsoonStatus (SharedObject.onStatus handler)" />
   <page href="00005517.html" title="useCodepage (System.useCodepage property)" text="useCodepage (System.useCodepage property)public static useCodepage : BooleanA Boolean value that tells Flash Player whether to use Unicode or the traditional code page of the operating system running the player to interpret external text files. The default value of System.useCodepage is false. When the property is set to false, Flash Player interprets external text files as Unicode. (These files must be encoded as Unicode when you save them.)When the property is set to true, Flash Player interprets external text files using the traditional code page of the operating system running the player.Text that you load as an external file (using the loadVariables() or getURL() statements, or the LoadVars class or XML class) must be encoded as Unicode when you save the text file in order for Flash Player to recognize it as Unicode. To encode external files as Unicode, save the files in an application that supports Unicode, such as Notepad on Windows 2000.If you load external text files that are not Unicode-encoded, you should set System.useCodepage to true. Add the following code as the first line of code in the first frame of the SWF file that is loading the data:System.useCodepage = true;When this code is present, Flash Player interprets external text using the traditional code page of the operating system running Flash Player. This is generally CP1252 for an English Windows operating system and Shift-JIS for a Japanese operating system. If you set System.useCodepage to true, Flash Player 6 and later treat text as Flash Player 5 does. (Flash Player 5 treated all text as if it were in the traditional code page of the operating system running the player.)If you set System.useCodepage to true, remember that the traditional code page of the operating system running the player must include the characters used in your external text file in order for the text to display. For example, if you load an external text file that contains Chinese characters, those characters cannot display on a system that uses the CP1252 code page because that code page does not include Chinese characters.To ensure that users on all platforms can view external text files used in your SWF files, you should encode all external text files as Unicode and leave System.useCodepage set to false by default. This way, Flash Player 6 and later interprets the text as Unicode." />
   <page href="00005518.html" title="TextField" text="ModifiersPropertyDescription_alpha:NumberSets or retrieves the alpha transparency value of the text field.autoSize:ObjectControls automatic sizing and alignment of text fields.background:BooleanSpecifies if the text field has a background fill.backgroundColor:NumberThe color of the text field background.border:BooleanSpecifies if the text field has a border.borderColor:NumberThe color of the text field border.bottomScroll:Number [read-only]An integer (one-based index) that indicates the bottommost line that is currently visible the text field.condenseWhite:BooleanA Boolean value that specifies whether extra white space (spaces, line breaks, and so on) in an HTML text field should be removed when the field is rendered in a browser.embedFonts:BooleanA Boolean value that specifies whether to render the text using embedded font outlines._height:NumberThe height of the text field in pixels._highquality:NumberDeprecated since Flash Player 7. This property was deprecated in favor of TextField._quality.Specifies the level of anti-aliasing applied to the current SWF file.hscroll:NumberIndicates the current horizontal scrolling position.html:BooleanA flag that indicates whether the text field contains an HTML representation.htmlText:StringIf the text field is an HTML text field, this property contains the HTML representation of the text field&#39;s contents.length:Number [read-only]Indicates the number of characters in a text field.maxChars:NumberIndicates the maximum number of characters that the text field can contain.maxhscroll:Number [read-only]Indicates the maximum value of TextField.hscroll.maxscroll:Number [read-only]Indicates the maximum value of TextField.scroll.multiline:BooleanIndicates whether the text field is a multiline text field._name:StringThe instance name of the text field._parent:MovieClipA reference to the movie clip or object that contains the current text field or object.password:BooleanSpecifies whether the text field is a password text field._quality:StringProperty (global sets or retrieves the rendering quality used for a SWF file._rotation:NumberThe rotation of the text field, in degrees, from its original orientation.scroll:NumberDefines the vertical position of text in a text field.selectable:BooleanA Boolean value that indicates whether the text field is selectable._soundbuftime:NumberSpecifies the number of seconds a sound prebuffers before it starts to stream.tabEnabled:BooleanSpecifies whether the text field is included in automatic tab ordering.tabIndex:NumberLets you customize the tab ordering of objects in a SWF file._target:String [read-only]The target path of the text field instance.text:StringIndicates the current text in the text field.textColor:NumberIndicates the color of the text in a text field.textHeight:NumberIndicates the height of the text.textWidth:NumberIndicates the width of the text.type:StringSpecifies the type of text field._url:String [read-only]Retrieves the URL of the SWF file that created the text field.variable:StringThe name of the variable that the text field is associated with._visible:BooleanA Boolean value that indicates whether the text field my_txt is visible._width:NumberThe width of the text field, in pixels.wordWrap:BooleanA Boolean value that indicates if the text field has word wrap._x:NumberAn integer that sets the x coordinate of a text field relative to the local coordinates of the parent movie clip._xmouse:Number [read-only]Returns the x coordinate of the mouse position relative to the text field._xscale:NumberDetermines the horizontal scale of the text field as applied from the registration point of the text field, expressed as a percentage._y:NumberThe y coordinate of a text field relative to the local coordinates of the parent movie clip._ymouse:Number [read-only]Indicates the y coordinate of the mouse position relative to the text field._yscale:NumberThe vertical scale of the text field as applied from the registration point of the text field, expressed as a percentage.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)EventDescriptiononChanged = function(changedField:TextField) {}Event handler/listener; invoked when the content of a text field changes.onKillFocus = function(newFocus:Object) {}Invoked when a text field loses keyboard focus.onScroller = function(scrolledField:TextField) {}Event handler/listener; invoked when one of the text field scroll properties changes.onSetFocus = function(oldFocus:Object) {}Invoked when a text field receives keyboard focus.ModifiersSignatureDescriptionaddListener(listener:Object) : BooleanRegisters an object to receive TextField event notifications.getDepth() : NumberReturns the depth of a text field.getNewTextFormat() : TextFormatReturns a TextFormat object containing a copy of the text field&#39;s text format object.getTextFormat([beginIndex:Number], [endIndex:Number]) : TextFormatReturns a TextFormat object for a character, for a range of characters, or for an entire TextField object.removeListener(listener:Object) : BooleanRemoves a listener object previously registered to a text field instance with TextField.addListener().removeTextField() : VoidRemoves the text field.replaceSel(newText:String) : VoidReplaces the current selection with the contents of the newText parameter.replaceText(beginIndex:Number, endIndex:Number, newText:String) : VoidReplaces a range of characters, specified by the beginIndex and endIndex parameters, in the specified text field with the contents of the newText parameter.setNewTextFormat(tf:TextFormat) : VoidSets the default new text format of a text field.setTextFormat([beginIndex:Number], [endIndex:Number], textFormat:TextFormat) : VoidApplies the text formatting specified by the textFormat parameter to some or all of the text in a text field.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)TextFieldObject | +-TextFieldpublic dynamic class TextFieldextends ObjectThe TextField class is used to create areas for text display and input. All dynamic and input text fields in a SWF file are instances of the TextField class. You can give a text field an instance name in the Property inspector and use the methods and properties of the TextField class to manipulate it with ActionScript. TextField instance names are displayed in the Movie Explorer and in the Insert Target Path dialog box in the Actions panel. To create a text field dynamically, you do not use the new operator. Instead, you use MovieClip.createTextField().The methods of the TextField class let you set, select, and manipulate text in a dynamic or input text field that you create during authoring or at runtime. See alsoObject, createTextField (MovieClip.createTextField method)Property summaryProperties inherited from class ObjectEvent summaryMethod summaryMethods inherited from class Object" />
   <page href="00005519.html" title="addListener (TextField.addListener method)" text="addListener (TextField.addListener method)public addListener(listener:Object) : BooleanRegisters an object to receive TextField event notifications. The object will receive event notifications whenever the onChanged and onScroller event handlers have been invoked. When a text field changes or is scrolled, the TextField.onChanged and TextField.onScroller event handlers are invoked, followed by the onChanged and onScroller event handlers of any objects registered as listeners. Multiple objects can be registered as listeners. To remove a listener object from a text field, call TextField.removeListener().A reference to the text field instance is passed as a parameter to the onScroller and onChanged handlers by the event source. You can capture this data by putting a parameter in the event handler method. For example, the following code uses txt as the parameter that is passed to the onScroller event handler. The parameter is then used in a trace statement to send the instance name of the text field to the Output panel.The parameter is then used in a trace() method to write the instance name of the text field to the log file.my_txt.onScroller = function(textfield_txt:TextField) { trace(textfield_txt._name+&quot; scrolled&quot;};Parameterslistener:Object - An object with an onChanged or onScroller event handler.ReturnsBoolean - ExampleThe following example defines an onChanged handler for the input text field my_txt. It then defines a new listener object, txtListener, and defines an onChanged handler for that object. This handler will be invoked when the text field my_txt is changed. The final line of code calls TextField.addListener to register the listener object txtListener with the text field my_txt so that it will be notified when my_txt changes. this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 100, 22my_txt.border = true;my_txt.type = &quot;input&quot;;my_txt.onChanged = function(textfield_(xt:TextField) { trace(textfield_txt._name+&quot; changed&quot;};var txtListener:Object = new Object(txtListener.onChanged = function(textfield_txt:TextField) { trace(textfield_txt._name+&quot; changed and notified myListener&quot;};my_txt.addListener(txtListenerSee alsoonChanged (TextField.onChanged handler), onScroller (TextField.onScroller handler), removeListener (TextField.removeListener method)" />
   <page href="00005520.html" title="_alpha (TextField._alpha property)" text="_alpha (TextField._alpha property)public _alpha : NumberSets or retrieves the alpha transparency value of the text field. Valid values are 0 (fully transparent) to 100 (fully opaque). The default value is 100. Transparency values are not supported for text fields that use device fonts. You must use embedded fonts to use the _alpha transparency property with a text field. Note: This property is not supported for Arabic, Hebrew, and Thai.ExampleThe following code sets the _alpha property of a text field named my_txt to 20%. Create a new font symbol in the library by selecting New Font from the Library options menu. Then set the linkage of the font to my font.Set the linkage for a font symbol to my font. Add the following ActionScript to your FLA or ActionScript file: var my_fmt:TextFormat = new TextFormat(my_fmt.font = &quot;my font&quot;;// where &#39;my font&#39; is the linkage name of a font in the Librarythis.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 100, 22my_txt.border = true;my_txt.embedFonts = true;my_txt.text = &quot;Hello World&quot;;my_txt.setTextFormat(my_fmtmy_txt._alpha = 20;See also_alpha (Button._alpha property), _alpha (MovieClip._alpha property)" />
   <page href="00005521.html" title="autoSize (TextField.autoSize property)" text="autoSize (TextField.autoSize property)public autoSize : ObjectControls automatic sizing and alignment of text fields. Acceptable values for autoSize are &quot;none&quot; (the default), &quot;left&quot;, &quot;right&quot;, and &quot;center&quot;. When you set the autoSize property, true is a synonym for &quot;left&quot; and false is a synonym for &quot;none&quot;. The values of autoSize and TextField.wordWrap determine whether a text field expands or contracts to the left side, right side, or bottom side. The default value for each of these properties is false.If autoSize is set to &quot;none&quot; (the default) or false, then no resizing will occur.If autoSize is set to &quot;left&quot; or true, then the text is treated as left-justified text, meaning the left side of the text field will remain fixed and any resizing of a single line text field will be on the right side. If the text includes a line break (for example, &quot; n&quot; or &quot; r&quot;), then the bottom side will also be resized to fit the next line of text. If wordWrap is also set to true, then only the bottom side of the text field will be resized and the right side will remain fixed.If autoSize is set to &quot;right&quot;, then the text is treated as right-justified text, me(ning the right side of the text field will remain fixed and any resizing of a single line text field will be on the left side. If the text includes a line break (for example, &quot; n&quot; or &quot; r&quot;), then the bottom side will also be resized to fit the next line of text. If wordWrap is also set to true, then only the bottom side of the text field will be resized and the left side will remain fixed.If autoSize is set to &quot;center&quot;, then the text is treated as center-justified text, meaning any resizing of a single line text field will be equally distributed to both the right and left sides. If the text includes a line break (for example, &quot; n&quot; or &quot; r&quot;), then the bottom side will also be resized to fit the next line of text. If wordWrap is also set to true, then only the bottom side of the text field will be resized and the left and right sides will remain fixed.ExampleYou can use the following code and enter different values for autoSize to see how the field resizes when these values change. A mouse click while the SWF file is playing will replace each text field&#39;s &quot;short text&quot; string with longer text using several different settings for autoSize.this.createTextField(&quot;left_txt&quot;, 997, 10, 10, 70, 30this.createTextField(&quot;center_txt&quot;, 998, 10, 50, 70, 30this.createTextField(&quot;right_txt&quot;, 999, 10, 100, 70, 30this.createTextField(&quot;true_txt&quot;, 1000, 10, 150, 70, 30this.createTextField(&quot;false_txt&quot;, 1001, 10, 200, 70, 30left_txt.text = &quot;short text&quot;;left_txt.border = true;center_txt.text = &quot;short text&quot;;center_txt.border = true;right_txt.text = &quot;short text&quot;;right_txt.border = true;true_txt.text = &quot;short text&quot;;true_txt.border = true;false_txt.text = &quot;short text&quot;;false_txt.border = true;// create a mouse listener object to detect mouse clicksvar myMouseListener:Object = new Object(// define a function that executes when a user clicks the mousemyMouseListener.onMouseDown = function() { left_txt.autoSize = &quot;left&quot;; left_txt.text = &quot;This is much longer text&quot;; center_txt.autoSize = &quot;center&quot;; center_txt.text = &quot;This is much longer text&quot;; right_txt.autoSize = &quot;right&quot;; right_txt.text = &quot;This is much longer text&quot;; true_txt.autoSize = true; true_txt.text = &quot;This is much longer text&quot;;  false_txt.autoSize = false; false_txt.text = &quot;This is much longer text&quot;;};// register the listener object with the Mouse objectMouse.addListener(myMouseListener" />
   <page href="00005522.html" title="background (TextField.background property)" text="background (TextField.background property)public background : BooleanSpecifies if the text field has a background fill. If true, the text field has a background fill. If false, the text field has no background fill.ExampleThe following example creates a text field with a background color that toggles on and off when nearly any key on the keyboard is pressed. this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 320, 240my_txt.border = true;my_txt.text = &quot;Lorum ipsum&quot;;my_txt.backgroundColor = 0xFF0000;var keyListener:Object = new Object(keyListener.onKeyDown = function() { my_txt.background = !my_txt.background;};Key.addListener(keyListener" />
   <page href="00005523.html" title="backgroundColor (TextField.backgroundColor property)" text="backgroundColor (TextField.backgroundColor property)public backgroundColor : NumberThe color of the text field background. Default is 0xFFFFFF (white). This property may be retrieved or set, even if there currently is no background, but the color is only visible if the text field has a border.ExampleSee the example for TextField.background.See alsobackground (TextField.background property)" />
   <page href="00005524.html" title="border (TextField.border property)" text="border (TextField.border property)public border : BooleanSpecifies if the text field has a border. If true, the text field has a border. If false, the text field has no border.ExampleThe following example creates a text field called my_txt, sets the border property to true, and displays some text in the field. this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 320, 240my_txt.border = true;my_txt.text = &quot;Lorum ipsum&quot;;" />
   <page href="00005525.html" title="borderColor (TextField.borderColor property)" text="borderColor (TextField.borderColor property)public borderColor : NumberThe color of the text field border. The default is 0x000000 (black). This property may be retrieved or set, even if there is currently no border.ExampleThe following example creates a text field called my_txt, sets the border property to true, and displays some text in the field. this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 320, 240my_txt.border = true;my_txt.borderColor = 0x00FF00;my_txt.text = &quot;Lorum ipsum&quot;;See alsoborder (TextField.border property)" />
   <page href="00005526.html" title="bottomScroll (TextField.bottomScroll property)" text="bottomScroll (TextField.bottomScroll property)public bottomScroll : Number [read-only]An integer (one-based index) that indicates the bottommost line that is currently visible the text field. Think of the text field as a window onto a block of text. The property TextField.scroll is the one-based index of the topmost visible line in the window. All the text between lines TextField.scroll and TextField.bottomScroll is currently visible in the text field.ExampleThe following example creates a text field and fills it with text. You must insert a button (with the instance name &quot;my_btn&quot;), and when you click it, the scroll and bottomScroll properties for the text field are then traced for the comment_txt field. this.createTextField(&quot;comment_txt&quot;, this.getNextHighestDepth(), 0, 0, 160, 120comment_txt.html = true;comment_txt.selectable = true;comment_txt.multiline = true;comment_txt.wordWrap = true;comment_txt.htmlText = &quot;&lt;b&gt;What is hexadecimal?&lt;/b&gt;&lt;br&gt;&quot; + &quot;The hexadecimal color system uses six digits to represent color values. &quot; + &quot;Each digit has sixteen possible values or characters. The characters range&quot; + &quot; from 0 to 9 and then A to F. Black is represented by (#000000) and white, &quot; + &quot;at the (pposite end of the color system, is (#FFFFFF).&quot;;my_btn.onRelease = function() { trace(&quot;scroll: &quot;+comment_txt.scroll trace(&quot;bottomScroll: &quot;+comment_txt.bottomScroll};" />
   <page href="00005527.html" title="condenseWhite (TextField.condenseWhite property)" text="condenseWhite (TextField.condenseWhite property)public condenseWhite : BooleanA Boolean value that specifies whether extra white space (spaces, line breaks, and so on) in an HTML text field should be removed when the field is rendered in a browser. The default value is false. If you set this value to true, you must use standard HTML commands such as &lt;BR&gt; and &lt;P&gt; to place line breaks in the text field.If the text field&#39;s .html is false, this property is ignored.ExampleThe following example creates two text fields, called first_txt and second_txt. The white space is removed from the second text field. Add the following ActionScript to your FLA or ActionScript file: var my_str:String = &quot;Hello tWorld nHow are you? t t tEnd&quot;;this.createTextField(&quot;first_txt&quot;, this.getNextHighestDepth(), 10, 10, 160, 120first_txt.html = true;first_txt.multiline = true;first_txt.wordWrap = true;first_txt.condenseWhite = false;first_txt.border = true;first_txt.htmlText = my_str;this.createTextField(&quot;second_txt&quot;, this.getNextHighestDepth(), 180, 10, 160, 120second_txt.html = true;second_txt.multiline = true;second_txt.wordWrap = true;second_txt.condenseWhite = true;second_txt.border = true;second_txt.htmlText = my_str;See alsohtml (TextField.html property)" />
   <page href="00005528.html" title="embedFonts (TextField.embedFonts property)" text="embedFonts (TextField.embedFonts property)public embedFonts : BooleanA Boolean value that specifies whether to render the text using embedded font outlines. If the value is true, Flash Lite renders the text field using embedded font outlines. If the value is false, Flash Lite renders the text field using device fonts. If you set embedFonts to true for a text field, you must specify a font for that text using the font property of a TextFormat object applied to the text field. If the specified font does not exist in the library (with the corresponding linkage identifier), the text is not displayed.Note: This property is not supported for Arabic, Hebrew, and Thai.ExampleIn this example, you need to create a dynamic text field called my_txt, and then use the following ActionScript to embed fonts and rotate the text field. The string my font refers to a font symbol in the library, with the linkage identifier name my font. The example assumes that you have a font symbol in the library called my font, with linkage properties set as follows: the identifier set to my font and Export for ActionScript and Export in First Frame selected. var my_fmt:TextFormat = new TextFormat(my_fmt.font = &quot;my font&quot;;this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 160, 120my_txt.wordWrap = true;my_txt.embedFonts = true;my_txt.text = &quot;Hello world&quot;;my_txt.setTextFormat(my_fmtmy_txt._rotation = 45;" />
   <page href="00005529.html" title="getDepth (TextField.getDepth method)" text="getDepth (TextField.getDepth method)public getDepth() : NumberReturns the depth of a text field.ReturnsNumber - An integer.ExampleThe following example demonstrates text fields residing at different depths. Create a dynamic text field on the Stage. Add the following ActionScript to your FLA or ActionScript file, which dynamically creates two text fields at runtime and outputs their depths. this.createTextField(&quot;first_mc&quot;, this.getNextHighestDepth(), 10, 10, 100, 22this.createTextField(&quot;second_mc&quot;, this.getNextHighestDepth(), 10, 10, 100, 22for (var prop in this) { if (this[prop] instanceof TextField) { var this_txt:TextField = this[prop]; trace(this_txt._name+&quot; is a TextField at depth: &quot;+this_txt.getDepth() }}" />
   <page href="00005530.html" title="getNewTextFormat (TextField.getNewTextFormat method)" text="getNewTextFormat (TextField.getNewTextFormat method)public getNewTextFormat() : TextFormatReturns a TextFormat object containing a copy of the text field&#39;s text format object. The text format object is the format that newly inserted text, such as text entered by a user, receives. When getNewTextFormat() is invoked, the TextFormat object returned has all of its properties defined. No property is null.ReturnsTextFormat - A TextFormat object.ExampleThe following example displays the specified text field&#39;s (my_txt) text format object. this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 160, 120var my_fmt:TextFormat = my_txt.getNewTextFormat(trace(&quot;TextFormat has the following properties:&quot;for (var prop in my_fmt) { trace(prop+&quot;: &quot;+my_fmt[prop]}" />
   <page href="00005531.html" title="getTextFormat (TextField.getTextFormat method)" text="getTextFormat (TextField.getTextFormat method)public getTextFormat([beginIndex:Number], [endIndex:Number]) : TextFormatReturns a TextFormat object for a character, for a range of characters, or for an entire TextField object. Usage 1:my_textField.getTextFormat()Returns a TextFormat object containing formatting information for all text in a text field. Only properties that are common to all text in the text field are set in the resulting TextFormat object. Any property which is mixed, meaning that it has different values at different points in the text, has a value of null.Usage 2:my_textField.getTextFormat(beginIndex:Number)Returns a TextFormat object containing a copy of the text field&#39;s text format at the beginIndex position.Usage 3:my_(extField.getTextFormat(beginIndex:Number,endIndex:Number)Returns a TextFormat object containing formatting information for the span of text from beginIndex to endIndex. Only properties that are common to all of the text in the specified range is set in the resulting TextFormat object. Any property that is mixed (it has different values at different points in the range) has its value set to null.ParametersbeginIndex:Number [optional] - An integer that specifies a character in a string. If you do not specify beginIndex and endIndex, the TextFormat object returned is for the entire TextField.endIndex:Number [optional] - An integer that specifies the end position of a span of text. If you specify beginIndex but do not specify endIndex, the TextFormat returned is for the single character specified by beginIndex.ReturnsTextFormat - An object.ExampleThe following ActionScript traces all of the formatting information for a text field that is created at runtime. this.createTextField(&quot;dyn_txt&quot;, this.getNextHighestDepth(), 0, 0, 100, 200dyn_txt.text = &quot;Frank&quot;;dyn_txt.setTextFormat(new TextFormat()var my_fmt:TextFormat = dyn_txt.getTextFormat(for (var prop in my_fmt) { trace(prop+&quot;: &quot;+my_fmt[prop]}See alsogetNewTextFormat (TextField.getNewTextFormat method), setNewTextFormat (TextField.setNewTextFormat method), setTextFormat (TextField.setTextFormat method)" />
   <page href="00005532.html" title="_height (TextField._height property)" text="_height (TextField._height property)public _height : NumberThe height of the text field in pixels.ExampleThe following code example sets the height and width of a text field: my_txt._width = 200;my_txt._height = 200;" />
   <page href="00005533.html" title="_highquality (TextField._highquality property)" text="_highquality (TextField._highquality property)public _highquality : NumberDeprecated since Flash Player 7. This property was deprecated in favor of TextField._quality.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.See also_quality (TextField._quality property)" />
   <page href="00005534.html" title="hscroll (TextField.hscroll property)" text="hscroll (TextField.hscroll property)public hscroll : NumberIndicates the current horizontal scrolling position. If the hscroll property is 0, the text is not horizontally scrolled. The units of horizontal scrolling are pixels, while the units of vertical scrolling are lines. Horizontal scrolling is measured in pixels because most fonts you typically use are proportionally spaced; meaning, the characters can have different widths. Flash performs vertical scrolling by line because users usually want to see a line of text in its entirety, as opposed to seeing a partial line. Even if there are multiple fonts on a line, the height of the line adjusts to fit the largest font in use.Note: The hscroll property is zero-basednot one-based like the vertical scrolling property TextField.scroll.ExampleThe following example scrolls the my_txt text field horizontally using two buttons called scrollLeft_btn and scrollRight_btn. The amount of scroll appears in a text field called scroll_txt. Add the following ActionScript to your FLA or ActionScript file: this.createTextField(&quot;scroll_txt&quot;, this.getNextHighestDepth(), 10, 10, 160, 20this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 30, 160, 22my_txt.border = true;my_txt.multiline = false;my_txt.wordWrap = false;my_txt.text = &quot;Lorem ipsum dolor sit amet, consectetuer adipiscing...&quot;;scrollLeft_btn.onRelease = function() { my_txt.hscroll -= 10; scroll_txt.text = my_txt.hscroll+&quot; of &quot;+my_txt.maxhscroll;};scrollRight_btn.onRelease = function() { my_txt.hscroll += 10; scroll_txt.text = my_txt.hscroll+&quot; of &quot;+my_txt.maxhscroll;};See alsomaxhscroll (TextField.maxhscroll property), scroll (TextField.scroll property)" />
   <page href="00005535.html" title="html (TextField.html property)" text="html (TextField.html property)public html : BooleanA flag that indicates whether the text field contains an HTML representation. If the html property is true, the text field is an HTML text field. If html is false, the text field is a non-HTML text field.ExampleThe following example creates a text field that sets the html property to true. HTML-formatted text appears in the text field. this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 160, 22my_txt.html = true;my_txt.htmlText = &quot;&lt;b&gt; this is bold text &lt;/b&gt;&quot;;See alsohtmlText (TextField.htmlText property)" />
   <page href="00005536.html" title="htmlText (TextField.htmlText property)" text="htmlText (TextField.htmlText property)public htmlText : StringIf the text field is an HTML text field, this property contains the HTML representation of the text field&#39;s contents. If the text field is not an HTML text field, it behaves identically to the text property. You can indicate that a text field is an HTML text field in the Property inspector, or by setting the text field&#39;s html property to true.ExampleThe following example creates a text field that sets the html property to true. HTML-formatted text appears in the text field. this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 160, 22my_txt.html = true;my_txt.htmlText = &quot;&lt; this is bold text &gt;&quot;;See alsohtml (TextField.html property)" />
   <page href="00005537.html" title="length (TextField.length property)" text="length (TextField.length property)public length : Number [read-only]Indicates the number of characters in a text field. This property returns the same value as text.length, but is faster. A character such as tab ( t) counts as one character.ExampleThe following example outputs the number of characters in the date_txt text field, which displays the current date. var today:Date = new Date(this.createTextField(&quot;date_txt&quot;, this.getNextHighestDepth(), 10, 10, 100, 22date_txt.autoSize = true;date_txt.text = today.toString(trace(date_txt.length" />
   <page href="00005538.html" title="maxChars (TextField.maxChars property)" text="maxChars (TextField.maxChars property)public maxChars : NumberIndicates the maximum number of characters that the text field can contain. A script may insert more text than maxChars allows; the maxChars property indicates only how much text a user can enter. If the value of this property is null, there is no limit on the amount of text a user can enter.ExampleThe following example creates a text field called age_txt that only lets users enter up to two numbers in the field. this.createTextField(&quot;age_txt&quot;, this.getNextHighestDepth(), 10, 10, 30, 22age_txt.type = &quot;input&quot;;age_txt.border = true;age_txt.maxChars = 2;" />
   <page href="00005539.html" title="maxhscroll (TextField.maxhscroll property)" text="maxhscroll (TextField.maxhscroll property)public maxhscroll : Number [read-only]Indicates the maximum value of TextField.hscroll.ExampleSee the example for TextField.hscroll." />
   <page href="00005540.html" title="maxscroll (TextField.maxscroll property)" text="maxscroll (TextField.maxscroll property)public maxscroll : Number [read-only]Indicates the maximum value of TextField.scroll.ExampleThe following example sets the ma(imum value for the scrolling text field my_txt. Create two buttons, scrollUp_btn and scrollDown_btn, to scroll the text field. Add the following ActionScript to your FLA or ActionScript file. this.createTextField(&quot;scroll_txt&quot;, this.getNextHighestDepth(), 10, 10, 160, 20this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 30, 320, 240my_txt.multiline = true;my_txt.wordWrap = true;for (var i = 0; i&lt;10; i++) { my_txt.text += &quot;Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh &quot; + &quot;euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.&quot;;}scrollUp_btn.onRelease = function() { my_txt.scroll--; scroll_txt.text = my_txt.scroll+&quot; of &quot;+my_txt.maxscroll;};scrollDown_btn.onRelease = function() { my_txt.scroll++; scroll_txt.text = my_txt.scroll+&quot; of &quot;+my_txt.maxscroll;};" />
   <page href="00005541.html" title="multiline (TextField.multiline property)" text="multiline (TextField.multiline property)public multiline : BooleanIndicates whether the text field is a multiline text field. If the value is true, the text field is multiline; if the value is false, the text field is a single-line text field.ExampleThe following example creates a multiline text field called myText. this.createTextField(&quot;myText&quot;, this.getNextHighestDepth(), 10, 30, 110, 100myText.text = &quot;Flash is an authoring tool that designers and developers use to create presentations,applications, and other content that enables user interaction.&quot;;myText.border = true;myText.wordWrap = true;myText.multiline = true;" />
   <page href="00005542.html" title="_name (TextField._name property)" text="_name (TextField._name property)public _name : StringThe instance name of the text field.ExampleThe following example demonstrates text fields residing at different depths. Create a dynamic text field on the Stage. Add the following ActionScript to your FLA or ActionScript file, which dynamically creates two text fields at runtime and displays their depths in the Output panel. this.createTextField(&quot;first_mc&quot;, this.getNextHighestDepth(), 10, 10, 100, 22this.createTextField(&quot;second_mc&quot;, this.getNextHighestDepth(), 10, 10, 100, 22for (var prop in this) { if (this[prop] instanceof TextField) { var this_txt:TextField = this[prop]; trace(this_txt._name+&quot; is a TextField at depth: &quot;+this_txt.getDepth() }}When you test the document, the instance name and depth is displayed in the Output panel.When you test the document, the instance name and depth writes to the log file." />
   <page href="00005543.html" title="onChanged (TextField.onChanged handler)" text="onChanged (TextField.onChanged handler)onChanged = function(changedField:TextField) {}Event handler/listener; invoked when the content of a text field changes. By default, it is undefined; you can define it in a script. A reference to the text field instance is passed as a parameter to the onChanged handler. You can capture this data by putting a parameter in the event handler method. For example, the following code uses textfield_txt as the parameter that is passed to the onChanged event handler. The parameter is then used in a trace() statement to send the instance name of the text field to the Output panel: this.createTextField(&quot;myInputText_txt&quot;, 99, 10, 10, 300, 20myInputText_txt.border = true;myInputText_txt.type = &quot;input&quot;;myInputText_txt.onChanged = function(textfield_txt:TextField) {trace(&quot;the value of &quot;+textfield_txt._name+&quot; was changed. New value is: &quot;+textfield_txt.text};The onChanged handler is called only when the change results from user interaction; for example, when the user is typing something on the keyboard, changing something in the text field using the mouse, or selecting a menu item. Programmatic changes to the text field do not trigger the onChanged event because the code recognizes changes that are made to the text field.ParameterschangedField:TextField - The field triggering the event.See alsogetNewTextFormat (TextField.getNewTextFormat method), setNewTextFormat (TextField.setNewTextFormat method)" />
   <page href="00005544.html" title="onKillFocus (TextField.onKillFocus handler)" text="onKillFocus (TextField.onKillFocus handler)onKillFocus = function(newFocus:Object) {}Invoked when a text field loses keyboard focus. The onKillFocus method receives one parameter, newFocus, which is an object representing the new object receiving the focus. If no object receives the focus, newFocus contains the value null.ParametersnewFocus:Object - The object that is receiving the focus.ExampleThe following example creates two text fields called first_txt and second_txt. When you give focus to a text field, information about the text field with current focus and the text field that lost focus is displayed in the Output panel. this.createTextField(&quot;first_txt&quot;, 1, 10, 10, 300, 20first_txt.border = true;first_txt.type = &quot;input&quot;;this.createTextField(&quot;second_txt&quot;, 2, 10, 40, 300, 20second_txt.border = true;second_txt.type = &quot;input&quot;;first_txt.onKillFocus = function(newFocus:Object) { trace(this._name+&quot; lost focus. New focus changed to: &quot;+newFocus._name};first_txt.onSetFocus = function(oldFocus:Object) { trace(this._name+&quot; gained focus. Old focus changed from: &quot;+oldFocus._name}See alsoonSetFocus (TextField.onSetFocus handler)" />
   <page href="00005545.html" title="onScroller (TextField.onScroller handler)" text="onScroller (TextField.onScroller handler)onScroller = function(scrolledField:TextField) {}Event handler/listener; invoked when one of the text field scroll properties changes. A reference to the text field instance is passed as a parameter to the onScroller handler. You can capture this data by putting a parameter in the event handler method. For example, the following code uses my_txt as the parameter that is passed to the onScroller event handler. The parameter is then used in a trace() statement to send the instance name of the text field to the Output panel. myTextField.onScroller = function (my_txt:TextField) { trace (my_txt._name + &quot; scrolled&quot;};The TextField.onScroller event handler is commonly used to implement scroll bars. Scroll bars typically have a thumb or other indicator that shows the current horizontal or vertical scrolling position in a text field. Text fields can be navigated using the mouse and keyboard, which causes the scroll position to change. The scroll bar code needs to be notified if the scroll position changes because of such user interaction, which is what TextField.onScroller is used for.onScroller is called whether the scroll position changed because of a users interaction with the text field, or programmatic changes. The onChanged handler fires only if a user interaction causes the change. These two options are necessary because often one piece of code changes the scrolling position, while the scroll bar code is unrelated and won&#39;t know that the scroll position changed without being notified.ParametersscrolledField:TextField - A reference to the TextField object whose scroll position was changed.ExampleThe following example creates a text field called my_txt, and uses two buttons called scrollUp_btn and scrollDown_btn to scroll the contents of the text field. When the onScroller event handler is called, a trace statement is used to display information in the Output panel. Create two buttons with instance names scrollUp_btn and scrollDown_btn, and add the following ActionScript to your FLA or ActionScript file: this.createTextField(&quot;scroll_txt&quot;, this.getNextHighestDepth(), 10, 10, 160, 20this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 30, 320, 240my_txt.multiline = true;my_txt.wordWrap = true;for (var i = 0; i&lt;10; i++) { my_txt.text += &quot;Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam &quot; + &quot;nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.&quot;;}scrollUp_btn.onRelease = function() { my_txt.scroll--;};scrollDown_btn.onRelease = function() { my_txt.scroll++;};my_txt.onScroller = function() { trace(&quot;onScroller called&quot; scroll_txt.text = my_txt.scroll+&quot; of &quot;+my_txt.maxscroll;};See alsohscroll (TextField.hscroll property), maxhscroll (TextField.maxhscroll property), maxscroll (TextField.maxscroll property), scroll (TextField.scroll property)" />
   <page href="00005546.html" title="onSetFocus (TextField.onSetFocus handler)" text="onSetFocus (TextField.onSetFocus handler)onSetFocus = function(oldFocus:Object) {}Invoked when a text field 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 button to a text field, oldFocus contains the button instance. If there is no previously focused object, oldFocus contains a null value.ParametersoldFocus:Object - The object to lose focus.ExampleSee the example for TextField.onKillFocus.See alsoonKillFocus (TextField.onKillFocus handler)" />
   <page href="00005547.html" title="_parent (TextField._parent property)" text="_parent (TextField._parent property)public _parent : MovieClipA reference to the movie clip or object that contains the current text field 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 text field. You can use _parent to climb up multiple levels in the display list as in the following:_parent._parent._alpha = 20;ExampleThe following ActionScript creates two text fields and outputs information about the _parent of each object. The first text field, first_txt, is created on the main Timeline. The second text field, second_txt, is created inside the movie clip called holder_mc. this.createTextField(&quot;first_txt&quot;, this.getNextHighestDepth(), 10, 10, 160, 22first_txt.border = true;trace(first_txt._name+&quot;&#39;s _parent is: &quot;+first_txt._parentthis.createEmptyMovieClip(&quot;holder_mc&quot;, this.getNextHighestDepth()holder_mc.createTextField(&quot;second_txt&quot;, holder_mc.getNextHighestDepth(), 10, 40, 160, 22holder_mc.second_txt.border = true;trace(holder_mc.second_txt._name+&quot;&#39;s _parent is: &quot;+holder_mc.second_txt._parentThe following information is displayed in the Output panel:The following information writes to the log file:first_txt&#39;( _parent is: _level0second_txt&#39;s _parent is: _level0.holder_mcSee also_parent (Button._parent property), _parent (MovieClip._parent property), _root property" />
   <page href="00005548.html" title="password (TextField.password property)" text="password (TextField.password property)public password : BooleanSpecifies whether the text field is a password text field. If the value of password is true, the text field is a password text field: once the user completes entering the password and clicks OK, the text field hides the input characters using asterisks instead of the actual characters. If false, the text field is not a password text field. When password mode is enabled, the Cut and Copy commands and their corresponding keyboard accelerators will not function. This security mechanism prevents an unscrupulous user from using the shortcuts to discover a password on an unattended computer.ExampleThe following example creates two text fields: username_txt and password_txt. Text is entered into both text fields; however, password_txt has the password property set to true. After the user clicks OK to complete the password entry, the characters display as asterisks instead of as characters in the password_txt field. this.createTextField(&quot;username_txt&quot;, this.getNextHighestDepth(), 10, 10, 100, 22username_txt.border = true;username_txt.type = &quot;input&quot;;username_txt.maxChars = 16;username_txt.text = &quot;hello&quot;; this.createTextField(&quot;password_txt&quot;, this.getNextHighestDepth(), 10, 40, 100, 22password_txt.border = true;password_txt.type = &quot;input&quot;;password_txt.maxChars = 16;password_tx(.password = true;password_txt.text = &quot;world&quot;;" />
   <page href="00005549.html" title="_quality (TextField._quality property)" text="_quality (TextField._quality property)public _quality : StringProperty (global sets or retrieves the rendering quality used for a SWF file. Device fonts are always aliased and, therefore, are unaffected by the _quality property. Note: Although you can specify this property for a TextField object, it is actually a global property, and you can specify its value simply as _quality. For more information, see the _quality property.The _quality property can be set to the following values: &quot;LOW&quot; Low rendering quality. Graphics are not anti-aliased, and bitmaps are not smoothed.&quot;MEDIUM&quot; Medium rendering quality. Graphics are anti-aliased using a 2 x 2 pixel grid, but bitmaps are not smoothed. The quality is suitable for movies that do not contain text.&quot;HIGH&quot; High rendering quality. Graphics are anti-aliased using a 4 x 4 pixel grid, and bitmaps are smoothed if the movie is static. This is the default rendering quality used by Flash.&quot;BEST&quot; Very high rendering quality. Graphics are anti-aliased using a 4 x 4 pixel grid and bitmaps are always smoothed.Note: This property is not supported for Arabic, Hebrew, and Thai.ExampleThe following example sets the rendering quality to LOW: my_txt._quality = &quot;LOW&quot;;See also_quality property" />
   <page href="00005550.html" title="removeListener (TextField.removeListener method)" text="removeListener (TextField.removeListener method)public removeListener(listener:Object) : BooleanRemoves a listener object previously registered to a text field instance with TextField.addListener().Parameterslistener:Object - The object that will no longer receive notifications from TextField.onChanged or TextField.onScroller.ReturnsBoolean - If listener was successfully removed, the method returns a true value. If listener was not successfully removed (for example, if listener was not on the TextField object&#39;s listener list), the method returns a value of false.ExampleThe following example creates an input text field called my_txt. When the user types into the field, information about the number of characters in the text field is displayed in the Output panel. When the user types into the field, information about the number of characters in the text field writes to the log file. If the user clicks the removeListener_btn instance, then the listener is removed and information is no longer displayed. If the user clicks the removeListener_btn instance, then the listener is removed and information no longer writes to the log file. this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 160, 20my_txt.border = true;my_txt.type = &quot;input&quot;;var txtListener:Object = new Object(txtListener.onChanged = function(textfield_txt:TextField) { trace(textfield_txt+&quot; changed. Current length is: &quot;+textfield_txt.length};my_txt.addListener(txtListenerremoveListener_btn.onRelease = function() { trace(&quot;Removing listener...&quot; if (!my_txt.removeListener(txtListener)) { trace(&quot;Error! Unable to remove listener&quot; }}; (" />
   <page href="00005551.html" title="removeTextField (TextField.removeTextField method)" text="removeTextField (TextField.removeTextField method)public removeTextField() : VoidRemoves the text field. This operation can only be performed on a text field that was created with MovieClip.createTextField(). When you call this method, the text field is removed. This method is similar to MovieClip.removeMovieClip().ExampleThe following example creates a text field that you can remove from the Stage when you click the remove_btn instance. Create a button and call it remove_btn, and then add the following ActionScript to your FLA or ActionScript file. this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 300, 22my_txt.text = new Date().toString(my_txt.border = true;remove_btn.onRelease = function() { my_txt.removeTextField(};" />
   <page href="00005552.html" title="replaceSel (TextField.replaceSel method)" text="replaceSel (TextField.replaceSel method)public replaceSel(newText:String) : VoidReplaces the current selection with the contents of the newText parameter. The text is inserted at the position of the current selection, using the current default character format and default paragraph format. The text is not treated as HTML, even if the text field is an HTML text field. You can use the replaceSel() method to insert and delete text without disrupting the character and paragraph formatting of the rest of the text.Note: You must use the Selection.setFocus() method to focus the field before you call the replaceSel() method.ParametersnewText:String - A string.ExampleThe following example code creates a multiline text field with text on the Stage. When you select some text and then right-click or Control-click over the text field, you can select Enter current date from the context menu. This selection calls a function that replaces the selected text with the current date. this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 320, 240my_txt.border = true;my_txt.wordWrap = true;my_txt.multiline = true;my_txt.type = &quot;input&quot;;my_txt.text = &quot;Select some sample text from the text field and then right-click/control click &quot; + &quot;and select &#39;Enter current date&#39; from the context menu to replace the &quot; + &quot;currently selected text with the curr(nt date.&quot;;var my_cm:ContextMenu = new ContextMenu(my_cm.customItems.push(new ContextMenuItem(&quot;Enter current date&quot;, enterDate)function enterDate(obj:Object, menuItem:ContextMenuItem) { var today_str:String = new Date().toString( var date_str:String = today_str.split(&quot; &quot;, 3).join(&quot; &quot; my_txt.replaceSel(date_str}my_txt.menu = my_cm;See alsosetFocus (Selection.setFocus method)" />
   <page href="00005553.html" title="replaceText (TextField.replaceText method)" text="replaceText (TextField.replaceText method)public replaceText(beginIndex:Number, endIndex:Number, newText:String) : VoidReplaces a range of characters, specified by the beginIndex and endIndex parameters, in the specified text field with the contents of the newText parameter.ParametersbeginIndex:Number - The start index value for the replacement range.endIndex:Number - The end index value for the replacement range.newText:String - The text to use to replace the specified range of characters.ExampleThe following example creates a text field called my_txt and assigns the text dog@house.net to the field. The indexOf() method is used to find the first occurrence of the specified symbol (@). If the symbol is found, the specified text (between the index of 0 and the symbol) replaces with the string bird. If the symbol is not found, an error message is displayed in the Output panel.If the symbol is not found, an error message writes to the log file. this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 320, 22my_txt.autoSize = true;my_txt.text = &quot;dog@house.net&quot;;var symbol:String = &quot;@&quot;;var symbolPos:Number = my_txt.text.indexOf(symbolif (symbolPos&gt;-1) { my_txt.replaceText(0, symbolPos, &quot;bird&quot;} else { trace(&quot;symbol &#39;&quot;+symbol+&quot;&#39; not found.&quot;}" />
   <page href="00005554.html" title="_rotation (TextField._rotation property)" text="_rotation (TextField._rotation property)public _rotation : NumberThe rotation of the text field, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement my_txt._rotation = 450 is the same as my_txt._rotation = 90. Rotation values are not supported for text fields that use device fonts. You must use embedded fonts to use _rotation with a text field.Note: This property is not supported for Arabic, Hebrew, and Thai.ExampleIn this example, you need to create a dynamic text field called my_txt, and then use the following ActionScript to embed fonts and rotate the text field. The string my font refers to a font symbol in the library, with a linkage identifier of my font. var my_fmt:TextFormat = new TextFormat(my_fmt.font = &quot;my font&quot;;this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 160, 120my_txt.wordWrap = true;my_txt.embedFonts = true;my_txt.text = &quot;Hello world&quot;;my_txt.setTextFormat(my_fmtmy_txt._rotation = 45;Apply additional formatting for the text field using the TextFormat class.See also_rotation (Button._rotation property), _rotation (MovieClip._rotation property), getNewTextFormat (TextField.getNewTextFormat method)" />
   <page href="00005555.html" title="scroll (TextField.scroll property)" text="scroll (TextField.scroll property)public scroll : NumberDefines the vertical position of text in a text field. The scroll property is useful for directing users to a specific paragraph in a long passage, or creating scrolling text fields. This property can be retrieved and modified. The units of horizontal scrolling are pixels, while the units of vertical scrolling are lines. Horizontal scrolling is measured in pixels because most fonts you typically use are proportionally spaced; meaning, the characters can have different widths. Flash performs vertical scrolling by line because users usually want to see a line of text in its entirety, as opposed to seeing a partial line. Even if there are multiple fonts on a line, the height of the line adjusts to fit the largest font in use.ExampleThe following example sets the maximum value for the scrolling text field my_txt. Create two buttons, scrollUp_btn and scrollDown_btn, to scroll the text field. Add the following ActionScript to your FLA or ActionScript file. this.createTextField(&quot;scroll_txt&quot;, this.getNextHighestDepth(), 10, 10, 160, 20this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 30, 320, 240my_txt.multiline = true;my_txt.wordWrap = true;for (var i = 0; i&lt;10; i++) { my_txt.text += &quot;Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy &quot; + &quot;nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.&quot;;}scrollUp_btn.onRelease = function() { my_txt.scroll--; scroll_txt.text = my_txt.scroll+&quot; of &quot;+my_txt.maxscroll;};scrollDown_btn.onRelease = function() { my_txt.scroll++; scroll_txt.text = my_txt.scroll+&quot; of &quot;+my_txt.maxscroll;};See alsohscroll (TextField.hscroll property), maxscroll (TextField.maxscroll property)" />
   <page href="00005556.html" title="selectable (TextField.selectable property)" text="selectable (TextField.selectable property)public selectable : BooleanA Boolean value that indicates whether the text field is selectable. If the value is true, the text is selectable. The selectable property controls whether a text field is selectable, not whether a text field is editable. A dynamic text field can be selectable even if it is not editable. If a dynamic text field is not selectable, you cannot select its text. If selectable is set to false, the text in the text field does not respond to selection commands from the mouse or keyboard, and the text cannot be copied using the Copy command. If selectable is set to true, the text in the text field can be selected using the mouse or keyboard. You can select text this way even if the text field is a dynamic text field instead of an input text field. You can also copy the text using the Copy command.Note: This property is not supported for Arabic, Hebrew, and Thai.ExampleThe following example creates a selectable text field that constantly updates with the current date and time. this.createTextField(&quot;date_txt&quot;, this.getNextHighestDepth(), 10, 10, 100, 22date_txt.autoSize = true;date_txt.selectable = true;( var date_interval:Number = setInterval(updateTime, 500, date_txtfunction updateTime(my_txt:TextField) { my_txt.text = new Date().toString(}" />
   <page href="00005557.html" title="setNewTextFormat (TextField.setNewTextFormat method)" text="setNewTextFormat (TextField.setNewTextFormat method)public setNewTextFormat(tf:TextFormat) : VoidSets the default new text format of a text field. The default new text format is the new text format used for newly inserted text such as text entered by a user. When text is inserted, the newly inserted text is assigned the default new text format. The new default text format is specified by textFormat, which is a TextFormat object.Parameterstf:TextFormat - A TextFormat object.ExampleIn the following example, a new text field (called my_txt) is created at runtime and several properties are set. The format of the newly inserted text is applied. var my_fmt:TextForma( = new TextFormat(my_fmt.bold = true;my_fmt.font = &quot;Arial&quot;;my_fmt.color = 0xFF9900;this.createTextField(&quot;my_txt&quot;, 999, 0, 0, 400, 300my_txt.wordWrap = true;my_txt.multiline = true;my_txt.border = true;my_txt.type = &quot;input&quot;;my_txt.setNewTextFormat(my_fmtmy_txt.text = &quot;Oranges are a good source of vitamin C&quot;;See alsogetNewTextFormat (TextField.getNewTextFormat method), getTextFormat (TextField.getTextFormat method), setTextFormat (TextField.setTextFormat method)" />
   <page href="00005558.html" title="setTextFormat (TextField.setTextFormat method)" text="setTextFormat (TextField.setTextFormat method)public setTextFormat([beginIndex:Number], [endIndex:Number], textFormat:TextFormat) : VoidApplies the text formatting specified by the textFormat parameter to some or all of the text in a text field. textFormat must be a TextFormat object that specifies the text formatting changes desired. Only the non-null properties of textFormat are applied to the text field. Any property of textFormat that is set to null will not be applied. By default, all of the properties of a newly created TextFormat object are set to null. There are two types of formatting information in a TextFormat object: character level, and paragraph level formatting. Each character in a text field might have its own character formatting settings, such as font name, font size, bold, and italic.For paragraphs, the first character of the paragraph is examined for the paragraph formatting settings for the entire paragraph. Examples of paragraph formatting settings are left margin, right margin, and indentation.The setTextFormat() method changes the text formatting applied to an individual character, to a range of characters, or to the entire body of text in a text field:Usage 1:my_textField.setTextFormat(textFormat:TextFormat)Applies the properties of textFormat to all text in the text field.Usage 2:my_textField.setTextFormat(beginIndex:Number, textFormat:TextFormat)Applies the properties of textFormat to the character at the beginIndex position.Usage 3:my_textField.setTextFormat(beginIndex:Number, endIndex:Number, textFormat:TextFormat)Applies the properties of the textFormat parameter to the span of text from the beginIndex position to the endIndex position.Notice that any text inserted manually by the user receives the text field&#39;s default formatting for new text, and not the formatting specified for the text insertion point. To set a text field&#39;s default formatting for new text, use TextField.setNewTextFormat().ParametersbeginIndex:Number [optional] - An integer that specifies the first character of the desired text span. If you do not specify beginIndex and endIndex, the TextFormat is applied to the entire TextField.endIndex:Number [optional] - An integer that specifies the first character after the desired text span. If you specify beginIndex but(do not specify endIndex, the TextFormat is applied to the single character specified by beginIndex.textFormat:TextFormat - A TextFormat object, which contains character and paragraph formatting information.ExampleThe 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 = &quot;Arial&quot;;var format2_fmt:TextFormat = new TextFormat(format2_fmt.font = &quot;Courier&quot;;var string1:String = &quot;Sample string number one.&quot;+newline;var string2:String = &quot;Sample string number two.&quot;+newline;this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 0, 0, 300, 200my_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_fmtmy_txt.setTextFormat(firstIndex, secondIndex, format2_fmtSee alsogetNewTextFormat (TextField.getNewTextFormat method), setNewTextFormat (TextField.setNewTextFormat method)" />
   <page href="00005559.html" title="_soundbuftime (TextField._soundbuftime property)" text="_soundbuftime (TextField._soundbuftime property)public _soundbuftime : NumberSpecifies the number of seconds a sound prebuffers before it starts to stream. Note: Although you can specify this property for a TextField object, it is actually a global property that applies to all sounds loaded, and you can specify its value simply as _soundbuftime. Setting this property for a TextField object actually sets the global property. For more information and an example, see _soundbuftime.See also_soundbuftime property" />
   <page href="00005560.html" title="tabEnabled (TextField.tabEnabled property)" text="tabEnabled (TextField.tabEnabled property)public tabEnabled : BooleanSpecifies whether the text field is included in automatic tab ordering. It is undefined by default. If the tabEnabled property is undefined or true, the object is included in automatic tab ordering. If the tabIndex property is also set to a value, the object is included in custom tab ordering as well. If tabEnabled is false, the object is not included in automatic or custom tab ordering, even if the tabIndex property is set.ExampleThe following example creates several text fields, called one_txt, two_txt, three_txt and four_txt. The three_txt text field has the tabEnabled property set to false, so it is excluded from the automatic tab ordering. this.createTextField(&quot;one_txt&quot;, this.getNextHighestDepth(), 10, 10, 100, 22one_txt.border = true;one_txt.type = &quot;input&quot;;this.createTextField(&quot;two_txt&quot;, this.getNextHighestDepth(), 10, 40, 100, 22two_txt.border = true;two_txt.type = &quot;input&quot;;this.createTextField(&quot;three_txt&quot;, this.getNextHighestDepth(), 10, 70, 100, 22three_txt.border = true;three_txt.type = &quot;input&quot;;this.createTextField(&quot;four_txt&quot;, this.getNextHighestDepth(), 10, 100, 100, 22four_txt.border = true;four_txt.type = &quot;input&quot;;three_txt.tabEnabled = false;three_txt.text = &quot;tabEnabled = false;&quot;;See alsotabEnabled (Button.tabEnabled property), tabEnabled (MovieClip.tabEnabled property)" />
   <page href="00005561.html" title="tabIndex (TextField.tabIndex property)" text="tabIndex (TextField.tabIndex property)public tabIndex : NumberLets you customize the tab ordering of objects in a SWF file. You can set the tabIndex property on a button, movie clip, or text field instance; it is undefined by default. If any currently displayed object in the SWF file contains a tabIndex property, automatic tab ordering is disabled, and the tab ordering is calculated from the tabIndex properties of objects in the SWF file. The custom tab ordering only includes objects that have tabIndex properties.The tabIndex property must be a positive integer. The objects are ordered according to their tabIndex properties, in ascending order. An object with a tabIndex value of 1 precedes an object with a tabIndex value of 2. If two objects have the same tabIndex value, the one that precedes the other in the tab ordering is undefined.The custom tab ordering defined by the tabIndex property is flat. This means that no attention is paid to the hierarchical relationships of objects in the SWF file. All objects in the SWF file with tabIndex properties are placed in the tab order, and the tab order is determined by the order of the tabIndex values. If two objects have the same tabIndex value, the one that goes first is undefined. You should not use th( same tabIndex value for multiple objects.ExampleThe following ActionScript dynamically creates four text fields and assigns them to a custom tab order. Add the following ActionScript to your FLA or ActionScript file: this.createTextField(&quot;one_txt&quot;, this.getNextHighestDepth(), 10, 10, 100, 22one_txt.border = true;one_txt.type = &quot;input&quot;;this.createTextField(&quot;two_txt&quot;, this.getNextHighestDepth(), 10, 40, 100, 22two_txt.border = true;two_txt.type = &quot;input&quot;;this.createTextField(&quot;three_txt&quot;, this.getNextHighestDepth(), 10, 70, 100, 22three_txt.border = true;three_txt.type = &quot;input&quot;;this.createTextField(&quot;four_txt&quot;, this.getNextHighestDepth(), 10, 100, 100, 22four_txt.border = true;four_txt.type = &quot;input&quot;;one_txt.tabIndex = 3;two_txt.tabIndex = 1;three_txt.tabIndex = 2;four_txt.tabIndex = 4;See alsotabIndex (Button.tabIndex property), tabIndex (MovieClip.tabIndex property)" />
   <page href="00005562.html" title="_target (TextField._target property)" text="_target (TextField._target property)public _target : String [read-only]The target path of the text field instance. The _self target specifies the current frame in the current window, _blank specifies a new window, _parent specifies the parent of the current frame, and _top specifies the top-level frame in the current window.ExampleThe following ActionScript creates a text field called my_txt and outputs the target path of the new field, in both slash and dot notation. this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 100, 22trace(my_txt._target // output: /my_txttrace(eval(my_txt._target) // output: _level0.my_txt" />
   <page href="00005563.html" title="text (TextField.text property)" text="text (TextField.text property)public text : StringIndicates the current text in the text field. Lines are separated by the carriage return character (&quot; r&quot;, ASCII 13). This property contains the normal, unformatted text in the text field, without HTML tags, even if the text field is HTML.ExampleThe following example creates an HTML text field called my_txt, and assigns an HTML-formatted string of text to the field. When you trace the htmlText property, the Output panel displays the HTML-formatted stringthe HTML-formatted string writes to the log file. When you trace the value of the text property, the unformatted string with HTML tags appears in the Output panel.When you trace the value of the text property, the unformatted string with HTML tags writes to the log file. this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 10, 400, 22my_txt.html = true;my_txt.htmlText = &quot;&lt;b&gt;Remember to always update the help panel.&lt;/b&gt;&quot;;trace(&quot;htmlText: &quot;+my_txt.htmlTexttrace(&quot;text: &quot;+my_txt.text// output:htmlText: &lt;P ALIGN=&quot;LEFT&quot;&gt;&lt;FONT FACE=&quot;Times New Roman&quot; SIZE=&quot;12&quot; COLOR=&quot;#000000&quot;&gt;&lt;B&gt;Remember to always update your help panel.&lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;text: Remember to always update your help panel.See alsohtmlText (TextField.htmlText property)" />
   <page href="00005564.html" title="textColor (TextField.textColor property)" text="textColor (TextField.textColor property)public textColor : NumberIndicates the color of the text in a text field. The hexadecimal color system uses six digits to represent color values. Each digit has sixteen possible values or characters. The characters range from 0 to 9 and then A to F. Black is represented by (#000000) and white, at the opposite end of the color system, is (#FFFFFF).ExampleThe following ActionScript creates a text field and changes its color property to red. this.createTextField(&quot;my_txt&quot;, 99, 10, 10, 100, 300my_txt.text = &quot;this will be red text&quot;;my_txt.textColor = 0xFF0000;" />
   <page href="00005565.html" title="textHeight (TextField.textHeight property)" text="textHeight (TextField.textHeight property)public textHeight : NumberIndicates the height of the text.ExampleThe following example creates a text field, and assigns a string of text to the field. A trace statement is used to display the text height and width in the Output panel. The trace() method is used to write the text height and width in the log file. The autoSize property is then used to resize the text field, and the new height and width will also be displayed in the Output panel.The autoSize property is then used to resize the text field, and the new height and width also write to the log file. this.createTextField(&quot;my_txt&quot;, 99, 10, 10, 100, 300my_txt.text = &quot;Sample text&quot;;trace(&quot;textHeight: &quot;+my_txt.textHeight+&quot;, textWidth: &quot;+my_txt.textWidthtrace(&quot;_height: &quot;+my_txt._height+&quot;, _width: &quot;+my_txt._width+&quot; n&quot;my_txt.autoSize = true;trace(&quot;after my_txt.autoSize = true;&quot;trace(&quot;_height: &quot;+my_txt._height+&quot;, _width: &quot;+my_txt._widthWhich outputs the following information:textHeight: 15, textWidth: 56_height: 300, _width: 100after my_txt.autoSize = true;_height: 19, _width: 60See alsotextWidth (TextField.textWidth property)" />
   <page href="00005566.html" title="textWidth (TextField.textWidth property)" text="textWidth (TextField.textWidth property)public textWidth : NumberIndicates the width of the text.ExampleSee the example for TextField.textHeight.See alsotextHeight (TextField.textHeight property)" />
   <page href="00005567.html" title="type (TextField.type property)" text="type (TextField.type property)public type : StringSpecifies the type of text field. There are two values: &quot;dynamic&quot;, which specifies a dynamic text field that cannot be edited by the user, and &quot;input&quot;, which specifies an input text field.ExampleThe following example creates two text fields: username_txt and password_txt. Text is entered into both text fields; however, password_txt has the password property set to true. Therefore, the characters display as asterisks instead of as characters in the password_txt field. this.createTextField(&quot;username_txt&quot;, this.getNextHighestDepth(), 10, 10, 100, 22username_txt.border = true;username_txt.type = &quot;input&quot;;username_txt.maxChars = 16;username_txt.text = &quot;hello&quot;;this.createTextField(&quot;password_txt&quot;, this.getNextHighestDepth(), 10, 40, 100, 22password_txt.border = true;password_txt.type = &quot;input&quot;;password_txt.maxChars = 16;password_txt.password = true;password_txt.text = &quot;world&quot;;" />
   <page href="00005568.html" title="_url (TextField._url property)" text="_url (TextField._url property)public _url : String [read-only]Retrieves the URL of the SWF file that created the text field.ExampleThe following example retrieves the URL of the SWF file that created the text field, and a SWF file that loads into it. this.createTextField(&quot;my_txt&quot;, 1, 10, 10, 100, 22trace(my_txt._urlvar mclListener:Object = new Object(mclListener.onLoadInit = function(target_mc:MovieClip) { trace(target_mc._url};var holder_mcl:MovieClipLoader = new MovieClipLoader(holder_mcl.addListener(mclListenerholder_mcl.loadClip(&quot;best_flash_ever.swf&quot;, this.createEmptyMovieClip(&quot;holder_mc&quot;, 2)When you test this example, the URL of the SWF file you are testing, and the file called best_flash_ever.swf are displayed in the Output panel.When you test this example, the URL of the SWF file you are testing, and the file called best_flash_ever.swf write to the log file." />
   <page href="00005569.html" title="variable (TextField.variable property)" text="variable (TextField.variable property)public variable : StringThe name of the variable that the text field is associated with. The type of this property is String.ExampleThe following example creates a text field called my_txt and associates the variable today_date with the text field. When you change the variable today_date, then the text that appears in my_txt updates. this.(reateTextField(&quot;my_txt&quot;, 1, 10, 10, 200, 22my_txt.variable = &quot;today_date&quot;;var today_date:Date = new Date(var date_interval:Number = setInterval(updateDate, 500function updateDate():Void { today_date = new Date(}" />
   <page href="00005570.html" title="_visible (TextField._visible property)" text="_visible (TextField._visible property)public _visible : BooleanA Boolean value that indicates whether the text field my_txt is visible. Text fields that are not visible (_visible property set to false) are disabled.ExampleThe following example creates a text field called my_txt. A button called visible_btn toggles the visibility(of my_txt. this.createTextField(&quot;my_txt&quot;, 1, 10, 10, 200, 22my_txt.background = true;my_txt.backgroundColor = 0xDFDFDF;my_txt.border = true;my_txt.type = &quot;input&quot;;visible_btn.onRelease = function() { my_txt._visible = !my_txt._visible;};See also_visible (Button._visible property), _visible (MovieClip._visible property)" />
   <page href="00005571.html" title="_width (TextField._width property)" text="_width (TextField._width property)public _width : NumberThe width of the text field, in pixels.ExampleThe following example creates two text fields that you can use to change the width and height of a third text field on the Stage. Add the following ActionScript to a FLA or ActionScript file. this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 10, 40, 160, 120my_txt.background = true;my_txt.backgroundColor = 0xFF0000;my_txt.border = true;my_txt.multiline = true;my_txt.type = &quot;input&quot;;my_txt.wordWrap = true;this.createTextField(&quot;width_txt&quot;, this.getNextHighestDepth(), 10, 10, 30, 20width_txt.border = true;width_txt.maxChars = 3;width_txt.type = &quot;input&quot;;width_txt.text = my_txt._width;width_txt.onChanged = function() { my_txt._width = this.text;}this.createTextField(&quot;height_txt&quot;, this.getNextHighestDepth(), 70, 10, 30, 20height_txt.border = true;height_txt.maxChars = 3;height_txt.type = &quot;input&quot;;height_txt.text = my_txt._height;height_txt.onChanged = function() { my_txt._height = this.text;}When you test the example, try entering new values into width_txt and height_txt to change the dimensions of my_txt.See also_height (TextField._height property)" />
   <page href="00005572.html" title="wordWrap (TextField.wordWrap property)" text="wordWrap (TextField.wordWrap property)public wordWrap : BooleanA Boolean value that indicates if the text field has word wrap. If the value of wordWrap is true, the text field has word wrap; if the value is false, the text field does not have word wrap.ExampleThe following example demonstrates how wordWrap affects long text in a text field that is created at runtime. this.createTextField(&quot;my_txt&quot;, 99, 10, 10, 100, 200my_txt.text = &quot;This is very long text that will certainly extend beyond the width of this text field&quot;;my_txt.border = true;Test the SWF file in Flash Player by selecting Control &gt; Test Movie. Then return to your ActionScript and add the following line to the code and test the SWF file again:my_txt.wordWrap = true;" />
   <page href="00005573.html" title="_x (TextField._x property)" text="_x (TextField._x property)public _x : NumberAn integer that sets the x coordinate of a text field relative to the local coordinates of the parent movie clip. If a text field is on 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 a 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 field&#39;s coordinates refer to the registration point position.ExampleThe following example creates a text field wherever you click the mouse. When it creates a text field, that field displays the current x and y coordinates of the text field. this.createTextField(&quot;coords_txt&quot;, this.getNextHighestDepth(), 0, 0, 60, 22coords_txt.autoSize = true;coords_txt.selectable = false;coords_txt.border = true;var mouseListener:Object = new Object(mouseListener.onMouseDown = function() { coords_txt.text = &quot;X:&quot;+Math.round(_xmouse)+&quot;, Y:&quot;+Math.round(_ymouse coords_txt._x = _xmouse; coords_txt._y = _ymouse;};Mouse.addListener(mouseListe(erSee also_xscale (TextField._xscale property), _y (TextField._y property), _yscale (TextField._yscale property)" />
   <page href="00005574.html" title="_xmouse (TextField._xmouse property)" text="_xmouse (TextField._xmouse property)public _xmouse : Number [read-only]Returns the x coordinate of the mouse position relative to the text field. Note: This property is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleThe following example creates three text fields on the Stage. The mouse_txt instance displays the current position of the mouse in relation to the Stage. The textfield_txt instance displays the current position of the mouse pointer in relation to the my_txt instance. Add the following ActionScript to a FLA or ActionScript file: this.createTextField(&quot;mouse_txt&quot;, this.getNextHighestDepth(), 10, 10, 200, 22mouse_txt.border = true;this.createTextField(&quot;textfield_txt&quot;, this.getNextHighestDepth(), 220, 10, 200, 22textfield_txt.border = true;this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 100, 100, 160, 120my_txt.border = true;var mouseListener:Object = new Object(mouseListener.onMouseMove = function() { mouse_txt.text = &quot;MOUSE ... X:&quot; + Math.round(_xmouse) + &quot;, tY:&quot; + Math.round(_ymouse textfield_txt.text = &quot;TEXTFIELD ... X:&quot; + Math.round(my_txt._xmouse) + &quot;, tY:&quot; + Math.round(my_txt._ymouse}Mouse.addListener(mouseListenerSee also_ymouse (TextField._ymouse property)" />
   <page href="00005575.html" title="_xscale (TextField._xscale property)" text="_xscale (TextField._xscale property)public _xscale : NumberDetermines 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).ExampleThe following example scales the my_txt instance when you click the scaleUp_btn and scaleDown_btn instances. this.createTextField(&quot;my_txt&quot;, 99, 10, 40, 100, 22my_txt.autoSize = true;my_txt.border = true;my_txt.selectable = false;my_txt.text = &quot;Sample text goes here.&quot;;scaleUp_btn.onRelease = function() { my_txt._xscale = 2; my_txt._yscale = 2;}scaleDown_btn.onRelease = function() { my_txt._xscale /= 2; my_txt._yscale /= 2;}See also_x (TextField._x property), _y (TextField._y property), _yscale (TextField._yscale property)" />
   <page href="00005576.html" title="_y (TextField._y property)" text="_y (TextField._y property)public _y : NumberThe 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 field&#39;s coordinates refer to the registration point position.ExampleSee the example for TextField._x.See also_x (TextField._x property), _xscale (TextField._xscale property), _yscale (TextField._yscale property)" />
   <page href="00005577.html" title="_ymouse (TextField._ymouse property)" text="_ymouse (TextField._ymouse property)public _ymouse : Number [read-only]Indicates the y coordinate of the mouse position relative to the text field. Note: This property is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true.ExampleSee the example for TextField._xmouse.See also_xmouse (TextField._xmouse property)" />
   <page href="00005578.html" title="_yscale (TextField._yscale property)" text="_yscale (TextField._yscale property)public _yscale : NumberThe 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).ExampleSee the example for TextField._xscale.See also_x (TextField._x property), _xscale (TextField._xscale property), _y (TextField._y property)" />
   <page href="00005579.html" title="TextFormat" text="ModifiersPropertyDescriptionalign:StringA string that indicates the alignment of the paragraph.blockIndent:NumberA number that indicates the block indentation in points.bold:BooleanA Boolean value that specifies whether the text is boldface.bullet:BooleanA Boolean value that indicates that the text is part of a bulleted list.color:NumberA number that indicates the color of text.font:StringA string that specifies the name of the font for text.indent:NumberAn integer that indicates the indentation from the left margin to the first character in the paragraph.italic:BooleanA Boolean value that indicates whether text in this text format is italicized.leading:NumberAn integer that represents the amount of vertical space in pixels (called leading) between lines.leftMargin:NumberThe left margin of the paragraph, in points.rightMargin:NumberThe right margin of the paragraph, in points.size:NumberThe point size of text in this text format.tabStops:ArraySpecifies custom tab stops as an array of non-negative integers.target:StringIndicates the target window where the hyperlink is displayed.underline:BooleanA Boolean value that indicates whether the text that uses this text format is underlined (true) or not (false).url:StringIndicates the URL that text in this text format hyperlinks to.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)SignatureDescriptionTextFormat([font:String], [size:Number], [color:Number], [bold:Boolean], [italic:Boolean], [underline:Boolean], [url:String], [target:String], [align:String], [leftMargin:Number], [rightMargin:Number], [indent:Number], [leading:Number])Creates a TextFormat object with the specified properties.ModifiersSignatureDescriptiongetTextExtent(text:String, [width:Number]) : ObjectReturns text measurement information for the text string text in the format specified by my_fmt.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)TextFormatObject | +-TextFormatpublic class TextFormatextends ObjectThe TextFormat class represents character formatting information. Use the TextFormat class to create specific text formatting for text fields. You can apply text formatting to both static and dynamic text fields. Some properties of the TextFormat class are not available for both embedded and device fonts.See alsosetTextFormat (TextField.setTextFormat method), getTextFormat (TextField.getTextFormat method)Property summaryProperties inherited from class ObjectConstructor summaryMethod summaryMethods inherited from class Object" />
   <page href="00005580.html" title="align (TextFormat.align property)" text="align (TextFormat.align property)public align : StringA string that indicates the alignment of the paragraph. You can apply this property to static and dynamic text. The following list shows possible values for this property: &quot;left&quot;--the paragraph is left-aligned.&quot;center&quot;--the paragraph is centered.&quot;right&quot;--the paragraph is right-aligned. The default value is null, which indicates that the property is undefined.ExampleThe following example creates a text field with a border and uses TextFormat.align to center the text. var my_fmt:TextFormat = new TextFormat(my_fmt.align = &quot;center&quot;;this.createTextField(&quot;my_txt&quot;, 1, 100, 100, 300, 100my_txt.multiline = true;my_txt.wordWrap = true;my_txt.border = true;my_txt.text = &quot;this is my first text field object text&quot;;my_txt.setTextFormat(my_fmt" />
   <page href="00005581.html" title="blockIndent (TextFormat.blockIndent property)" text="blockIndent (TextFormat.blockIndent property)public blockIndent : NumberA number that indicates the block indentation in points. Block indentation is applied to an entire block of text; that is, to all lines of the text. In contrast, normal indentation (TextFormat.indent) affects only the first line of each paragraph. If this property is null, the TextFormat object does not specify block indentation.ExampleThis example creates a text field with a border and sets the blockIndent to 20. this.createTextField(&quot;mytext&quot;,1,100,100,100,100mytext.multiline = true;mytext.wordWrap = true;mytext.border = true;var myformat:TextFormat = new TextFormat(myformat.blockIndent = 20;mytext.text = &quot;This is my first text field object text&quot;;mytext.setTextFormat(myformat" />
   <page href="00005582.html" title="bold (TextFormat.bold property)" text="bold (TextFormat.bold property)public bold : BooleanA Boolean value that specifies whether the text is boldface. The default value is null, which indicates that the property is undefined. If the value is true, the text is boldface. Note: For Arabic, Hebrew, and Thai, this property works for paragraph-level formatting only.ExampleThe following example creates a text field that includes characters in boldface. var my_fmt:TextFormat = new TextFormat(my_fmt.bold = true;this.createTextField(&quot;my_txt&quot;, 1, 100, 100, 300, 100my_txt.multiline = true;my_txt.wordWrap = true;my_txt.border = true;my_txt.text = &quot;This is my text field object text&quot;;my_txt.setTextFormat(my_fmt" />
   <page href="00005583.html" title="bullet (TextFormat.bullet property)" text="bullet (TextFormat.bullet property)public bullet : BooleanA 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. Note: For Flash Lite, this property works for embedded fonts only. This property is not supported for Arabic, Hebrew, and Thai.ExampleThe following example creates a new text field at runtime, and puts a string with a line break into the field. The TextFormat class is used to format the characters by adding bullets to each line in the text field. This is demonstrated in the following ActionScript: var my_fmt:TextFormat = new TextFormat(my_fmt.bullet = true;this.createTextField(&quot;my_txt&quot;, 1, 100, 100, 300, 100my_txt.multiline = true;my_txt.wordWrap = true;my_txt.border = true;my_txt.text = &quot;this is my text&quot;+newline;my_txt.text += &quot;this is more text&quot;+newline;my_txt.setTextFormat(my_fmt" />
   <page href="00005584.html" title="color (TextFormat.color property)" text="color (TextFormat.color property)public color : NumberA number that indicates the color of text. The number contains three 8-bit RGB components; for example, 0xFF0000 is red, and 0x00FF00 is green. Note: For Arabic, Hebrew, and Thai, this property works for paragraph-level formatting only.ExampleThe following example creates a text field and sets the text color to red. var my_fmt:TextFormat = new TextFormat(my_fmt.blockIndent = 20;my_fmt.color = 0xFF0000; // hex value for red this.createTextField(&quot;my_txt&quot;, 1, 100, 100, 300, 100my_txt.multiline = true;my_txt.wordWrap = true;my_txt.border = true;my_txt.text = &quot;this is my first text field object text&quot;;my_txt.setTextFormat(my_fmt" />
   <page href="00005585.html" title="font (TextFormat.font property)" text="font (TextFormat.font property)public font : StringA string that specifies the name of the font for text. The default value is null, which indicates that the property is undefined. Note: For Flash Lite, this property works for embedded fonts only. This property is not supported for Arabic, Hebrew, and Thai.ExampleThe following example creates a text field and sets the font to Courier. this.createTextField(&quot;mytext&quot;,1,100,100,100,100mytext.multiline = true;mytext.wordWrap = true;mytext.border = true;var myformat:TextFormat = new TextFormat(myformat.font = &quot;Courier&quot;;mytext.text = &quot;this is my first text field object text&quot;;mytext.setTextFormat(myformat" />
   <page href="00005586.html" title="getTextExtent (TextFormat.getTextExtent method)" text="getTextExtent (TextFormat.getTextExtent method)public getTextExtent(text:String, [width:Number]) : ObjectReturns 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 field&#39;s 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.Parameterstext:String - A string.width:Number [optional] - A number that represents the width, in pixels, at which the specified text should wrap.ReturnsObject - An object with the properties width, height, ascent, descent, textFieldHeight, textFieldWidth.ExampleThis example creates a single-line text field that&#39;s just big enough to display a text string using the specified formatting. var my_str:String = &quot;Small string&quot;;// Create a TextFormat object,// and apply its properties.var my_fmt:TextFormat = new TextFormat(with (my_fmt) { font = &quot;Arial&quot;; bold = true;}// Obtain metrics information for the text string// with the specified formatting.var metrics:Object = my_fmt.getTextExtent(my_str// Create a text field just large enough to display the text.this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 100, 100, metrics.textFieldWidth, metrics.textFieldHeightmy_txt.border = true;my_txt.wordWrap = true;// Assign the same text string and TextFormat object to the my_txt object.my_txt.text = my_str;my_txt.setTextFormat(my_fmtThe following example creates a multiline, 100-pixel-wide text field that&#39;s high enough to display a string with the specified formatting. // Create a TextFormat object.var my_fmt:TextFormat = new TextFormat(// Specify formatting properties for the TextFormat object:my_fmt.font = &quot;Arial&quot;;my_fmt.bold = true;my_fmt.leading = 4;// The string of text to be displayedvar textToDisplay:String = &quot;Macromedia Flash Player 7, now with improved text metrics.&quot;;// Obtain text measurement information for the string,// wrapped at 100 pixels.var metrics:Object = my_fmt.getTextExtent(textToDisplay, 100// Create a new TextField object using the metric// information just obtained.this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 50, 50-metrics.ascent, 100, metrics.textFieldHeightmy_txt.wordWrap = true;my_txt.border = true;// Assign the text and the TextFormat object to the TextObject:my_txt.text = textToDisplay;my_txt.setTextFormat(my_fmt" />
   <page href="00005587.html" title="indent (TextFormat.indent property)" text="indent (TextFormat.indent property)public indent : NumberAn integer that indicates the indentation from the left margin to the first character in the paragraph. The default value is null, which indicates that the property is undefined.ExampleThe following example creates a text field and sets the indentation to 10: this.createTextField(&quot;mytext&quot;,1,100,100,100,100mytext.multiline = true;mytext.wordWrap = true;mytext.border = true;var myformat:TextFormat = new TextFormat(myformat.indent = 10;mytext.text = &quot;this is my first text field object text&quot;;mytext.setTextFormat(myformatSee alsoblockIndent (TextFormat.blockIndent property)" />
   <page href="00005588.html" title="italic (TextFormat.italic property)" text="italic (TextFormat.italic property)public italic : BooleanA Boolean value that indicates whether text in this text format is italicized. The default value is null, which indicates that the property is undefined. Note: For Arabic, Hebrew, and Thai, this property works for paragraph-level formatting only.ExampleThe following example creates a text field and sets the text style to italic. this.createTextField(&quot;mytext&quot;,1,100,100,100,100mytext.multiline = true;mytext.wordWrap = true;mytext.border = true;var myformat:TextFormat = new TextFormat(myformat.italic = true;mytext.text = &quot;This is my first text field object text&quot;;mytext.setTextFormat(myformat" />
   <page href="00005589.html" title="leading (TextFormat.leading property)" text="leading (TextFormat.leading property)public leading : NumberAn integer that represents the amount of vertical space in pixels (called leading) between lines. The default value is null, which indicates that the property is undefined.ExampleThe following example creates a text field and sets the leading to 10. var my_fmt:TextFormat = new TextFormat(my_fmt.leading = 10;this.createTextField(&quot;my_txt&quot;, 1, 100, 100, 100, 100my_txt.multiline = true;my_txt.wordWrap = true;my_txt.border = true;my_txt.text = &quot;This is my first text field object text&quot;;my_txt.setTextFormat(my_fmt" />
   <page href="00005590.html" title="leftMargin (TextFormat.leftMargin property)" text="leftMargin (TextFormat.leftMargin property)public leftMargin : NumberThe left margin of the paragraph, in points. The default value is null, which indicates that the property is undefined.ExampleThe following example creates a text field and sets the left margin to 20 points. this.createTextField(&quot;mytext&quot;,1,100,100,100,100mytext.multiline = true;mytext.wordWrap = true;mytext.border = true;var myformat:TextFormat = new TextFormat(myformat.leftMargin = 20;mytext.text = &quot;this is my first text field object text&quot;;mytext.setTextFormat(myformat" />
   <page href="00005591.html" title="rightMargin (TextFormat.rightMargin property)" text="rightMargin (TextFormat.rightMargin property)public rightMargin : NumberThe right margin of the paragraph, in points. The default value is null, which indicates that the property is undefined.ExampleThe following example creates a text field and sets the right margin to 20 points. this.createTextField(&quot;mytext&quot;,1,100,100,100,100mytext.multiline = true;mytext.wordWrap = true;mytext.border = true;var myformat:TextFormat = new TextFormat(myformat.rightMargin = 20;mytext.text = &quot;this is my first text field object text&quot;;mytext.setTextFormat(myformat" />
   <page href="00005592.html" title="size (TextFormat.size property)" text="size (TextFormat.size property)public size : NumberThe point size of text in this text format. The default value is null, which indicates that the property is undefined. Note: For Arabic, Hebrew, and Thai, this property works for paragraph-level formatting only.ExampleThe following example creates a text field and sets the text size to 20 points. this.createTextField(&quot;mytext&quot;,1,100,100,100,100mytext.multiline = true;mytext.wordWrap = true;mytext.border = true;var myformat:TextFormat = new TextFormat(myformat.size = 20;mytext.text = &quot;This is my first text field object text&quot;;mytext.setTextFormat(myformat" />
   <page href="00005593.html" title="tabStops (TextFormat.tabStops property)" text="tabStops (TextFormat.tabStops property)public tabStops : ArraySpecifies custom tab stops as an array of non-negative integers. Each tab stop is specified in pixels. If custom tab stops are not specified (null), the default tab stop is 4 (average character width). Note: For Flash Lite, this property works for embedded fonts only. This property is not supported for Arabic, Hebrew, and Thai.ExampleThe following example creates two text fields, one with tab stops every 40 pixels, and the other with tab stops every 75 pixels. this.createTextField(&quot;mytext&quot;,1,100,100,400,100mytext.border = true;var myformat:TextFormat = new TextFormat(myformat.tabStops = [40,80,120,160];mytext.text = &quot;A tB tC tD&quot;; // t is the tab stop charactermytext.setTextFormat(myformatthis.createTextField(&quot;mytext2&quot;,2,100,220,400,100mytext2.border = true;var myformat2:TextFormat = new TextFormat(myformat2.tabStops = [75,150,225,300];mytext2.text =&quot;A tB tC tD&quot;;mytext2.setTextFormat(myformat2" />
   <page href="00005594.html" title="target (TextFormat.target property)" text="target (TextFormat.target property)public target : StringIndicates the target window where the hyperlink is displayed. If the target window is an empty string, the text is displayed in the default target window _self. You can choose a custom name or one of the following four names: _self specifies the current frame in the current window, _blank specifies a new window, _parent specifies the parent of the current frame, and _top specifies the top-level frame in the current window. If the TextFormat.url property is an empty string or null, you can get or set this property, but the property will have no effect.ExampleThe following example creates a text field with a hyperlink to the Macromedia website. The example uses TextFormat.target to display the Macromedia website in a new browser window. var myformat:TextFormat = new TextFormat(myformat.url = &quot;http://www.macromedia.com&quot;;myformat.target = &quot;_blank&quot;;this.createTextField(&quot;mytext&quot;,1,100,100,200,100mytext.multiline = true;mytext.wordWrap = true;mytext.border = true;mytext.html = true;mytext.text = &quot;Go to Macromedia.com&quot;;mytext.setTextFormat(myformatSee alsourl (TextFormat.url property)" />
   <page href="00005595.html" title="TextFormat constructor" text="TextFormat constructorpublic TextFormat([font:String], [size:Number], [color:Number], [bold:Boolean], [italic:Boolean], [underline:Boolean], [url:String], [target:String], [align:String], [leftMargin:Number], [rightMargin:Number], [indent:Number], [leading:Number])Creates a TextFormat object with the specified properties. You can then change the properties of the TextFormat object to change the formatting of text fields. Any parameter may be set to null to indicate that it is not defined. All of the parameters are optional; any omitted parameters are treated as null.Parametersfont:String [optional] - The name of a font for text as a string.size:Number [optional] - An integer that indicates the point size.color:Number [optional] - The color of text using this text format. A number containing three 8-bit RGB components; for example, 0xFF0000 is red, and 0x00FF00 is green.bold:Boolean [optional] - A Boolean value that indicates whether the text is boldface.italic:Boolean [optional] - A Boolean value that indicates whether the text is italicized.underline:Boolean [optional] - A Boolean value that indicates whether the text is underlined.url:String [optional] - The URL to which the text in this text format hyperlinks. If url is an empty string, the text does not have a hyperlink.target:String [optional] - The target window where the hyperlink is displayed. If the target window is an empty string, the text is displayed in the default target window _self. If the url parameter is set to an empty string or to the value null, you can get or set this property, but the property will have no effect.align:String [optional] - The alignment of the paragraph, represented as a string. If &quot;left&quot;, the paragraph is left-aligned. If &quot;center&quot;, the paragraph is centered. If &quot;right&quot;, the paragraph is right-aligned.leftMargin:Number [optional] - Indicates the left margin of the paragraph, in points.rightMargin:Number [optional] - Indicates the right margin of the paragraph, in points.indent:Number [optional] - An integer that indicates the indentation from the left margin to the first character in the paragraph.leading:Number [optional] - A number that indicates the amount of leading vertical space between lines.ExampleThe following example creates a TextFormat object, formats the stats_txt text field, and creates a new text field to display the text in: // Define a TextFormat which is used to format the stats_txt text field.var my_fmt:TextFormat = new TextFormat(my_fmt.bold = true;my_fmt.font = &quot;Arial&quot;;my_fmt.size = 12;my_fmt.color = 0xFF0000;// Create a text field to display the player&#39;s statistics.this.createTextField(&quot;stats_txt&quot;, 5000, 10, 0, 530, 22// Apply the TextFormat to the text field.stats_txt.setNewTextFormat(my_fmtstats_txt.selectable = false;stats_txt.text = &quot;Lorem ipsum dolor sit amet...&quot;;To view another example, see the animations.fla file in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample." />
   <page href="00005596.html" title="underline (TextFormat.underline property)" text="underline (TextFormat.underline property)public underline : BooleanA Boolean value that indicates whether the text that uses this text format is underlined (true) or not (false). This underlining is similar to that produced by the &lt;U&gt; tag, but the latter is not true underlining, because it does not skip descenders correctly. The default value is null, which indicates that the property is undefined. Note: For Arabic, Hebrew, and Thai, this property works for paragraph-level formatting only.ExampleThe following example creates a text field and sets the text style to underline. this.createTextField(&quot;mytext&quot;,1,100,100,200,100mytext.multiline = true;mytext.wordWrap = true;mytext.border = true;var myformat:TextFormat = new TextFormat(myformat.underline = true;mytext.text = &quot;This is my first text field object text&quot;;mytext.setTextFormat(myformat" />
   <page href="00005597.html" title="url (TextFormat.url property)" text="url (TextFormat.url property)public url : StringIndicates the URL that text in this text format hyperlinks to. If the url property is an empty string, the text does not have a hyperlink. The default value is null, which indicates that the property is undefined.ExampleThis example creates a text field that is a hyperlink to the Macromedia website. var myformat:TextFormat = new TextFormat(myformat.url = &quot;http://www.macromedia.com&quot;;this.createTextField(&quot;mytext&quot;,1,100,100,200,100mytext.multiline = true;mytext.wordWrap = true;mytext.border = true;mytext.html = true;mytext.text = &quot;Go to Macromedia.com&quot;;mytext.setTextFormat(myformat" />
   <page href="00005598.html" title="Video" text="constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)EventDescriptiononStatus = function(infoObject:Object) {}Callback handler that can be invoked by the device to indicate status or error conditions.ModifiersSignatureDescriptionclose() : VoidStops playback of the video, frees the memory associated with this Video object, and clears the video area onscreen.pause() : VoidStops playback of the video and continues to render the current frame onscreen.play() : BooleanCalling this method opens a video source and begins playback of a video.resume() : VoidCalling this method resumes playback of the video.stop() : VoidStops playback of the video and continues to render the current frame onscreen.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)VideoObject | +-Videopublic class Videoextends ObjectThe Video class enables you to display video content that is embedded in your SWF file, stored locally on the host device, or streamed in from a remote location. Note: The player for Flash Lite 2.0 handles video differently than Flash Player 7 does. These are the major differences:Flash Player 7 directly renders the video data (embedded or streaming). The player for Flash Lite 2.0 does not render the video data; instead it hands the data off to the mobile device. The player for Flash Lite 3.0 supports the rendering of Flash Video (FLV) directly by Flash Lite.Flash Player 7 supports many video formats in addition to FLV. Flash Lite 2.0 supports video playback in the following cases: video embedded in a SWF file; video that resides in a separate file on the host device; and video data that is streamed in over the network (in real time). The player for Flash Lite 2.0 supports only those video formats that a specific mobile device supports, while the player for Flash Lite 3.0 supports the rendering of FLV natively. Flash Player 7 lets you bundle the data in a SWF file or stream it by using the Video object and assigning either a NetStream object or Camera object as the source of the video information. However, the player for Flash Lite 2.0 does not support the NetStream and Camera objects. Instead, Flash Lite 2.0 uses a new library symbol type called Video to embed source video data and to stream video for mobile devices. Because Flash Lite 2.0 does not support the NetStream object, you use the methods and properties of the Video class to control the video playback. The player for Flash Lite 3.0 does support the NetStream and NetConnection objects, and you use the methods and properties of these classes to control FLV playback. Flash Lite 3.0 also supports a new property in the Video class, attachVideo, that specifies a video stream to be displayed within the Video object on the Stage. Flash Lite 3.0 does not support the Camera object. Because of the requirements of mobile devices (smaller processor speeds, memory restrictions, and proprietary encoding formats), Flash Lite 2.0 cannot render the video information directly. The supported file formats for video depend on the mobile device manufacturer. For more information about supported video formats, check the hardware platforms on which you plan to deploy your application. In contrast, Flash Lite 3.0 does render Flash video directly.Flash Lite 2.0 does not support the following Flash Player 7 features:Streaming of video data from a Flash Media ServerRecording videoFlash Lite 3.0 adds support the following Flash Player 7 features:Flash video rendered directly by the player using versions of the On2 and Sorenson codecs optimized for mobile devicesStreaming of video data over an RTMP connection to a Flash Media Server (RTMPT and RTMPS connections are not supported, nor are multiple connections)Flash Lite 3.0 does not support the following Flash Player 7 features:Recording videoCamera objectProperty summaryProperties inherited from class ObjectEvent summaryMethod summaryMethods inherited from class Object" />
   <page href="00005599.html" title="attachVideo (Video.attachVideo method)" text="attachVideo (Video.attachVideo method)public attachVideo(source:Object) : VoidSpecifies a video stream (source) to be displayed within the boundaries of the Video object on the Stage. The video stream is either an FLV file being displayed by means of the NetStream.play() command, or null. If source is null, video is no longer played within the Video object.You don&#39;t have to use this method if the FLV file contains only audio; the audio portion of FLV files is played automatically when the NetStream.play() command is issued. If you want to control the audio associated with an FLV file, you can use MovieClip.attachAudio() to route the audio to a movie clip; you can then create a Sound object to control some aspects of the audio. For more information, see MovieClip.attachAudio().AvailabilityActionScript 1.0; Flash Player 6 - The ability to work with Flash Video (FLV) files was added in Flash Player 7.ExampleThe following example plays a previously recorded file named video1.flv that is stored in the same directory as the SWF file. var my_video:Video; // my_video is a Video object on the Stage var my_nc:NetConnection = new NetConnection( my_nc.connect(null var my_ns:NetStream = new NetStream(my_nc my_video.attachVideo(my_ns my_ns.play(&quot;video1.flv&quot;See alsoplay (Video.play method), stop (Video.stop method), resume (Video.resume method)" />
   <page href="00005600.html" title="close (Video.close method)" text="close (Video.close method)public close() : VoidStops playback of the video, frees the memory associated with this Video object, and clears the video area onscreen.ExampleThe following example closes the video that is playing in a Video object named video1.  video1.close()See alsoplay (Video.play method), pause (Video.pause method), resume (Video.resume method)" />
   <page href="00005601.html" title="onStatus (Video.onStatus handler)" text="onStatus (Video.onStatus handler)onStatus = function(infoObject:Object) {}Callback handler that can be invoked by the device to indicate status or error conditions.ParametersinfoObject:Object - The infoObject parameter has two properties: code:String -- Description of the error or status condition (device specific).level:Number -- Zero for error and non-zero for success (device specific).ExampleThe following example shows how to create a Video.onStatus() function that displays a status or error condition. var v:Video; // v is a Video object on the stage.v.onStatus = function(o:Object){ if ( o.level ) { trace( &quot;Video Status Msg (&quot; + o.level + &quot;): &quot; + o.code  } else { trace( &quot;Video Status Error: &quot; + o.code  }}v.play(&quot;a.vid&quot;" />
   <page href="00005602.html" title="pause (Video.pause method)" text="pause (Video.pause method)public pause() : VoidStops playback of the video and continues to render the current frame onscreen. A subsequent call to Video.resume() resumes playback from the current position.ExampleThe following example stops the video that is playing in a Video object (called my_video) when the user clicks the close_btn instance.  // video1 is the name of a Video object on Stage video1.pause()See alsoplay (Video.play method), stop (Video.stop method), resume (Video.resume method)" />
   <page href="00005603.html" title="play (Video.play method)" text="play (Video.play method)public play() : BooleanCalling this method opens a video source and begins playback of a video.ReturnsBoolean - A value of true if the mobile device can render the video; otherwise, false.ExampleThe following example pauses and clears video1.flv, which is playing in a Video object (called video1).  video1.play( &quot;http://www.macromedia.com/samples/videos/clock.3gp&quot; You can also use a Video object on the Stage to play bundled device videos directly from the library. To do this, you bundle the device video in your application&#39;s library. You also assign an identifier to the video symbol that lets you reference the video symbol with ActionScript. You can play a device video from the library by passing the symbol&#39;s ActionScript identifier to the Video.play() method, as the following example shows: placeHolderVideo.play(&quot;symbol://ocean_video&quot;For more information about playing video from the library, see &quot;Playing a bundled video directly from the library&quot; in Developing Flash Lite 2.x Applications.See alsostop (Video.stop method), pause (Video.pause method), resume (Video.resume method)" />
   <page href="00005604.html" title="resume (Video.resume method)" text="resume (Video.resume method)public resume() : VoidCalling this method resumes playback of the video. If Video.pause() was previously called, playback begins from the current position. If Video.stop() was previously called, playback begins from the first frame.ExampleThe following example resumes the video that is playing in a Video object called video1.  video1.resume()See alsopause (Video.pause method), stop (Video.stop method)" />
   <page href="00005605.html" title="stop (Video.stop method)" text="stop (Video.stop method)public stop() : VoidStops playback of the video and continues to render the current frame onscreen. A subsequent call to Video.resume() resumes playback from the first frame of the video.ExampleThe following example stops the video that is playing in a Video object (called my_video) when the user clicks the close_btn instance.  // video1 is the name of a Video object on Stage video1.stop(See alsoplay (Video.play method), pause (Video.pause method), resume (Video.resume method)" />
   <page href="00005606.html" title="XML" text="ModifiersPropertyDescriptioncontentType:StringThe MIME content type that is sent to the server when you call the XML.send() or XML.sendAndLoad() method.docTypeDecl:StringSpecifies information about the XML document&#39;s DOCTYPE declaration.ignoreWhite:BooleanDefault setting is false.loaded:BooleanIndicates if the XML document has successfully loaded.status:NumberAutomatically sets and returns a numeric value that indicates whether an XML document was successfully parsed into an XML object.xmlDecl:StringA string that specifies information about a document&#39;s XML declaration.attributes (XMLNode.attributes property), childNodes (XMLNode.childNodes property), firstChild (XMLNode.firstChild property), lastChild (XMLNode.lastChild property), nextSibling (XMLNode.nextSibling property), nodeName (XMLNode.nodeName property), nodeType (XMLNode.nodeType property), nodeValue (XMLNode.nodeValue property), parentNode (XMLNode.parentNode property), previousSibling (XMLNode.previousSibling property)constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)EventDescriptiononData = function(src:String) {}Invoked when XML text has been completely downloaded from the server, or when an error occurs downloading XML text from a server.onLoad = function(success:Boolean) {}Invoked by Flash Player when an XML document is received from the server.SignatureDescriptionXML(text:String)Creates a new XML object.ModifiersSignatureDescriptionaddRequestHeader(header:Object, headerValue:String) : VoidAdds or changes HTTP request headers (such as Content-Type or SOAPAction) sent with POST actions.createElement(name:String) : XMLNodeCreates a new XML element with the name specified in the parameter.createTextNode(value:String) : XMLNodeCreates a new XML text node with the specified text.getBytesLoaded() : NumberReturns the number of bytes loaded (streamed) for the XML document.getBytesTotal() : NumberReturns the size, in bytes, of the XML document.load(url:String) : BooleanLoads an XML document from the specified URL, and replaces the contents of the specified XML object with the downloaded XML data.parseXML(value:String) : VoidParses the XML text specified in the value parameter, and populates the specified XML object with the resulting XML tree.send(url:String, [target:String], method:String) : BooleanEncodes the specified XML object into an XML document, and sends it to the specified URL using the POST method in a browser.sendAndLoad(url:String, resultXML:XML) : VoidEncodes the specified XML object into an XML document, sends it to the specified URL using the POST method, downloads the server&#39;s response, and loads it into resultXMLobject, specified in the parameters.appendChild (XMLNode.appendChild method), cloneNode (XMLNode.cloneNode method), hasChildNodes (XMLNode.hasChildNodes method), insertBefore (XMLNode.insertBefore method), removeNode (XMLNode.removeNode method), toString (XMLNode.toString method)addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)XMLObject | +-XMLNode | +-XMLpublic class XMLextends XMLNodeUse the methods and properties of the XML class to load, parse, send, build, and manipulate XML document trees. You must use the constructor new XML() to create an XML object before calling any method of the XML class. An XML document is represented in Flash by the XML class. Each element of the hierarchical document is represented by an XMLNode object.For information on the following methods and properties, see the XMLNode class: appendChild(), attributes, childNodes, cloneNode(), firstChild, hasChildNodes(), insertBefore(), lastChild, nextSibling, nodeName, nodeType, nodeValue, parentNode, previousSibling, removeNode(), toString()In earlier versions of the ActionScript Language Reference, the methods and properties above were documented in the XML class. They are now documented in the XMLNode class.Note: The XML and XMLNode objects are modeled after the W3C DOM Level 1 recommendation: http://www.w3.org/tr/1998/REC-DOM-Level-1-19981001/level-one-core.html. That recommendation specifies a Node interface and a Document interface. The Document interface inherits from the Node interface, and adds methods such as createElement() and createTextNode(). In ActionScript, the XML and XMLNode objects are designed to divide functionality along similar lines.See alsoappendChild (XMLNode.appendChild method), attributes (XMLNode.attributes property), childNodes (XMLNode.childNodes property), cloneNode (XMLNode.cloneNode method), firstChild (XMLNode.firstChild property), hasChildNodes (XMLNode.hasChildNodes method), insertBefore (XMLNode.insertBefore method), lastChild (XMLNode.lastChild property), nextSibling (XMLNode.nextSibling property), nodeName (XMLNode.nodeName property), nodeType (XMLNode.nodeType property), nodeValue (XMLNode.nodeValue property), parentNode (XMLNode.parentNode property), previousSibling (XMLNode.previousSibling property), removeNode (XMLNode.removeNode method), toString (XMLNode.toString method)Property summaryProperties inherited from class XMLNodeProperties inherited from class ObjectEvent summaryConstructor summaryMethod summaryMethods inherited from class XMLNodeMethods inherited from class Object" />
   <page href="00005607.html" title="addRequestHeader (XML.addRequestHeader method)" text="addRequestHeader (XML.addRequestHeader method)public addRequestHeader(header:Object, headerValue:String) : VoidAdds or changes HTTP request headers (such as Content-Type or SOAPAction) sent with POST actions. In the first usage, you pass two strings to the method: header and headerValue. In the second usage, you pass an array of strings, alternating header names and header values. If multiple calls are made to set the same header name, each successive value replaces the value set in the previous call.You cannot add or change the following standard HTTP headers using this method: Accept-Ranges, Age, Allow, Allowed, Connection, Content-Length, Content-Location, Content-Range, ETag, Host, Last-Modified, Locations, Max-Forwards, Proxy-Authenticate, Proxy-Authorization, Public, Range, Retry-After, Server, TE, Trailer, Transfer-Encoding, Upgrade, URI, Vary, Via, Warning, and WWW-Authenticate.Parametersheader:Object - A string that represents an HTTP request header name.headerValue:String - A string that represents the value associated with header.ExampleThe following example adds a custom HTTP header named SOAPAction with a value of Foo to an XML object named my_xml: my_xml.addRequestHeader(&quot;SOAPAction&quot;, &quot;&#39;Foo&#39;&quot;The following example creates an array named headers that contains two alternating HTTP headers and their associated values. The array is passed as a parameter to the addRequestHeader() method.var headers:Array = new Array(&quot;Content-Type&quot;, &quot;text/plain&quot;, &quot;X-ClientAppVersion&quot;, &quot;2.0&quot;my_xml.addRequestHeader(headersSee alsoaddRequestHeader (LoadVars.addRequestHeader method)" />
   <page href="00005608.html" title="contentType (XML.contentType property)" text="contentType (XML.contentType property)public contentType : StringThe MIME content type that is sent to the server when you call the XML.send() or XML.sendAndLoad() method. The default is application/x-www-form-urlencoded, which is the standard MIME content type used for most HTML forms.ExampleThe following example creates a new XML document and checks its default content type: // create a new XML documentvar doc:XML = new XML(// trace the default content typetrace(doc.contentType // output: application/x-www-form-urlencodedThe following example defines an XML packet, and sets the content type for the XML object. The data is then sent to a server and shows a result in a browser window.var my_xml:XML = new XML(&quot;&lt;highscore&gt;&lt;name&gt;Ernie&lt;/name&gt;&lt;score&gt;13045&lt;/score&gt;&lt;/highscore&gt;&quot;my_xml.contentType = &quot;text/xml&quot;;my_xml.send(&quot;http://www.flash-mx.com/mm/highscore.cfm&quot;, &quot;_blank&quot;Press F12 to test this example in a browser.See alsosend (XML.send method), sendAndLoad (XML.sendAndLoad method)" />
   <page href="00005609.html" title="createElement (XML.createElement method)" text="createElement (XML.createElement method)public createElement(name:String) : XMLNodeCreates a new XML element with the name specified in the parameter. The new element initially has no parent, no children, and no siblings. The method returns a reference to the newly created XML object that represents the element. This method and the XML.createTextNode() method are the constructor methods for creating nodes for an XML object.Parametersname:String - The tag name of the XML element being created.ReturnsXMLNode - An XMLNode object; an XML element.ExampleThe following example creates three XML nodes using the createElement() method: // create an XML documentvar doc:XML = new XML(// create three XML nodes using createElement()var element1:XMLNode = doc.createElement(&quot;element1&quot;var element2:XMLNode = doc.createElement(&quot;element2&quot;var element3:XMLNode = doc.createElement(&quot;element3&quot;// place the new nodes into the XML treedoc.appendChild(element1element1.appendChild(element2element1.appendChild(element3trace(doc// output: &lt;element1&gt;&lt;element2 /&gt;&lt;element3 /&gt;&lt;/element1&gt;See alsocreateTextNode (XML.createTextNode method)" />
   <page href="00005610.html" title="createTextNode (XML.createTextNode method)" text="createTextNode (XML.createTextNode method)public createTextNode(value:String) : XMLNodeCreates a new XML text node with the specified text. The new node initially has no parent, and text nodes cannot have children or siblings. This method returns a reference to the XML object that represents the new text node. This method and the XML.createElement() method are the constructor methods for creating nodes for an XML object.Parametersvalue:String - A string; the text used to create the new text node.ReturnsXMLNode - An XMLNode object.ExampleThe following example creates two XML text nodes using the createTextNode() method, and places them into existing XML nodes: // create an XML documentvar doc:XML = new XML(// create three XML nodes using createElement()var element1:XMLNode = doc.createElement(&quot;element1&quot;var element2:XMLNode = doc.createElement(&quot;element2&quot;var element3:XMLNode = doc.createElement(&quot;element3&quot;// place the new nodes into the XML treedoc.appendChild(element1element1.appendChild(element2element1.appendChild(element3// create two XML text nodes using createTextNode()var textNode1:XMLNode = doc.createTextNode(&quot;textNode1 String value&quot;var textNode2:XMLNode = doc.createTextNode(&quot;textNode2 String value&quot;// place the new nodes into the XML treeelement2.appendChild(textNode1element3.appendChild(textNode2trace(doc// output (with line breaks added between tags):// &lt;element1&gt;// &lt;element2&gt;textNode1 String value&lt;/element2&gt;// &lt;element3&gt;textNode2 String value&lt;/element3&gt;// &lt;/element1&gt;See alsocreateElement (XML.createElement method)" />
   <page href="00005611.html" title="docTypeDecl (XML.docTypeDecl property)" text="docTypeDecl (XML.docTypeDecl property)public docTypeDecl : StringSpecifies information about the XML document&#39;s DOCTYPE declaration. After the XML text has been parsed into an XML object, the XML.docTypeDecl property of the XML object is set to the text of the XML document&#39;s DOCTYPE declaration (for example, &lt;!DOCTYPEgreeting SYSTEM &quot;hello.dtd&quot;&gt;). This property is set using a string representation of the DOCTYPE declaration, not an XML node object. The ActionScript XML parser is not a validating parser. The DOCTYPE declaration is read by the parser and stored in the XML.docTypeDecl property, but no Dtd validation is performed.If no DOCTYPE declaration was encountered during a parse operation, the XML.docTypeDecl property is set to undefined. The XML.toString() method outputs the contents of XML.docTypeDecl immediately after the XML declaration stored in XML.xmlDecl, and before any other text in the XML object. If XML.docTypeDecl is undefined, no DOCTYPE declaration is output.ExampleThe following example uses the XML.docTypeDecl property to set the DOCTYPE declaration for an XML object: my_xml.docTypeDecl = &quot;&lt;!DOCTYPE greeting SYSTEM &quot;hello.dtd &quot;&gt;&quot;;See alsoxmlDecl (XML.xmlDecl property)" />
   <page href="00005612.html" title="getBytesLoaded (XML.getBytesLoaded method)" text="getBytesLoaded (XML.getBytesLoaded method)public getBytesLoaded() : NumberReturns the number of bytes loaded (streamed) for the XML document. You can compare the value of getBytesLoaded() with the value of getBytesTotal() to determine what percentage of an XML document has loaded.ReturnsNumber - An integer that indicates the number of bytes loaded.ExampleThe following example shows how to use the XML.getBytesLoaded() method with the XML.getBytesTotal() method to trace the progress of an XML.load() command. You must replace the URL parameter of the XML.load() command so that the parameter refers to a valid XML file using HTTP. If you attempt to use this example to load a local file that resides on your hard disk, this example will not work properly because in test movie mode Flash Player loads local files in their entirety. // create a new XML documentvar doc:XML = new XML(var checkProgress = function(xmlObj:XML) { var bytesLoaded:Number = xmlObj.getBytesLoaded( var bytesTotal:Number = xmlObj.getBytesTotal( var percentLoaded:Number = Math.floor((bytesLoaded / bytesTotal ) 100 trace (&quot;milliseconds elapsed: &quot; + getTimer() trace (&quot;bytesLoaded: &quot; + bytesLoaded trace (&quot;bytesTotal: &quot; + bytesTotal trace (&quot;percent loaded: &quot; + percentLoaded trace (&quot;---------------------------------&quot;}doc.onLoad = function(success:Boolean) { clearInterval(intervalID trace(&quot;intervalID: &quot; + intervalID}doc.load(&quot;[place a valid URL pointing to an XML file here]&quot;var intervalID:Number = setInterval(checkProgress, 100, docSee alsogetBytesTotal (XML.getBytesTotal method)" />
   <page href="00005613.html" title="getBytesTotal (XML.getBytesTotal method)" text="getBytesTotal (XML.getBytesTotal method)public getBytesTotal() : NumberReturns the size, in bytes, of the XML document.ReturnsNumber - An integer.ExampleSee example for XML.getBytesLoaded().See alsogetBytesLoaded (XML.getBytesLoaded method)" />
   <page href="00005614.html" title="ignoreWhite (XML.ignoreWhite property)" text="ignoreWhite (XML.ignoreWhite property)public ignoreWhite : BooleanDefault setting is false. When set to true, text nodes that contain only white space are discarded during the parsing process. Text nodes with leading or trailing white space are unaffected. Usage 1: You can set the ignoreWhite property for individual XML objects, as the following code shows:my_xml.ignoreWhite = true;Usage 2: You can set the default ignoreWhite property for XML objects, as the following code shows:XML.prototype.ignoreWhite = true;ExampleThe following example loads an XML file with a text node that contains only white space; the foyer tag comprises fourteen space characters. To run this example, create a text file named flooring.xml, and copy the following tags into it: &lt;house&gt; &lt;kitchen&gt; ceramic tile &lt;/kitchen&gt; &lt;bathroom&gt;linoleum&lt;/bathroom&gt; &lt;foyer&gt; &lt;/foyer&gt;&lt;/house&gt;Create a new Flash document named flooring.fla and save it to the same directory as the XML file. Place the following code into the main Timeline:// create a new XML objectvar flooring:XML = new XML(// set the ignoreWhite property to true (default value is false)flooring.ignoreWhite = true;// After loading is complete, trace the XML objectflooring.onLoad = function(success:Boolean) { trace(flooring}// load the XML into the flooring objectflooring.load(&quot;flooring.xml&quot;// output (line breaks added for clarity):&lt;house&gt; &lt;kitchen&gt; ceramic tile &lt;/kitchen&gt; &lt;bathroom&gt;linoleum&lt;/bathroom&gt; &lt;foyer /&gt;&lt;/house&gt;If you then change the setting of flooring.ignoreWhite to false, or simply remove that line of code entirely, the fourteen space characters in the foyer tag will be preserved:...// set the ignoreWhite property to false (default value)flooring.ignoreWhite = false;...// output (line breaks added for clarity):&lt;house&gt; &lt;kitchen&gt; ceramic tile &lt;/kitchen&gt; &lt;bathroom&gt;linoleum&lt;/bathroom&gt; &lt;foyer&gt; &lt;/foyer&gt;&lt;/house&gt;For an example, see the XML_blogTracker.fla and XML_languagePicker.fla files in the ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample." />
   <page href="00005615.html" title="load (XML.load method)" text="load (XML.load method)public load(url:String) : BooleanLoads an XML document from the specified URL, and replaces the contents of the specified XML object with the downloaded XML data. The URL is relative and is called using HTTP. The load process is asynchronous; it does not finish immediately after the load() method is executed. In SWF files running in a version of the player earlier than Flash Player 7, the url parameter must be in the same superdomain as the SWF file that issues this call. A superdomain is derived by removing the leftmost component of a file&#39;s URL. For example, a SWF file at www.someDomain.com can load data from sources at store.someDomain.com, because both files are in the same superdomain of someDomain.com.In SWF files of any version running in Flash Player 7 or later, the url parameter must be in exactly the same domain. For example, a SWF file at www.someDomain.com can load data only from sources that are also at www.someDomain.com. If you want to load data from a different domain, you can place a cross-domain policy file on the server that is hosting the SWF file. When the load() method is executed, the XML object property loaded is set to false. When the XML data finishes downloading, the loaded property is set to true, and the onLoad event handler is invoked. The XML data is not parsed until it is completely downloaded. If the XML object previously contained any XML trees, they are discarded.You can define a custom function that executes when the onLoad event handler of the XML object is invoked.Parametersurl:String - A string that represents the URL where the XML document to be loaded is located. If the SWF file that issues this call is running in a web browser, url must be in the same domain as the SWF file; for details, see the Description section.ReturnsBoolean - false if no parameter (null) is passed; true otherwise. Use the onLoad() event handler to check the success of a loaded XML document.ExampleThe following simple example uses the XML.load() method: // create a new XML objectvar flooring:XML = new XML(// set the ignoreWhite property to true (default value is false)flooring.ignoreWhite = true;// After loading is complete, trace the XML objectflooring.onLoad = function(success) { trace(flooring};// load the XML into the flooring objectflooring.load(&quot;flooring.xml&quot;For the contents of the flooring.xml file, and the output that this example produces, see the example for XML.ignoreWhite.See alsoignoreWhite (XML.ignoreWhite property), loaded (XML.loaded property), onLoad (XML.onLoad handler)" />
   <page href="00005616.html" title="loaded (XML.loaded property)" text="loaded (XML.loaded property)public loaded : BooleanIndicates if the XML document has successfully loaded. If there is no custom onLoad() event handler defined for the XML object, then this property is set to true when the document-loading process initiated by the XML.load() call has completed successfully; otherwise, it is false. However, if you define a custom behavior for the onLoad() event handler for the XML object, be sure to set onload in that function.ExampleThe following example uses the XML.loaded property in a simple script: var my_xml:XML = new XML(my_xml.ignoreWhite = true;my_xml.onLoad = function(success:Boolean) { trace(&quot;success: &quot;+success trace(&quot;loaded: &quot;+my_xml.loaded trace(&quot;status: &quot;+my_xml.status};my_xml.load(&quot;http://www.flash-mx.com/mm/problems/products.xml&quot;Information displays in the Output panel when the onLoad handler invokes. If the call completes successfully, true displays for the loaded status in the Output panel.success: trueloaded: truestatus: 0See alsoload (XML.load method), onLoad (XML.onLoad handler)" />
   <page href="00005617.html" title="onData (XML.onData handler)" text="onData (XML.onData handler)onData = function(src:String) {}Invoked when XML text has been completely downloaded from the server, or when an error occurs downloading XML text from a server. This handler is invoked before the XML is parsed, and you can use it to call a custom parsing routine instead of using the Flash XML parser. The src parameter is a string that contains XML text downloaded from the server, unless an error occurs during the download, in which case the src parameter is undefined. By default, the XML.onData event handler invokes XML.onLoad. You can override the XML.onData event handler with custom behavior, but XML.onLoad is not called unless you call it in your implementation of XML.onData.Parameterssrc:String - A string or undefined; the raw data, usually in XML format, that is sent by the server.ExampleThe following example shows what the XML.onData event handler looks like by default: XML.prototype.onData = function (src:String) { if (src == undefined) { this.onLoad(false } else { this.parseXML(src this.loaded = true; this.onLoad(true }}You can override the XML.onData event handler to intercept the XML text without parsing it.See alsoonLoad (XML.onLoad handler)" />
   <page href="00005618.html" title="onLoad (XML.onLoad handler)" text="onLoad (XML.onLoad handler)onLoad = function(success:Boolean) {}Invoked by Flash Player when an XML document is received from the server. If the XML document is received successfully, the success parameter is true. If the document was not received, or if an error occurred in receiving the response from the server, the success parameter is false. The default, implementation of this method is not active. To override the default implementation, you must assign a function that contains custom actions.Parameterssuccess:Boolean - A Boolean value that evaluates to true if the XML object is successfully loaded with a XML.load() or XML.sendAndLoad() operation; otherwise, it is false.ExampleThe following example includes ActionScript for a simple e-commerce storefront application. The sendAndLoad() method transmits an XML element that contains the user&#39;s name and password, and uses an XML.onLoad handler to process the reply from the server. var login_str:String = &quot;&lt;login username= &quot;&quot;+username_txt.text+&quot; &quot; password= &quot;&quot;+password_txt.text+&quot; &quot; /&gt;&quot;;var my_xml:XML = new XML(login_strvar myLoginReply_xml:XML = new XML(myLoginReply_xml.ignoreWhite = true;myLoginReply_xml.onLoad = function(success:Boolean){ if (success) { if ((myLoginReply_xml.firstChild.nodeName == &quot;packet&quot;) &amp;&amp; (myLoginReply_xml.firstChild.attributes.success == &quot;true&quot;)) { gotoAndStop(&quot;loggedIn&quot; } else { gotoAndStop(&quot;loginFailed&quot; } } else { gotoAndStop(&quot;connectionFailed&quot; }};my_xml.sendAndLoad(&quot;http://www.flash-mx.com/mm/login_xml.cfm&quot;, myLoginReply_xmlSee alsoload (XML.load method), sendAndLoad (XML.sendAndLoad method)" />
   <page href="00005619.html" title="parseXML (XML.parseXML method)" text="parseXML (XML.parseXML method)public parseXML(value:String) : VoidParses the XML text specified in the value parameter, and populates the specified XML object with the resulting XML tree. Any existing trees in the XML object are discarded.Parametersvalue:String - A string that represents the XML text to be parsed and passed to the specified XML object.ExampleThe following example creates and parses an XML packet: var xml_str:String = &quot;&lt;state name= &quot;California &quot;&gt;&lt;city&gt;San Francisco&lt;/city&gt;&lt;/state&gt;&quot;// defining the XML source within the XML constructor:var my1_xml:XML = new XML(xml_strtrace(my1_xml.firstChild.attributes.name // output: California// defining the XML source using the XML.parseXML method:var my2_xml:XML = new XML(my2_xml.parseXML(xml_strtrace(my2_xml.firstChild.attributes.name // output: California" />
   <page href="00005620.html" title="send (XML.send method)" text="send (XML.send method)public send(url:String, [target:String], method:String) : BooleanEncodes the specified XML object into an XML document, and sends it to the specified URL using the POST method in a browser. The Flash test environment only uses the GET method.Parametersurl:String - String; the destination URL for the specified XML object.target:String [optional] - String; the browser window to show data that the server returns:_self specifies the current frame in the current window._blank specifies a new window._parent specifies the parent of the current frame._top specifies the top-level frame in the current window. If you do not specify a window parameter, it is the same as specifying _self.method:String - ReturnsBoolean - ExampleThe following example defines an XML packet and sets the content type for the XML object. The data is then sent to a server and shows a result in a browser window. var my_xml:XML = new XML(&quot;&lt;highscore&gt;&lt;name&gt;Ernie&lt;/name&gt;&lt;score&gt;13045&lt;/score&gt;&lt;/highscore&gt;&quot;my_xml.contentType = &quot;text/xml&quot;;my_xml.send(&quot;http://www.flash-mx.com/mm/highscore.cfm&quot;, &quot;_blank&quot;Press F12 to test this example in a browser.See alsosendAndLoad (XML.sendAndLoad method)" />
   <page href="00005621.html" title="sendAndLoad (XML.sendAndLoad method)" text="sendAndLoad (XML.sendAndLoad method)public sendAndLoad(url:String, resultXML:XML) : VoidEncodes the specified XML object into an XML document, sends it to the specified URL using the POST method, downloads the server&#39;s response, and loads it into the resultXMLobject specified in the parameters. The server response loads in the same manner used by the XML.load() method. In SWF files running in a version of the player earlier than Flash Player 7, the url parameter must be in the same superdomain as the SWF file that is issuing this call. A superdomain is derived by removing the left-most component of a file&#39;s URL. For example, a SWF file at www.someDomain.com can load data from sources at store.someDomain.com, because both files are in the same superdomain of someDomain.com.In SWF files of any version running in Flash Player 7 or later, the url parameter must be in exactly the same domain. For example, a SWF file at www.someDomain.com can load data only from sources that are also at www.someDomain.com. If you want to load data from a different domain, you can place a cross-domain policy file on the server hosting the SWF file. When sendAndLoad() is executed, the XML object property loaded is set to false. When the XML data finishes downloading, the loaded property is set to true if the data successfully loaded, and the onLoad event handler is invoked. The XML data is not parsed until it is completely downloaded. If the XML object previously contained any XML trees, they are discarded.Parametersurl:String - A string; the destination URL for the specified XML object. If the SWF file issuing this call is running in a web browser, url must be in the same domain as the SWF file; for details, see the Description section.resultXML:XML - A target XML object created with the XML constructor method that will receive the return information from the server.ExampleThe following example includes ActionScript for a simple e-commerce storefront application. The XML.sendAndLoad() method transmits an XML element that contains the user&#39;s name and password, and uses an onLoad handler to process the reply from the server. var login_str:String = &quot;&lt;login username= &quot;&quot;+username_txt.text+&quot; &quot; password= &quot;&quot;+password_txt.text+&quot; &quot; /&gt;&quot;;var my_xml:XML = new XML(login_strvar myLoginReply_xml:XML = new XML(myLoginReply_xml.ignoreWhite = true;myLoginReply_xml.onLoad = myOnLoad;my_xml.sendAndLoad(&quot;http://www.flash-mx.com/mm/login_xml.cfm&quot;, myLoginReply_xmlfunction myOnLoad(success:Boolean) { if (success) { if ((myLoginReply_xml.firstChild.nodeName == &quot;packet&quot;) &amp;&amp; (myLoginReply_xml.firstChild.attributes.success == &quot;true&quot;)) { gotoAndStop(&quot;loggedIn&quot; } else { gotoAndStop(&quot;loginFailed&quot; } } else { gotoAndStop(&quot;connectionFailed&quot; }}See alsosend (XML.send method), load (XML.load method), loaded (XML.loaded property), onLoad (XML.onLoad handler)" />
   <page href="00005622.html" title="status (XML.status property)" text="status (XML.status property)public status : NumberAutomatically sets and returns a numeric value that indicates whether an XML document was successfully parsed into an XML object. The following are the numeric status codes, with descriptions: 0 No error; parse was completed successfully.-2 A CDATA section was not properly terminated.-3 The XML declaration was not properly terminated.-4 The DOCTYPE declaration was not properly terminated.-5 A comment was not properly terminated.-6 An XML element was malformed.-7 Out of memory.-8 An attribute value was not properly terminated.-9 A start-tag was not matched with an end-tag.-10 An end-tag was encountered without a matching start-tag.ExampleThe following example loads an XML packet into a SWF file. A status message displays, depending on whether the XML loads and parses successfully. Add the following ActionScript to your FLA or AS file: var my_xml:XML = new XML(my_xml.onLoad = function(success:Boolean) { if (success) { if (my_xml.status == 0) { trace(&quot;XML was loaded and parsed successfully&quot; } else { trace(&quot;XML was loaded successfully, but was unable to be parsed.&quot; } var errorMessage:String; switch (my_xml.status) { case 0 : errorMessage = &quot;No error; parse was completed successfully.&quot;; break; case -2 : errorMessage = &quot;A CDATA section was not properly terminated.&quot;; break; case -3 : errorMessage = &quot;The XML declaration was not properly terminated.&quot;; break; case -4 : errorMessage = &quot;The DOCTYPE declaration was not properly terminated.&quot;; break; case -5 : errorMessage = &quot;A comment was not properly terminated.&quot;; break; case -6 : errorMessage = &quot;An XML element was malformed.&quot;; break; case -7 : errorMessage = &quot;Out of memory.&quot;; break; case -8 : errorMessage = &quot;An attribute value was not properly terminated.&quot;; break; case -9 : errorMessage = &quot;A start-tag was not matched with an end-tag.&quot;; break; case -10 : errorMessage = &quot;An end-tag was encountered without a matching start-tag.&quot;; break; default : errorMessage = &quot;An unknown error has occurred.&quot;; break; } trace(&quot;status: &quot;+my_xml.status+&quot; (&quot;+errorMessage+&quot;)&quot; } else { trace(&quot;Unable to load/parse XML. (status: &quot;+my_xml.status+&quot;)&quot; }};my_xml.load(&quot;http://www.helpexamples.com/flash/badxml.xml&quot;" />
   <page href="00005623.html" title="XML constructor" text="XML constructorpublic XML(text:String)Creates a new XML object. You must use the constructor to create an XML object before you call any of the methods of the XML class. Note: Use the createElement() and createTextNode() methods to add elements and text nodes to an XML document tree.Parameterstext:String - A string; the XML text parsed to create the new XML object.ExampleThe following example creates a new, empty XML object: var my_xml:XML = new XML(The following example creates an XML object by parsing the XML text specified in the source parameter, and populates the newly created XML object with the resulting XML document tree:var other_xml:XML = new XML(&quot;&lt;state name= &quot;California &quot;&gt;&lt;city&gt;San Francisco&lt;/city&gt;&lt;/state&gt;&quot;See alsocreateElement (XML.createElement method), createTextNode (XML.createTextNode method)" />
   <page href="00005624.html" title="xmlDecl (XML.xmlDecl property)" text="xmlDecl (XML.xmlDecl property)public xmlDecl : StringA string that specifies information about a document&#39;s XML declaration. After the XML document is parsed into an XML object, this property is set to the text of the document&#39;s XML declaration. This property is set using a string representation of the XML declaration, not an XML node object. If no XML declaration is encountered during a parse operation, the property is set to undefined.XML. The XML.toString() method outputs the contents of the XML.xmlDecl property before any other text in the XML object. If the XML.xmlDecl property contains the undefined type, no XML declaration is output.ExampleThe following example creates a text field called my_txt that has the same dimensions as the Stage. The text field displays properties of the XML packet that loads into the SWF file. The doc type declaration displays in my_txt. Add the following ActionScript to your FLA or AS file: var my_fmt:TextFormat = new TextFormat(my_fmt.font = &quot;_typewriter&quot;;my_fmt.size = 12;my_fmt.leftMargin = 10;this.createTextField(&quot;my_txt&quot;, this.getNextHighestDepth(), 0, 0, Stage.width, Stage.heightmy_txt.border = true;my_txt.multiline = true;my_txt.wordWrap = true;my_txt.setNewTextFormat(my_fmtvar my_xml:XML = new XML(my_xml.ignoreWhite = true;my_xml.onLoad = function(success:Boolean) { var endTime:Number = getTimer( var elapsedTime:Number = endTime-startTime; if (success) { my_txt.text = &quot;xmlDecl:&quot;+newline+my_xml.xmlDecl+newline+newline; my_txt.text += &quot;contentType:&quot;+newline+my_xml.contentType+newline+newline; my_txt.text += &quot;docTypeDecl:&quot;+newline+my_xml.docTypeDecl+newline+newline; my_txt.text += &quot;packet:&quot;+newline+my_xml.toString()+newline+newline; } else { my_txt.text = &quot;Unable to load remote XML.&quot;+newline+newline; } my_txt.text += &quot;loaded in: &quot;+elapsedTime+&quot; ms.&quot;;};my_xml.load(&quot;http://www.helpexamples.com/crossdomain.xml&quot;var startTime:Number = getTimer(See alsodocTypeDecl (XML.docTypeDecl property)" />
   <page href="00005625.html" title="XMLNode" text="ModifiersPropertyDescriptionattributes:ObjectAn object containing all of the attributes of the specified XML instance.childNodes:Array [read-only]An array of the specified XML object&#39;s children.firstChild:XMLNode [read-only]Evaluates the specified XML object and references the first child in the parent node&#39;s child list.lastChild:XMLNode [read-only]An XMLNode value that references the last child in the node&#39;s child list.nextSibling:XMLNode [read-only]An XMLNode value that references the next sibling in the parent node&#39;s child list.nodeName:StringA string representing the node name of the XML object.nodeType:Number [read-only]A nodeType value, either 1 for an XML element or 3 for a text node.nodeValue:StringThe node value of the XML object.parentNode:XMLNode [read-only]An XMLNode value that references the parent node of the specified XML object, or returns null if the node has no parent.previousSibling:XMLNode [read-only]An XMLNode value that references the previous sibling in the parent node&#39;s child list.constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)ModifiersSignatureDescriptionappendChild(newChild:XMLNode) : VoidAppends the specified node to the XML object&#39;s child list.cloneNode(deep:Boolean) : XMLNodeConstructs and returns a new XML node of the same type, name, value, and attributes as the specified XML object.hasChildNodes() : BooleanSpecifies whether or not the XML object has child nodes.insertBefore(newChild:XMLNode, insertPoint:XMLNode) : VoidInserts a newChild node into the XML object&#39;s child list, before the insertPoint node.removeNode() : VoidRemoves the specified XML object from its parent.toString() : StringEvaluates the specified XML object, constructs a textual representation of the XML structure, including the node, children, and attributes, and returns the result as a string.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)XMLNodeObject | +-XMLNodepublic class XMLNodeextends ObjectAn XML document is represented in Flash by the XML class. Each element of the hierarchical document is represented by an XMLNode object.See alsohasXMLSocket (capabilities.hasXMLSocket property)Property summaryProperties inherited from class ObjectMethod summaryMethods inherited from class Object" />
   <page href="00005626.html" title="appendChild (XMLNode.appendChild method)" text="appendChild (XMLNode.appendChild method)public appendChild(newChild:XMLNode) : VoidAppends the specified node to the XML object&#39;s child list. This method operates directly on the node referenced by the childNode parameter; it does not append a copy of the node. If the node to be appended already exists in another tree structure, appending the node to the new location will remove it from its current location. If the childNode parameter refers to a node that already exists in another XML tree structure, the appended child node is placed in the new tree structure after it is removed from its existing parent node.ParametersnewChild:XMLNode - An XMLNode that represents the node to be moved from its current location to the child list of the my_xml object.ExampleThis example does the following things in the order shown: Creates two empty XML documents, doc1 and doc2.Creates a new node using the createElement() method, and appends it, using the appendChild() method, to the XML document named doc1. Shows how to move a node using the appendChild() method, by moving the root node from doc1 to doc2. Clones the root node from doc2 and appends it to doc1.Creates a new node and appends it to the root node of the XML document doc1.var doc1:XML = new XML(var doc2:XML = new XML(// create a root node and add it to doc1var rootnode:XMLNode = doc1.createElement(&quot;root&quot;doc1.appendChild(rootnodetrace (&quot;doc1: &quot; + doc1 // output: doc1: &lt;root /&gt;trace (&quot;doc2: &quot; + doc2 // output: doc2:// move the root node to doc2doc2.appendChild(rootnodetrace (&quot;doc1: &quot; + doc1 // output: doc1:trace (&quot;doc2: &quot; + doc2 // output: doc2: &lt;root /&gt;// clone the root node and append it to doc1var clone:XMLNode = doc2.firstChild.cloneNode(truedoc1.appendChild(clonetrace (&quot;doc1: &quot; + doc1 // output: doc1: &lt;root /&gt;trace (&quot;doc2: &quot; + doc2 // output: doc2: &lt;root /&gt;// create a new node to append to root node (named clone) of doc1var newNode:XMLNode = doc1.createElement(&quot;newbie&quot;clone.appendChild(newNodetrace (&quot;doc1: &quot; + doc1 // output: doc1: &lt;root&gt;&lt;newbie /&gt;&lt;/root&gt;" />
   <page href="00005627.html" title="attributes (XMLNode.attributes property)" text="attributes (XMLNode.attributes property)public attributes : ObjectAn object containing all of the attributes of the specified XML instance. The XML.attributes object contains one variable for each attribute of the XML instance. Because these variables are defined as part of the object, they are generally referred to as properties of the object. The value of each attribute is stored in the corresponding property as a string. For example, if you have an attribute named color, you would retrieve that attribute&#39;s value by specifying color as the property name, as the following code shows: var myColor:String = doc.firstChild.attributes.colorExampleThe following example shows the XML attribute names: // create a tag called &#39;mytag&#39; with // an attribute called &#39;name&#39; with value &#39;Val&#39;var doc:XML = new XML(&quot;&lt;mytag name= &quot;Val &quot;&gt; item &lt;/mytag&gt;&quot;// assign the value of the &#39;name&#39; attribute to variable yvar y:String = doc.firstChild.attributes.name;trace (y // output: Val// create a new attribute named &#39;order&#39; with value &#39;first&#39;doc.firstChild.attributes.order = &quot;first&quot;;// assign the value of the &#39;order&#39; attribute to variable zvar z:String = doc.firstChild.attributes.ordertrace(z // output: firstThe following is displayed in the Output panel:Valfirst" />
   <page href="00005628.html" title="childNodes (XMLNode.childNodes property)" text="childNodes (XMLNode.childNodes property)public childNodes : Array [read-only]An array of the specified XML object&#39;s children. Each element in the array is a reference to an XML object that represents a child node. This is a read-only property and cannot be used to manipulate child nodes. Use the appendChild(), insertBefore(), and removeNode() methods to manipulate child nodes. This property is undefined for text nodes (nodeType == 3).ExampleThe following example shows how to use the XML.childNodes property to return an array of child nodes: // create a new XML documentvar doc:XML = new XML(// create a root nodevar rootNode:XMLNode = doc.createElement(&quot;rootNode&quot;// create three child nodesvar oldest:XMLNode = doc.createElement(&quot;oldest&quot;var middle:XMLNode = doc.createElement(&quot;middle&quot;var youngest:XMLNode = doc.createElement(&quot;youngest&quot;// add the rootNode as the root of the XML document treedoc.appendChild(rootNode// add each of the child nodes as children of rootNoderootNode.appendChild(oldestrootNode.appendChild(middlerootNode.appendChild(youngest// create an array and use rootNode to populate itvar firstArray:Array = doc.childNodes;trace (firstArray // output: &lt;rootNode&gt;&lt;oldest /&gt;&lt;middle /&gt;&lt;youngest /&gt;&lt;/rootNode&gt;// create another array and use the child nodes to populate itvar secondArray:Array = rootNode.childNodes;trace(secondArray // output: &lt;oldest /&gt;,&lt;middle /&gt;,&lt;youngest /&gt;See alsonodeType (XMLNode.nodeType property), appendChild (XMLNode.appendChild method), insertBefore (XMLNode.insertBefore method), removeNode (XMLNode.removeNode method)" />
   <page href="00005629.html" title="cloneNode (XMLNode.cloneNode method)" text="cloneNode (XMLNode.cloneNode method)public cloneNode(deep:Boolean) : XMLNodeConstructs and returns a new XML node of the same type, name, value, and attributes as the specified XML object. If deep is set to true, all child nodes are recursively cloned, resulting in an exact copy of the original object&#39;s document tree. The clone of the node that is returned is no longer associated with the tree of the cloned item. Consequently, nextSibling, parentNode, and previousSibling all have a value of null. If the deep parameter is set to false, or the my_xml node has no child nodes, firstChild and lastChild are also null.Parametersdeep:Boolean - A Boolean value; if set to true, the children of the specified XML object will be recursively cloned.ReturnsXMLNode - An XMLNode Object.ExampleThe following example shows how to use the XML.cloneNode() method to create a copy of a node: // create a new XML documentvar doc:XML = new XML(// create a root nodevar rootNode:XMLNode = doc.createElement(&quot;rootNode&quot;// create three child nodesvar oldest:XMLNode = doc.createElement(&quot;oldest&quot;var middle:XMLNode = doc.createElement(&quot;middle&quot;var youngest:XMLNode = doc.createElement(&quot;youngest&quot;// add the rootNode as the root of the XML document treedoc.appendChild(rootNode// add each of the child nodes as children of rootNoderootNode.appendChild(oldestrootNode.appendChild(middlerootNode.appendChild(youngest// create a copy of the middle node using cloneNode()var middle2:XMLNode = middle.cloneNode(false// insert the clone node into rootNode between the middle and youngest nodesrootNode.insertBefore(middle2, youngesttrace(rootNode// output (with line breaks added): // &lt;rootNode&gt;// &lt;oldest /&gt;// &lt;middle /&gt;// &lt;middle /&gt;// &lt;youngest /&gt;// &lt;/rootNode&gt;// create a copy of rootNode using cloneNode() to demonstrate a deep copyvar rootClone:XMLNode = rootNode.cloneNode(true// insert the clone, which contains all child nodes, to rootNoderootNode.appendChild(rootClonetrace(rootNode // output (with line breaks added): // &lt;rootNode&gt;// &lt;oldest /&gt;// &lt;middle /&gt;// &lt;middle /&gt;// &lt;youngest /&gt;// &lt;rootNode&gt;// &lt;oldest /&gt;// &lt;middle /&gt;// &lt;middle /&gt;// &lt;youngest /&gt;// &lt;/rootNode&gt;// &lt;/rootNode&gt;" />
   <page href="00005630.html" title="firstChild (XMLNode.firstChild property)" text="firstChild (XMLNode.firstChild property)public firstChild : XMLNode [read-only]Evaluates the specified XML object and references the first child in the parent node&#39;s child list. This property is null if the node does not have children. This property is undefined if the node is a text node. This is a read-only property and cannot be used to manipulate child nodes; use the appendChild(), insertBefore(), and removeNode() methods to manipulate child nodes.ExampleThe following example shows how to use XML.firstChild to loop through a node&#39;s child nodes: // create a new XML documentvar doc:XML = new XML(// create a root nodevar rootNode:XMLNode = doc.createElement(&quot;rootNode&quot;// create three child nodesvar oldest:XMLNode = doc.createElement(&quot;oldest&quot;var middle:XMLNode = doc.createElement(&quot;middle&quot;var youngest:XMLNode = doc.createElement(&quot;youngest&quot;// add the rootNode as the root of the XML document treedoc.appendChild(rootNode// add each of the child nodes as children of rootNoderootNode.appendChild(oldestrootNode.appendChild(middlerootNode.appendChild(youngest// use firstChild to iterate through the child nodes of rootNodefor (var aNode:XMLNode = rootNode.firstChild; aNode != null; aNode = aNode.nextSibling) { trace(aNode}// output:// &lt;oldest /&gt;// &lt;middle /&gt;// &lt;youngest /&gt;The following example is from the XML_languagePicker FLA file in the Examples directory and can be found in the languageXML.onLoad event handler function definition:// loop through the strings in each language node// adding each string as a new element in the language arrayfor (var stringNode:XMLNode = childNode.firstChild; stringNode != null; stringNode = stringNode.nextSibling, j++) { masterArray[i][j] = stringNode.firstChild.nodeValue;}To view the entire script, see XML_languagePicker.fla in the ActionScript samples folder at at www.adobe.com/go/learn_fl_samples. Download and decompress the .zip file and navigate to the folder for your version of ActionScript to access the sample.See alsoappendChild (XMLNode.appendChild method), insertBefore (XMLNode.insertBefore method), removeNode (XMLNode.removeNode method)" />
   <page href="00005631.html" title="hasChildNodes (XMLNode.hasChildNodes method)" text="hasChildNodes (XMLNode.hasChildNodes method)public hasChildNodes() : BooleanSpecifies whether or not the XML object has child nodes.ReturnsBoolean - true if the specified XMLNode has one or more child nodes; otherwise false.ExampleThe following example creates a new XML packet. If the root node has child nodes, the code loops over each child node to display the name and value of the node. Add the following ActionScript to your FLA or AS file: var my_xml:XML = new XML(&quot;hankrudolph&quot;if (my_xml.firstChild.hasChildNodes()) {// use firstChild to iterate through the child nodes of rootNode for (var aNode:XMLNode = my_xml.firstChild.firstChild; aNode != null; aNode=aNode.nextSibling) { if (aNode.nodeType == 1) { trace(aNode.nodeName+&quot;: t&quot;+aNode.firstChild.nodeValue } }}The following is displayed in the Output panel:output:username: hankpassword: rudolph " />
   <page href="00005632.html" title="insertBefore (XMLNode.insertBefore method)" text="insertBefore (XMLNode.insertBefore method)public insertBefore(newChild:XMLNode, insertPoint:XMLNode) : VoidInserts a newChild node into the XML object&#39;s child list, before the insertPoint node. If insertPoint is not a child of the XMLNode object, the insertion fails.ParametersnewChild:XMLNode - The XMLNode object to be inserted.insertPoint:XMLNode - The XMLNode object that will follow the newChild node after the method is invoked.ExampleThe following inserts a new XML node between two existing nodes: var my_xml:XML = new XML(&quot;&lt;a&gt;1&lt;/a&gt; n&lt;c&gt;3&lt;/c&gt;&quot;var insertPoint:XMLNode = my_xml.lastChild;var newNode:XML = new XML(&quot;&lt;b&gt;2&lt;/b&gt; n&quot;my_xml.insertBefore(newNode, insertPointtrace(my_xml See alsohasXMLSocket (capabilities.hasXMLSocket property), cloneNode (XMLNode.cloneNode method)" />
   <page href="00005633.html" title="lastChild (XMLNode.lastChild property)" text="lastChild (XMLNode.lastChild property)public lastChild : XMLNode [read-only]An XMLNode value that references the last child in the node&#39;s child list. The XML.lastChild property is null if the node does not have children. This property cannot be used to manipulate child nodes; use the appendChild(), insertBefore(), and removeNode() methods to manipulate child nodes.ExampleThe following example uses the XML.lastChild property to iterate through the child nodes of an XML node, beginning with the last item in the node&#39;s child list and ending with the first child of the node&#39;s child list: // create a new XML documentvar doc:XML = new XML(// create a root nodevar rootNode:XMLNode = doc.createElement(&quot;rootNode&quot;// create three child nodesvar oldest:XMLNode = doc.createElement(&quot;oldest&quot;var middle:XMLNode = doc.createElement(&quot;middle&quot;var youngest:XMLNode = doc.createElement(&quot;youngest&quot;// add the rootNode as the root of the XML document treedoc.appendChild(rootNode// add each of the child nodes as children of rootNoderootNode.appendChild(oldestrootNode.appendChild(middlerootNode.appendChild(youngest// use lastChild to iterate through the child nodes of rootNodefor (var aNode:XMLNode = rootNode.lastChild; aNode != null; aNode = aNode.previousSibling) { trace(aNode}// output:// &lt;youngest /&gt;// &lt;middle /&gt;// &lt;oldest /&gt;The following example creates a new XML packet and uses the XML.lastChild property to iterate through the child nodes of the root node:// create a new XML documentvar doc:XML = new XML(&quot;&quot;var rootNode:XMLNode = doc.firstChild;// use lastChild to iterate through the child nodes of rootNodefor (var aNode:XMLNode = rootNode.lastChild; aNode != null; aNode=aNode.previousSibling) { trace(aNode}// output:// &lt;youngest /&gt;// &lt;middle /&gt;// &lt;oldest /&gt;See alsoappendChild (XMLNode.appendChild method), insertBefore (XMLNode.insertBefore method), removeNode (XMLNode.removeNode method), hasXMLSocket (capabilities.hasXMLSocket property)" />
   <page href="00005634.html" title="nextSibling (XMLNode.nextSibling property)" text="nextSibling (XMLNode.nextSibling property)public nextSibling : XMLNode [read-only]An XMLNode value that references the next sibling in the parent node&#39;s child list. This property is null if the node does not have a next sibling node. This property cannot be used to manipulate child nodes; use the appendChild(), insertBefore(), and removeNode() methods to manipulate child nodes.ExampleThe following example is an excerpt from the example for the XML.firstChild property, and shows how you can use the XML.nextSibling property to loop through an XML node&#39;s child nodes: for (var aNode:XMLNode = rootNode.firstChild; aNode != null; aNode = aNode.nextSibling) { trace(aNode}See alsofirstChild (XMLNode.firstChild property), appendChild (XMLNode.appendChild method), insertBefore (XMLNode.insertBefore method), removeNode (XMLNode.removeNode method), hasXMLSocket (capabilities.hasXMLSocket property)" />
   <page href="00005635.html" title="nodeName (XMLNode.nodeName property)" text="nodeName (XMLNode.nodeName property)public nodeName : StringA string representing the node name of the XML object. If the XML object is an XML element (nodeType == 1), nodeName is the name of the tag that represents the node in the XML file. For example, TITLE is the nodeName of an HTML TITLE tag. If the XML object is a text node (nodeType == 3), nodeName is null.ExampleThe following example creates an element node and a text node, and checks the node name of each: // create an XML documentvar doc:XML = new XML(// create an XML node using createElement()var myNode:XMLNode = doc.createElement(&quot;rootNode&quot;// place the new node into the XML treedoc.appendChild(myNode// create an XML text node using createTextNode()var myTextNode:XMLNode = doc.createTextNode(&quot;textNode&quot;// place the new node into the XML treemyNode.appendChild(myTextNodetrace(myNode.nodeNametrace(myTextNode.nodeName// output:// rootNode// nullThe following example creates a new XML packet. If the root node has child nodes, the code loops over each child node to display the name and value of the node. Add the following ActionScript to your FLA or AS file:var my_xml:XML = new XML(&quot;hankrudolph&quot;if (my_xml.firstChild.hasChildNodes()) { // use firstChild to iterate through the child nodes of rootNode for (var aNode:XMLNode = my_xml.firstChild.firstChild; aNode != null; aNode=aNode.nextSibling) { if (aNode.nodeType == 1) { trace(aNode.nodeName+&quot;: t&quot;+aNode.firstChild.nodeValue } }}The following node names are displayed in the Output panel:output:username: hankpassword: rudolphSee alsonodeType (XMLNode.nodeType property)" />
   <page href="00005636.html" title="nodeType (XMLNode.nodeType property)" text="Integer valueDefined constant1ELEMENT_NODE2ATtrIBUTE_NODE3TEXT_NODE4CDATA_SECTION_NODE5NTITY_REFERENCE_NODE6ENTITY_NODE7PROCESSING_INStrUCTION_NODE8COMMENT_NODE9DOCUMENT_NODE10DOCUMENT_TYPE_NODE11DOCUMENT_FRAGMENT_NODE12NOTATION_NODEnodeType (XMLNode.nodeType property)public nodeType : Number [read-only]A nodeType value, either 1 for an XML element or 3 for a text node. The nodeType is a numeric value from the NodeType enumeration in the W3C DOM Level 1 recommendation: www.w3.org/tr/1998/REC-DOM-Level-1-19981001/level-one-core.html. The following table lists the values:In Flash Player, the built-in XML class only supports 1 (ELEMENT_NODE) and 3 (TEXT_NODE). ExampleThe following example creates an element node and a text node, and checks the node type of each: // create an XML documentvar doc:XML = new XML(// create an XML node using createElement()var myNode:XMLNode = doc.createElement(&quot;rootNode&quot;// place the new node into the XML treedoc.appendChild(myNode// create an XML text node using createTextNode()var myTextNode:XMLNode = doc.createTextNode(&quot;textNode&quot;// place the new node into the XML treemyNode.appendChild(myTextNodetrace(myNode.nodeTypetrace(myTextNode.nodeType// output:// 1// 3See alsonodeValue (XMLNode.nodeValue property)" />
   <page href="00005637.html" title="nodeValue (XMLNode.nodeValue property)" text="nodeValue (XMLNode.nodeValue property)public nodeValue : StringThe node value of the XML object. If the XML object is a text node, the nodeType is 3, and the nodeValue is the text of the node. If the XML object is an XML element (nodeType is 1), nodeValue is null and read-onlyExampleThe following example creates an element node and a text node, and checks the node value of each: // create an XML documentvar doc:XML = new XML(// create an XML node using createElement()var myNode:XMLNode = doc.createElement(&quot;rootNode&quot;// place the new node into the XML treedoc.appendChild(myNode// create an XML text node using createTextNode()var myTextNode:XMLNode = doc.createTextNode(&quot;textNode&quot;// place the new node into the XML treemyNode.appendChild(myTextNodetrace(myNode.nodeValuetrace(myTextNode.nodeValue// output:// null// myTextNodeThe following example creates and parses an XML packet. The code loops through each child node, and displays the node value using the firstChild property and firstChild.nodeValue. When you use firstChild to display contents of the node, it maintains the &amp;amp; entity. However, when you explicitly use nodeValue, it converts to the ampersand character (&amp;).var my_xml:XML = new XML(&quot;mortongood&amp;evil&quot;trace(&quot;using firstChild:&quot;for (var i = 0; i&lt;my_xml.firstChild.childNodes.length; i++) { trace(&quot; t&quot;+my_xml.firstChild.childNodes[i].firstChild}trace(&quot;&quot;trace(&quot;using firstChild.nodeValue:&quot;for (var i = 0; i&lt;my_xml.firstChild.childNodes.length; i++) { trace(&quot; t&quot;+my_xml.firstChild.childNodes[i].firstChild.nodeValue}The following information is displayed in the Output panel:using firstChild: morton good&amp;evilusing firstChild.nodeValue: morton good&amp;evilSee alsonodeType (XMLNode.nodeType property)" />
   <page href="00005638.html" title="parentNode (XMLNode.parentNode property)" text="parentNode (XMLNode.parentNode property)public parentNode : XMLNode [read-only]An XMLNode value that references the parent node of the specified XML object, or returns null if the node has no parent. This is a read-only property and cannot be used to manipulate child nodes; use the appendChild(), insertBefore(), and removeNode() methods to manipulate child nodes.ExampleThe following example creates an XML packet and displays the parent node of the username node in the Output panel: var my_xml:XML = new XML(&quot;mortongood&amp;evil&quot;// first child is the &lt;login /&gt; nodevar rootNode:XMLNode = my_xml.firstChild;// first child of the root is the &lt;username /&gt; nodevar targetNode:XMLNode = rootNode.firstChild; trace(&quot;the parent node of &#39;&quot;+targetNode.nodeName+&quot;&#39; is: &quot;+targetNode.parentNode.nodeNametrace(&quot;contents of the parent node are: n&quot;+targetNode.parentNode// output (line breaks added for clarity):the parent node of &#39;username&#39; is: logincontents of the parent node are: morton good&amp;evilSee alsoappendChild (XMLNode.appendChild method), insertBefore (XMLNode.insertBefore method), removeNode (XMLNode.removeNode method), hasXMLSocket (capabilities.hasXMLSocket property)" />
   <page href="00005639.html" title="previousSibling (XMLNode.previousSibling property)" text="previousSibling (XMLNode.previousSibling property)public previousSibling : XMLNode [read-only]An XMLNode value that references the previous sibling in the parent node&#39;s child list. The property has a value of null if the node does not have a previous sibling node. This property cannot be used to manipulate child nodes; use the appendChild(), insertBefore(), and removeNode() methods to manipulate child nodes.ExampleThe following example is an excerpt from the example for the XML.lastChild property, and shows how you can use the XML.previousSibling property to loop through an XML node&#39;s child nodes: for (var aNode:XMLNode = rootNode.lastChild; aNode != null; aNode = aNode.previousSibling) { trace(aNode}See alsolastChild (XMLNode.lastChild property), appendChild (XMLNode.appendChild method), insertBefore (XMLNode.insertBefore method), removeNode (XMLNode.removeNode method), hasXMLSocket (capabilities.hasXMLSocket property)" />
   <page href="00005640.html" title="removeNode (XMLNode.removeNode method)" text="removeNode (XMLNode.removeNode method)public removeNode() : VoidRemoves the specified XML object from its parent. Also deletes all descendants of the node.ExampleThe following example creates an XML packet, and then deletes the specified XML object and its descendant nodes: var xml_str:String = &quot;&lt;state name= &quot;California &quot;&gt;&lt;city&gt;San Francisco&lt;/city&gt;&lt;/state&gt;&quot;;var my_xml:XML = new XML(xml_strvar cityNode:XMLNode = my_xml.firstChild.firstChild;trace(&quot;before XML.removeNode(): n&quot;+my_xmlcityNode.removeNode(trace(&quot;&quot;trace(&quot;after XML.removeNode(): n&quot;+my_xml// output (line breaks added for clarity):// // before XML.removeNode():// &lt;state name=&quot;California&quot;&gt;// &lt;city&gt;San Francisco&lt;/city&gt;// &lt;/state&gt;// // after XML.removeNode():// &lt;state name=&quot;California&quot; /&gt;" />
   <page href="00005641.html" title="toString (XMLNode.toString method)" text="toString (XMLNode.toString method)public toString() : StringEvaluates the specified XML object, constructs a textual representation of the XML structure, including the node, children, and attributes, and returns the result as a string. For top-level XML objects (those created with the constructor), the XML.toString() method outputs the document&#39;s XML declaration (stored in the XML.xmlDecl property), followed by the document&#39;s DOCTYPE declaration (stored in the XML.docTypeDecl property), followed by the text representation of all XML nodes in the object. The XML declaration is not output if the XML.xmlDecl property is undefined. The DOCTYPE declaration is not output if the XML.docTypeDecl property is undefined.ReturnsString - String.ExampleThe following code uses the toString() method to convert an XMLNode object to a String, and then uses the toUpperCase() method of the String class: var xString = &quot;&lt;first&gt;Mary&lt;/first&gt;&quot; + &quot;&lt;last&gt;Ng&lt;/last&gt;&quot;var my_xml:XML = new XML(xStringvar my_node:XMLNode = my_xml.childNodes[1];trace(my_node.toString().toUpperCase() // &lt;LAST&gt;NG&lt;See alsodocTypeDecl (XML.docTypeDecl property), xmlDecl (XML.xmlDecl property)" />
   <page href="00005642.html" title="XMLSocket" text="constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)EventDescriptiononClose = function() {}Invoked only when the server closes an open connection.onConnect = function(success:Boolean) {}An asynchronous callback that the Flash Lite player invokes when a connection request initiated through XMLSocket.connect() succeeds or fails.onData = function(src:String) {}Invoked when a message is downloaded from the server and terminated by a zero (0) byte.onXML = function(src:XML) {}Invoked by the Flash Lite player when the specified XML object containing an XML document arrives over an open XMLSocket connection.SignatureDescriptionXMLSocket()Creates a new XMLSocket object.ModifiersSignatureDescriptionclose() : VoidCloses the connection that the XMLSocket object specifies.connect(url:String, port:Number) : BooleanEstablishes a connection to the specified Internet host by using the specified TCP port and returns true or false, depending on whether a connection is successfully initiated.send(data:Object) : VoidConverts the XML object or data specified in the object parameter to a string and transmits it to the server, followed by a zero (0) byte.addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)XMLSocketObject | +-XMLSocketpublic class XMLSocketextends ObjectThe XMLSocket class implements client sockets that let the device running the Flash Lite player communicate with a server computer that an IP address or domain name identifies. The XMLSocket class is useful for client-server applications that require low latency, such as real-time chat systems. A traditional HTTP-based chat system frequently polls the server and downloads new messages by using an HTTP request. In contrast, an XMLSocket chat solution maintains an open connection to the server, which lets the server immediately send incoming messages without a request from the client. To use the XMLSocket class, the server computer must run a daemon process that understands the protocol that the XMLSocket class uses. The following list describes the protocol: XML messages are sent over a full-duplex TCP/IP stream socket connection.Each XML message is a complete XML document, terminated by a zero (0) byte.An unlimited number of XML messages can be sent and received over a single XMLSocket connection. The following restrictions apply to how and where an XMLSocket object can connect to the server: To connect an XMLSocket to a port lower than 1024, you must first load a policy file with the System.security.loadPolicyFile() method, even when your application connects to its own exact domain. The XMLSocket.connect() method can connect only to computers in the same domain where the SWF file resides. This restriction does not apply to SWF files running on a local disk. (This restriction is identical to the security rules for the loadVariables() function, and the XML.sendAndLoad() and XML.load() methods.) To connect to a server daemon running in a domain other than the one where the SWF file resides, you can create a security policy file on the server that allows access from specific domains. Setting up a server to communicate with the XMLSocket object can be challenging. If your application does not require real-time interactivity, use the loadVariables() function, or Flash HTTP-based XML server connectivity methods (XML.load(), XML.sendAndLoad(), XML.send()), instead of the XMLSocket class. To use the methods of the XMLSocket class, you must first use the constructor, XMLSocket(), to create an XMLSocket object.See alsoloadPolicyFile (security.loadPolicyFile method)Property summaryProperties inherited from class ObjectEvent summaryConstructor summaryMethod summaryMethods inherited from class Object" />
   <page href="00005643.html" title="close (XMLSocket.close method)" text="close (XMLSocket.close method)public close() : VoidCloses the connection that the XMLSocket object specifies.ExampleThe following simple example creates an XMLSocket object, attempts to connect to the server, and then closes the connection. var socket:XMLSocket = new XMLSocket(socket.connect(null, 2000socket.close(See alsoconnect (XMLSocket.connect method)" />
   <page href="00005644.html" title="connect (XMLSocket.connect method)" text="connect (XMLSocket.connect method)public connect(url:String, port:Number) : BooleanEstablishes a connection to the specified Internet host by using the specified TCP port and returns true or false, depending on whether a connection is successfully initiated. If the XMLSocket.connect() method returns a value of true, the initial stage of the connection process is successful; later, the XMLSocket.onConnect() method is invoked to determine whether the final connection succeeded or failed. If XMLSocket.connect() returns false, a connection could not be established. If you do not know the port number of your Internet host computer, contact your network administrator. To connect an XMLSocket to a port lower than 1024, you must first load a policy file with the System.security.loadPolicyFile() method. If you specify null for the host parameter, the host contacted is the one where the SWF file calling XMLSocket.connect() resides. For example, if the SWF file was downloaded from www.example.com, specifying null for the host parameter is the same as entering the IP address for www.example.com.In SWF files of any version running in Flash Player 7 or later, the host parameter must be in exactly the same domain. For example, a SWF file at www.someDomain.com that is published for Flash Player 5, but is running in Flash Player 7 or later can load variables only from SWF files that are also at www.someDomain.com. If you want to load variables from a different domain, you can place a cross-domain policy file on the server hosting the SWF file that is being accessed. Note: The XMLSocket.connect() method returns false if System.capabilities.hasXMLSocket is false.Parametersurl:String - String; A fully qualified DNS domain name or an IP address in the form aaa.bbb.ccc.ddd. You can also specify null to connect to the host server on which the SWF file resides. If the SWF file issuing this call is running in a web browser, the host parameter must be in the same domain as the SWF file.port:Number - Number; The TCP port number on the host used to establish a connection.ReturnsBoolean - A value of true if the connection is successful; false otherwise.ExampleThe following example uses the XMLSocket.connect() method to connect to the host where the SWF file resides and uses the trace() function to display the return value indicating the success or failure of the connection: var socket:XMLSocket = new XMLSocket()socket.onConnect = function (success:Boolean) { if (success) { trace (&quot;Connection succeeded!&quot; } else { trace (&quot;Connection failed!&quot; }}if (!socket.connect(null, 2000)) { trace (&quot;Connection failed!&quot;}See alsoonConnect (XMLSocket.onConnect handler), Array function, loadPolicyFile (security.loadPolicyFile method)" />
   <page href="00005645.html" title="onClose (XMLSocket.onClose handler)" text="onClose (XMLSocket.onClose handler)onClose = function() {}Invoked only when the server closes an open connection. The default implementation of this method performs no actions. To override the default implementation, you must assign a function containing custom actions.ExampleThe following example executes a trace statement if the server closes an open connection: var socket:XMLSocket = new XMLSocket(socket.connect(null, 2000socket.onClose = function () { trace(&quot;Connection to server lost.&quot;}See alsoonConnect (XMLSocket.onConnect handler), Array function" />
   <page href="00005646.html" title="onConnect (XMLSocket.onConnect handler)" text="onConnect (XMLSocket.onConnect handler)onConnect = function(success:Boolean) {}An asynchronous callback that the Flash Lite player invokes when a connection request initiated through XMLSocket.connect() succeeds or fails. If the connection succeeds, the success parameter has a value of true; otherwise the success parameter has a value of false. The default implementation of this method performs no actions. To override the default implementation, you must assign a function containing custom actions.Parameterssuccess:Boolean - A Boolean value indicating whether a socket connection is successfully established. If the connection succeeded, the success parameter has a value of true; otherwise the success parameter has a value of false.ExampleThe following example illustrates the process of specifying a replacement function for the onConnect() event handler in a simple chat application. After creating the XMLSocket object by using the constructor method, the script defines the custom function to be executed when the onConnect() event handler is invoked. The function controls the screen to which users are taken, depending on whether a connection is successfully established. If the connection is successfully made, users are taken to the main chat screen on the frame labeled startChat. If the connection is not successful, users go to a screen with troubleshooting information on the frame labeled connectionFailed. var socket:XMLSocket = new XMLSocket(socket.onConnect = function (success) { if (success) { gotoAndPlay(&quot;startChat&quot; } else { gotoAndStop(&quot;connectionFailed&quot; }}Now that the onConnect() handler is defined, the connect() method is invoked to attempt to establish the connection. If the connect() method returns a value of false, the SWF file is sent directly to the frame labeled connectionFailed, and onConnect() is never invoked. If the connect() method returns true, the SWF file jumps to a frame labeled waitForConnection, which is the &quot;Please wait&quot; screen. The SWF file remains on the waitForConnection frame until the onConnect() handler is invoked, which happens at some point in the future depending on network latency. if (!socket.connect(null, 2000)) { gotoAndStop(&quot;connectionFailed&quot;} else { gotoAndStop(&quot;waitForConnection&quot;}See alsoconnect (XMLSocket.connect method), Array function" />
   <page href="00005647.html" title="onData (XMLSocket.onData handler)" text="onData (XMLSocket.onData handler)onData = function(src:String) {}Invoked when a message is downloaded from the server and terminated by a zero (0) byte. You can override the XMLSocket.onData event handler to intercept data that the server sends without parsing it as XML. This capability is useful if you&#39;re transmitting arbitrarily formatted data packets, and you&#39;d prefer to manipulate the data directly when it arrives, rather than have Flash Player parse the data as XML. By default, the XMLSocket.onData method invokes the XMLSocket.onXML method. If you override XMLSocket.onData with custom behavior, XMLSocket.onXML is not called unless you call it in your implementation of XMLSocket.onData. Parameterssrc:String - A string containing data that the server sends.ExampleIn this example, the src parameter is a string containing XML text downloaded from the server. The zero (0) byte terminator is not included in the string. XMLSocket.prototype.onData = function (src) { this.onXML(new XML(src)}" />
   <page href="00005648.html" title="onXML (XMLSocket.onXML handler)" text="onXML (XMLSocket.onXML handler)onXML = function(src:XML) {}Invoked by the Flash Lite player when the specified XML object containing an XML document arrives over an open XMLSocket connection. An XMLSocket connection can be used to transfer an unlimited number of XML documents between the client and the server. Each document is terminated with a zero (0) byte. When the Flash Lite player receives the zero byte, it parses all the XML received since the previous zero byte or since the connection was established if this is the first message received. Each batch of parsed XML is treated as a single XML document and passed to the onXML() method. The default implementation of this method performs no actions. To override the default implementation, you must assign a function containing actions that you define.Parameterssrc:XML - An XML object that contains a parsed XML document received from a server.ExampleThe following function overrides the default implementation of the onXML() method in a simple chat application. The myOnXML() function instructs the chat application to recognize a single XML element, MESSAGE, in the following format: &lt;MESSAGE USER=&quot;John&quot; TEXT=&quot;Hello, my name is John!&quot; /&gt;. var socket:XMLSocket = new XMLSocket(In the following example, the displayMessage() function is assumed to be a user-defined function that displays the message that the user receives:socket.onXML = function (doc) { var e = doc.firstChild; if (e != null &amp;&amp; e.nodeName == &quot;MESSAGE&quot;) { displayMessage(e.attributes.user, e.attributes.text }}See alsoArray function" />
   <page href="00005649.html" title="send (XMLSocket.send method)" text="send (XMLSocket.send method)public send(data:Object) : VoidConverts the XML object or data specified in the object parameter to a string and transmits it to the server, followed by a zero (0) byte. If object is an XML object, the string is the textual representation of the XML object. The send operation is asynchronous; it returns immediately, but the data can be transmitted at a later time. The XMLSocket.send() method does not return a value indicating whether the data was successfully transmitted. If the XMLSocket object is not connected to the server (using the XMLSocket.connect() method), the XMLSocket.send() operation fails. Parametersdata:Object - An XML object or other data to transmit to the server.ExampleThe following example shows how to specify a user name and password to send the my_xml XML object to the server: var myXMLSocket:XMLSocket = new XMLSocket(var my_xml:XML = new XML(var myLogin:XMLNode = my_xml.createElement(&quot;login&quot;myLogin.attributes.username = usernameTextField;myLogin.attributes.password = passwordTextField;my_xml.appendChild(myLoginmyXMLSocket.send(my_xmlSee alsoconnect (XMLSocket.connect method)" />
   <page href="00005650.html" title="XMLSocket constructor" text="XMLSocket constructorpublic XMLSocket()Creates a new XMLSocket object. The XMLSocket object is not initially connected to any server. You must call the XMLSocket.connect() method to connect the object to a server.ExampleThe following example creates an XMLSocket object: var socket:XMLSocket = new XMLSocket(" />
   <page href="00005651.html" title="Deprecated ActionScript" text="Deprecated ActionScriptThe evolution of ActionScript has deprecated many elements of the language. This section lists the deprecated items and suggests alternatives when available. While deprecated elements still work in Flash Lite 2.0 and later, Adobe recommends that you do not continue using deprecated elements in your code. Support of deprecated elements in the future is not guaranteed." />
   <page href="00005652.html" title="Deprecated Function summary" text="ModifiersFunction NameDescriptioncall(frame:Object)Deprecated since Flash Player 5. This action was deprecated in favor of the function statement.chr(number:Number)StringDeprecated since Flash Player 5. This function was deprecated in favor of String.fromCharCode().getProperty(my_mc:Object, property:Object)ObjectDeprecated since Flash Player 5. This function was deprecated in favor of the dot syntax, which was introduced in Flash Player 5.ifFrameLoaded([scene:String], frame:Object, statement(s):Object)Deprecated since Flash Player 5. This function has been deprecated. Adobe recommends that you use the MovieClip._framesloaded property.int(value:Number)NumberDeprecated since Flash Player 5. This function was deprecated in favor of Math.round().length(expression:String, variable:Object)NumberDeprecated since Flash Player 5. This function, along with all the string functions, has been deprecated. Adobe recommends that you use the methods of the String class and the String.length property to perform the same operations.mbchr(number:Number)Deprecated since Flash Player 5. This function was deprecated in favor of the String.fromCharCode() method.mblength(string:String)NumberDeprecated since Flash Player 5. This function was deprecated in favor of the String.length property.mbord(character:String)NumberDeprecated since Flash Player 5. This function was deprecated in favor of String.charCodeAt() method.mbsubstring(value:String, index:Number, count:Number)StringDeprecated since Flash Player 5. This function was deprecated in favor of String.substr() method.ord(character:String)NumberDeprecated since Flash Player 5. This function was deprecated in favor of the methods and properties of the String class.random(value:Number)NumberDeprecated since Flash Player 5. This function was deprecated in favor of Math.random().substring(string:String, index:Number, count:Number)StringDeprecated since Flash Player 5. This function was deprecated in favor of String.substr().tellTarget(target:String, statement(s):Object)Deprecated since Flash Player 5. Adobe recommends that you use dot (.) notation and the with statement.toggleHighQuality()Deprecated since Flash Player 5. This function was deprecated in favor of _quality.Deprecated Function summary" />
   <page href="00005653.html" title="Deprecated Property summary" text="ModifiersProperty NameDescription$versionDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.version property._cap4WayKeyASDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.has4WayKeyAS property._capCompoundSoundDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasCompoundSound property._capEmailDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasEmail property._capLoadDataDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasDataLoading property._capMFiDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasMFi property._capMIDIDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasMIDI property._capMMSDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasMMS property._capSMAFDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasSMAF property._capSMSDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasSMS property._capStreamSoundDeprecated since Flash Lite Player 2.0. This action was deprecated in favor of the System.capabilities.hasStreamingAudio property.Button._highqualityDeprecated since Flash Player 7. This property was deprecated in favor of Button._quality.MovieClip._highqualityDeprecated since Flash Player 7. This property was deprecated in favor of MovieClip._quality.TextField._highqualityDeprecated since Flash Player 7. This property was deprecated in favor of TextField._quality._highqualityDeprecated since Flash Player 5. This property was deprecated in favor of _quality.maxscrollDeprecated since Flash Player 5. This property was deprecated in favor of TextField.maxscroll.scrollDeprecated since Flash Player 5. This property was deprecated in favor of TextField.scroll.Deprecated Property summary" />
   <page href="00005654.html" title="Deprecated Operator summary" text="OperatorDescription&lt;&gt; (inequality)Deprecated since Flash Player 5. This operator has been deprecated. Adobe recommends that you use the != (inequality) operator.add (concatenation (strings))Deprecated since Flash Player 5. Adobe recommends you use the addition (+) operator when creating content for Flash Player 5 or later.Note: Flash Lite 2.0 also deprecates the add operator in favor of the addition (+) operator.and (logical AND)Deprecated since Flash Player 5. Adobe recommends that you use the logical AND (&amp;&amp;) operator.eq (equality (strings))Deprecated since Flash Player 5. This operator was deprecated in favor of the == (equality) operator.ge (greater than or equal to (strings))Deprecated since Flash Player 5. This operator was deprecated in favor of the &gt;= (greater than or equal to) operator.gt (greater than (strings))Deprecated since Flash Player 5. This operator was deprecated in favor of the &gt; (greater than) operator.le (less than or equal to (strings))Deprecated since Flash Player 5. This operator was deprecated in Flash 5 in favor of the &lt;= (less than or equal to) operator.lt (less than (strings))Deprecated since Flash Player 5. This operator was deprecated in favor of the &lt; (less than) operator.ne (not equal (strings))Deprecated since Flash Player 5. This operator was deprecated in favor of the != (inequality) operator.not (logical NOT)Deprecated since Flash Player 5. This operator was deprecated in favor of the! (logical NOT) operator.or (logical OR)Deprecated since Flash Player 5. This operator was deprecated in favor of the || (logical OR) operator.Deprecated Operator summary" />
   <page href="00005655.html" title="Unsupported ActionScript" text="Unsupported ActionScriptFlash Lite 2.1 does not support the following elements:" />
   <page href="00005656.html" title="Unsupported Classes" text="Accessibility, Camera, ContextMenu, ContextMenuItem, CustomActions, LocalConnection, Locale (mx.lang.Locale), Microphone, NetConnection*, NetStream*, PrintJob, TextField.StyleSheet, TextSnapshot, XMLUIUnsupported Classes* Flash Lite 3.0 adds support for NetConnection and NetStream." />
   <page href="00005657.html" title="Unsupported Methods" text="Mouse.hide, Mouse.show, MovieClip.attachAudio, MovieClip.getTextSnapshot, Selection.getBeginIndex, Selection.getCaretIndex, Selection.getEndIndex, System.setClipboard, System.showSettings, TextField.getFontList, Video.attachVideo*, Video.clearUnsupported Methods* Flash Lite 3.0 adds support for Video.attachVideo." />
   <page href="00005658.html" title="Unsupported Properties" text="Button.blendMode, Button.cacheAsBitmap, Button.filters, Button.menu, Button.useHandCursor, System.capabilities.language, System.capabilities.manufacturer, System.capabilities.pixelAspectRatio, System.capabilities.playerType, System.capabilities.screenColor, System.capabilities.screenDPI, System.capabilities.serverString, Key.isToggled, MovieClip.menu, MovieClip.useHandCursor, Stage.showMenu, System.exactSettings, TextField.menu, TextField.mouseWheelEnabled, TextField.restrict, Video._alpha, Video.deblocking, Video._height, Video.height, Video._name, Video._parent, Video._rotation, Video.smoothing, Video._visible, Video._width, Video.width, Video._x, Video._xmouse, Video._xscale, Video._y, Video._ymouse, Video._yscaleUnsupported Properties" />
   <page href="00005659.html" title="Unsupported Global Functions" text="asfunction, MMExecute, print, printAsBitmap, printAsBitmapNum, printNum, updateAfterEventUnsupported Global Functions" />
   <page href="00005660.html" title="Unsupported Event Handlers" text="onUpdate, Mouse.onMouseWheelUnsupported Event Handlers" />
   <page href="00005661.html" title="Unsupported fscommands" text="allowscale, exec, fullscreen, quit, showmenu, trapallkeysUnsupported fscommands" />
</book>